From 89b65a93a8215bba63898770886b7e5b0bbb85ca Mon Sep 17 00:00:00 2001 From: Sven Baumann Date: Tue, 27 Dec 2022 16:16:44 +0100 Subject: [PATCH 01/10] Adapt branch alias --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bdb4c38..84b593f 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.5.x-dev" + "dev-release/1.6.0": "1.6.0-dev" } } } From 6429a14f8956a8bcd7eb91b7ce557cc815ec3f3e Mon Sep 17 00:00:00 2001 From: Sven Baumann Date: Tue, 27 Dec 2022 16:50:16 +0100 Subject: [PATCH 02/10] Switch to phpcq 2 --- .composer-require-checker.json | 2 + .gitignore | 4 ++ .phpcq.yaml.dist | 106 +++++++++++++++++++++++++++++++++ .phpmd.xml | 37 ++++++++++++ build.default.properties | 11 ---- build.xml | 12 ---- composer.json | 4 +- exception-stubs.phpstub | 1 + psalm.xml | 15 +++++ 9 files changed, 167 insertions(+), 25 deletions(-) create mode 100644 .composer-require-checker.json create mode 100644 .phpcq.yaml.dist create mode 100644 .phpmd.xml delete mode 100644 build.default.properties delete mode 100644 build.xml create mode 100644 exception-stubs.phpstub create mode 100644 psalm.xml diff --git a/.composer-require-checker.json b/.composer-require-checker.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/.composer-require-checker.json @@ -0,0 +1,2 @@ +{ +} diff --git a/.gitignore b/.gitignore index d870bd0..7c49471 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,7 @@ /vendor/ /composer.phar /composer.lock + +# phpcq related +.phpcq.lock +.phpcq diff --git a/.phpcq.yaml.dist b/.phpcq.yaml.dist new file mode 100644 index 0000000..ed969b0 --- /dev/null +++ b/.phpcq.yaml.dist @@ -0,0 +1,106 @@ +phpcq: + repositories: + - https://phpcq.github.io/repository/repository.json + directories: + - src + - tests + artifact: .phpcq/build + + plugins: + phpunit: + version: ^1.0 + signed: false + psalm: + version: ^1.1 + signed: false + composer-require-checker: + version: ^1.0 + signed: false + requirements: + composer-require-checker: + signed: false + version: ^3.3 + phpmd: + version: ^1.0 + signed: false + requirements: + phpmd: + signed: false + phpcpd: + version: ^1.0 + signed: false + requirements: + phpcpd: + version: ^6.0 + phploc: + version: ^1.0 + signed: false + phpcs: + version: ^1.0 + signed: false + composer-normalize: + version: ^1.0 + signed: false + trusted-keys: + # sb@sebastian-bergmann.de + - 4AA394086372C20A + # psalm + - 8A03EA3B385DBAA1 + - 12CE0F1D262429A5 + # magl@magll.net + - D2CCAC42F6295E7D + # PHP_CodeSniffer + - 31C7E470E2138192 + # Composer normalize + - C00543248C87FB13 + # phpmd + - 0F9684B8B16B7AB0 + - A4E55EA12C7C085C + # composer-require-checker + - 033E5F8D801A2F8D + +tasks: + fix: + - composer-normalize-fix + - phpcbf + verify: + - composer-require-checker + - composer-normalize + analyze: + - phploc + - phpcpd + - phpmd + - phpcs + - psalm + - phpunit + default: + - verify + - analyze + + phpmd: + plugin: phpmd + config: + ruleset: + - ./.phpmd.xml + + composer-normalize-fix: + plugin: composer-normalize + config: + dry_run: false + + composer-require-checker: + plugin: composer-require-checker + config: + config_file: '.composer-require-checker.json' + + phpcs: + plugin: phpcs + config: &phpcs-config + standard: PSR12 + custom_flags: + - '--extensions=php' + + phpcbf: + plugin: phpcs + config: + <<: *phpcs-config diff --git a/.phpmd.xml b/.phpmd.xml new file mode 100644 index 0000000..a6ccc7b --- /dev/null +++ b/.phpmd.xml @@ -0,0 +1,37 @@ + + + + PHPMD rule set + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build.default.properties b/build.default.properties deleted file mode 100644 index 18c3a21..0000000 --- a/build.default.properties +++ /dev/null @@ -1,11 +0,0 @@ -##################################################### -## This project is using the ## -## PHP code quality project (phpcq) ## -## ## -## https://github.com/phpcq/phpcq ## -##################################################### - -phpcs.standard=${basedir}/vendor/phpcq/coding-standard/phpcs/PhpCodeQuality/ruleset.xml -phpmd.ruleset=${basedir}/vendor/phpcq/coding-standard/phpmd/ruleset.xml - -phpcpd.excluded=Command diff --git a/build.xml b/build.xml deleted file mode 100644 index daac69b..0000000 --- a/build.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/composer.json b/composer.json index 84b593f..ccb940a 100644 --- a/composer.json +++ b/composer.json @@ -9,8 +9,8 @@ }, "require-dev": { "symfony/filesystem": "^3.4 || ^4.0 || ^5.0", - "phpcq/all-tasks": "^1.1", - "phpunit/phpunit": "^5.0 || ^6.0 || ^7.0" + "symfony/filesystem": "^4.0 || ^5.0", + "phpcq/runner-bootstrap": "^1.0@dev" }, "autoload": { "psr-4": { diff --git a/exception-stubs.phpstub b/exception-stubs.phpstub new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/exception-stubs.phpstub @@ -0,0 +1 @@ + + + + + + + + + From e38f7f1e7fdaec8d49b70cee849b47979de1e661 Mon Sep 17 00:00:00 2001 From: Sven Baumann Date: Tue, 27 Dec 2022 16:51:33 +0100 Subject: [PATCH 03/10] Define the test namespace in the correctly autoload definition --- composer.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ccb940a..9ef80ac 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,11 @@ }, "autoload": { "psr-4": { - "Bit3\\GitPhp\\": "src", + "Bit3\\GitPhp\\": "src" + } + }, + "autoload-dev": { + "psr-4": { "Bit3\\GitPhp\\Test\\": "tests" } }, From e246b6a202e842b30dd2b1fe67a1c0ffea44c5c6 Mon Sep 17 00:00:00 2001 From: Sven Baumann Date: Tue, 27 Dec 2022 16:57:49 +0100 Subject: [PATCH 04/10] Normalize composer.json --- composer.json | 56 ++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/composer.json b/composer.json index 9ef80ac..ae3ae5d 100644 --- a/composer.json +++ b/composer.json @@ -1,30 +1,32 @@ { - "name": "bit3/git-php", - "description": "Easy to use GIT wrapper for PHP.", - "license": "MIT", - "require": { - "php": "^5.6 || ^7.0", - "psr/log": "^1.0", - "symfony/process": "^3.4 || ^4.0 || ^5.0" - }, - "require-dev": { - "symfony/filesystem": "^3.4 || ^4.0 || ^5.0", - "symfony/filesystem": "^4.0 || ^5.0", - "phpcq/runner-bootstrap": "^1.0@dev" - }, - "autoload": { - "psr-4": { - "Bit3\\GitPhp\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "Bit3\\GitPhp\\Test\\": "tests" - } - }, - "extra": { - "branch-alias": { - "dev-release/1.6.0": "1.6.0-dev" - } + "name": "bit3/git-php", + "description": "Easy to use GIT wrapper for PHP.", + "license": "MIT", + "require": { + "php": "^5.6 || ^7.0", + "psr/log": "^1.0", + "symfony/process": "^3.4 || ^4.0 || ^5.0" + }, + "require-dev": { + "symfony/filesystem": "^4.0 || ^5.0", + "phpcq/runner-bootstrap": "^1.0@dev" + }, + "autoload": { + "psr-4": { + "Bit3\\GitPhp\\": "src" } + }, + "autoload-dev": { + "psr-4": { + "Bit3\\GitPhp\\Test\\": "tests" + } + }, + "config": { + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-release/1.6.0": "1.6.0-dev" + } + } } From e14574b7de5e768ffbdfca6d8f9425a8a3c22d01 Mon Sep 17 00:00:00 2001 From: Sven Baumann Date: Tue, 27 Dec 2022 17:08:43 +0100 Subject: [PATCH 05/10] Makes phpunit tests compatible --- .gitignore | 1 + tests/GitRepositoryTest.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7c49471..f315d59 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ # phpcq related .phpcq.lock .phpcq +.phpunit.result.cache diff --git a/tests/GitRepositoryTest.php b/tests/GitRepositoryTest.php index ec1268f..b69aae9 100644 --- a/tests/GitRepositoryTest.php +++ b/tests/GitRepositoryTest.php @@ -30,6 +30,8 @@ /** * GIT repository unit tests. + * + * @covers \Bit3\GitPhp\GitRepository */ class GitRepositoryTest extends TestCase { @@ -53,7 +55,7 @@ class GitRepositoryTest extends TestCase */ protected $uninitializedGitRepository; - public function setUp() + public function setUp(): void { $this->initializedRepositoryPath = \tempnam(\sys_get_temp_dir(), 'git_'); \unlink($this->initializedRepositoryPath); @@ -71,7 +73,7 @@ public function setUp() $this->uninitializedGitRepository = new GitRepository($this->uninitializedRepositoryPath); } - public function tearDown() + public function tearDown(): void { $fs = new Filesystem(); $fs->remove($this->initializedRepositoryPath); From 9902d3fe38d4f671f6fd606cdc241da338fc0b8f Mon Sep 17 00:00:00 2001 From: Sven Baumann Date: Tue, 27 Dec 2022 18:00:19 +0100 Subject: [PATCH 06/10] Exclude some paths from the test tools --- .phpcq.yaml.dist | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.phpcq.yaml.dist b/.phpcq.yaml.dist index ed969b0..076b2d7 100644 --- a/.phpcq.yaml.dist +++ b/.phpcq.yaml.dist @@ -80,6 +80,7 @@ tasks: phpmd: plugin: phpmd config: + excluded: [ tests ] ruleset: - ./.phpmd.xml @@ -97,6 +98,7 @@ tasks: plugin: phpcs config: &phpcs-config standard: PSR12 + excluded: [ tests ] custom_flags: - '--extensions=php' @@ -104,3 +106,8 @@ tasks: plugin: phpcs config: <<: *phpcs-config + + phpcpd: + plugin: phpcpd + config: + exclude: [ src/Command ] From a8550e19c8b5b6fd6b4ef512d7d345acf3eda82e Mon Sep 17 00:00:00 2001 From: Sven Baumann Date: Tue, 27 Dec 2022 18:11:43 +0100 Subject: [PATCH 07/10] Fixed phpcs issues --- src/Command/BranchCommandBuilder.php | 8 ++++---- src/Command/CommitCommandBuilder.php | 14 +++++++------- src/Command/FetchCommandBuilder.php | 8 ++++---- src/Command/InitCommandBuilder.php | 16 ++++++++-------- src/Command/LogCommandBuilder.php | 26 +++++++++++++------------- src/Command/PushCommandBuilder.php | 6 +++--- src/Command/RevParseCommandBuilder.php | 6 +++--- src/Command/StashCommandBuilder.php | 4 ++-- src/Command/StatusCommandBuilder.php | 16 ++++++++-------- src/Command/TagCommandBuilder.php | 8 ++++---- 10 files changed, 56 insertions(+), 56 deletions(-) diff --git a/src/Command/BranchCommandBuilder.php b/src/Command/BranchCommandBuilder.php index 8f1349a..4e5ba4e 100644 --- a/src/Command/BranchCommandBuilder.php +++ b/src/Command/BranchCommandBuilder.php @@ -14,7 +14,7 @@ * @author Tristan Lins * @author Christian Schiffler * @author Sven Baumann - * @copyright 2014-2018 Tristan Lins + * @copyright 2014-2022 Tristan Lins * @license https://github.com/bit3/git-php/blob/master/LICENSE MIT * @link https://github.com/bit3/git-php * @filesource @@ -31,11 +31,11 @@ class BranchCommandBuilder implements CommandBuilderInterface { use CommandBuilderTrait; - const WHEN_ALWAYS = 'always'; + public const WHEN_ALWAYS = 'always'; - const WHEN_NEVER = 'never'; + public const WHEN_NEVER = 'never'; - const WHEN_AUTO = 'auto'; + public const WHEN_AUTO = 'auto'; /** * {@inheritDoc} diff --git a/src/Command/CommitCommandBuilder.php b/src/Command/CommitCommandBuilder.php index 08d20c2..5c7df1a 100644 --- a/src/Command/CommitCommandBuilder.php +++ b/src/Command/CommitCommandBuilder.php @@ -31,19 +31,19 @@ class CommitCommandBuilder implements CommandBuilderInterface { use CommandBuilderTrait; - const CLEANUP_STRIP = 'strip'; + public const CLEANUP_STRIP = 'strip'; - const CLEANUP_WHITESPACE = 'whitespace'; + public const CLEANUP_WHITESPACE = 'whitespace'; - const CLEANUP_VERBATIM = 'verbatim'; + public const CLEANUP_VERBATIM = 'verbatim'; - const CLEANUP_DEFAULT = 'default'; + public const CLEANUP_DEFAULT = 'default'; - const UNTRACKED_FILES_NO = 'no'; + public const UNTRACKED_FILES_NO = 'no'; - const UNTRACKED_FILES_NORMAL = 'normal'; + public const UNTRACKED_FILES_NORMAL = 'normal'; - const UNTRACKED_FILES_ALL = 'all'; + public const UNTRACKED_FILES_ALL = 'all'; /** * Flag determining if gpg signing is desired. diff --git a/src/Command/FetchCommandBuilder.php b/src/Command/FetchCommandBuilder.php index c288047..2dc6812 100644 --- a/src/Command/FetchCommandBuilder.php +++ b/src/Command/FetchCommandBuilder.php @@ -14,7 +14,7 @@ * @author Tristan Lins * @author Christian Schiffler * @author Sven Baumann - * @copyright 2014-2018 Tristan Lins + * @copyright 2014-2022 Tristan Lins * @license https://github.com/bit3/git-php/blob/master/LICENSE MIT * @link https://github.com/bit3/git-php * @filesource @@ -31,11 +31,11 @@ class FetchCommandBuilder implements CommandBuilderInterface { use CommandBuilderTrait; - const RECURSE_SUBMODULES_YES = 'yes'; + public const RECURSE_SUBMODULES_YES = 'yes'; - const RECURSE_SUBMODULES_ON_DEMAND = 'on-demand'; + public const RECURSE_SUBMODULES_ON_DEMAND = 'on-demand'; - const RECURSE_SUBMODULES_NO = 'no'; + public const RECURSE_SUBMODULES_NO = 'no'; /** * {@inheritDoc} diff --git a/src/Command/InitCommandBuilder.php b/src/Command/InitCommandBuilder.php index 6864b23..55b3b50 100644 --- a/src/Command/InitCommandBuilder.php +++ b/src/Command/InitCommandBuilder.php @@ -14,7 +14,7 @@ * @author Tristan Lins * @author Christian Schiffler * @author Sven Baumann - * @copyright 2014-2018 Tristan Lins + * @copyright 2014-2022 Tristan Lins * @license https://github.com/bit3/git-php/blob/master/LICENSE MIT * @link https://github.com/bit3/git-php * @filesource @@ -29,19 +29,19 @@ class InitCommandBuilder implements CommandBuilderInterface { use CommandBuilderTrait; - const SHARE_FALSE = 'false'; + public const SHARE_FALSE = 'false'; - const SHARE_TRUE = 'true'; + public const SHARE_TRUE = 'true'; - const SHARE_UMASK = 'umask'; + public const SHARE_UMASK = 'umask'; - const SHARE_GROUP = 'group'; + public const SHARE_GROUP = 'group'; - const SHARE_ALL = 'all'; + public const SHARE_ALL = 'all'; - const SHARE_WORLD = 'world'; + public const SHARE_WORLD = 'world'; - const SHARE_EVERYBODY = 'everybody'; + public const SHARE_EVERYBODY = 'everybody'; /** * {@inheritDoc} diff --git a/src/Command/LogCommandBuilder.php b/src/Command/LogCommandBuilder.php index 55dd086..4fa71e9 100644 --- a/src/Command/LogCommandBuilder.php +++ b/src/Command/LogCommandBuilder.php @@ -14,7 +14,7 @@ * @author Tristan Lins * @author Christian Schiffler * @author Sven Baumann - * @copyright 2014-2018 Tristan Lins + * @copyright 2014-2022 Tristan Lins * @license https://github.com/bit3/git-php/blob/master/LICENSE MIT * @link https://github.com/bit3/git-php * @filesource @@ -34,29 +34,29 @@ class LogCommandBuilder implements CommandBuilderInterface { use CommandBuilderTrait; - const DECORATE_SHORT = 'short'; + public const DECORATE_SHORT = 'short'; - const DECORATE_FULL = 'full'; + public const DECORATE_FULL = 'full'; - const DECORATE_NO = 'no'; + public const DECORATE_NO = 'no'; - const WALK_SORTED = 'sorted'; + public const WALK_SORTED = 'sorted'; - const WALK_UNSORTED = 'unsorted'; + public const WALK_UNSORTED = 'unsorted'; - const DATE_RELATIVE = 'relative'; + public const DATE_RELATIVE = 'relative'; - const DATE_LOCAL = 'local'; + public const DATE_LOCAL = 'local'; - const DATE_DEFAULT = 'default'; + public const DATE_DEFAULT = 'default'; - const DATE_ISO = 'iso'; + public const DATE_ISO = 'iso'; - const DATE_RFC = 'rfc'; + public const DATE_RFC = 'rfc'; - const DATE_SHORT = 'short'; + public const DATE_SHORT = 'short'; - const DATE_RAW = 'raw'; + public const DATE_RAW = 'raw'; /** * {@inheritDoc} diff --git a/src/Command/PushCommandBuilder.php b/src/Command/PushCommandBuilder.php index 84e53f9..1b42340 100644 --- a/src/Command/PushCommandBuilder.php +++ b/src/Command/PushCommandBuilder.php @@ -14,7 +14,7 @@ * @author Tristan Lins * @author Christian Schiffler * @author Sven Baumann - * @copyright 2014-2018 Tristan Lins + * @copyright 2014-2022 Tristan Lins * @license https://github.com/bit3/git-php/blob/master/LICENSE MIT * @link https://github.com/bit3/git-php * @filesource @@ -31,9 +31,9 @@ class PushCommandBuilder implements CommandBuilderInterface { use CommandBuilderTrait; - const RECURSE_SUBMODULES_CHECK = 'check'; + public const RECURSE_SUBMODULES_CHECK = 'check'; - const RECURSE_SUBMODULES_ON_DEMAND = 'on-demand'; + public const RECURSE_SUBMODULES_ON_DEMAND = 'on-demand'; /** * {@inheritDoc} diff --git a/src/Command/RevParseCommandBuilder.php b/src/Command/RevParseCommandBuilder.php index ac47b7a..7409fb3 100644 --- a/src/Command/RevParseCommandBuilder.php +++ b/src/Command/RevParseCommandBuilder.php @@ -15,7 +15,7 @@ * @author Christian Schiffler * @author Radek Crlik * @author Sven Baumann - * @copyright 2014-2018 Tristan Lins + * @copyright 2014-2022 Tristan Lins * @license https://github.com/bit3/git-php/blob/master/LICENSE MIT * @link https://github.com/bit3/git-php * @filesource @@ -32,9 +32,9 @@ class RevParseCommandBuilder implements CommandBuilderInterface { use CommandBuilderTrait; - const ABBREV_REF_STRICT = 'strict'; + public const ABBREV_REF_STRICT = 'strict'; - const ABBREV_REF_LOOSE = 'loose'; + public const ABBREV_REF_LOOSE = 'loose'; /** * {@inheritDoc} diff --git a/src/Command/StashCommandBuilder.php b/src/Command/StashCommandBuilder.php index 480a832..19240de 100644 --- a/src/Command/StashCommandBuilder.php +++ b/src/Command/StashCommandBuilder.php @@ -13,7 +13,7 @@ * @package bit3/git-php * @author Ahmad Marzouq * @author Sven Baumann - * @copyright 2014-2018 Tristan Lins + * @copyright 2014-2022 Tristan Lins * @license https://github.com/bit3/git-php/blob/master/LICENSE MIT * @link https://github.com/bit3/git-php * @filesource @@ -224,7 +224,7 @@ public function store($message = null, $commit = null) { $this->arguments[] = 'store'; if ($message) { - $this->arguments[] = '--message '.$message; + $this->arguments[] = '--message ' . $message; } if ($commit) { $this->arguments[] = $commit; diff --git a/src/Command/StatusCommandBuilder.php b/src/Command/StatusCommandBuilder.php index 1f348c0..375e09f 100644 --- a/src/Command/StatusCommandBuilder.php +++ b/src/Command/StatusCommandBuilder.php @@ -14,7 +14,7 @@ * @author Tristan Lins * @author Christian Schiffler * @author Sven Baumann - * @copyright 2014-2018 Tristan Lins + * @copyright 2014-2022 Tristan Lins * @license https://github.com/bit3/git-php/blob/master/LICENSE MIT * @link https://github.com/bit3/git-php * @filesource @@ -31,19 +31,19 @@ class StatusCommandBuilder implements CommandBuilderInterface { use CommandBuilderTrait; - const UNTRACKED_FILES_NO = 'no'; + public const UNTRACKED_FILES_NO = 'no'; - const UNTRACKED_FILES_NORMAL = 'normal'; + public const UNTRACKED_FILES_NORMAL = 'normal'; - const UNTRACKED_FILES_ALL = 'all'; + public const UNTRACKED_FILES_ALL = 'all'; - const IGNORE_SUBMODULES_NONE = 'none'; + public const IGNORE_SUBMODULES_NONE = 'none'; - const IGNORE_SUBMODULES_UNTRACKED = 'untracked'; + public const IGNORE_SUBMODULES_UNTRACKED = 'untracked'; - const IGNORE_SUBMODULES_DIRTY = 'dirty'; + public const IGNORE_SUBMODULES_DIRTY = 'dirty'; - const IGNORE_SUBMODULES_ALL = 'all'; + public const IGNORE_SUBMODULES_ALL = 'all'; /** * {@inheritDoc} diff --git a/src/Command/TagCommandBuilder.php b/src/Command/TagCommandBuilder.php index c089b99..36d3987 100644 --- a/src/Command/TagCommandBuilder.php +++ b/src/Command/TagCommandBuilder.php @@ -14,7 +14,7 @@ * @author Tristan Lins * @author Christian Schiffler * @author Sven Baumann - * @copyright 2014-2018 Tristan Lins + * @copyright 2014-2022 Tristan Lins * @license https://github.com/bit3/git-php/blob/master/LICENSE MIT * @link https://github.com/bit3/git-php * @filesource @@ -31,11 +31,11 @@ class TagCommandBuilder implements CommandBuilderInterface { use CommandBuilderTrait; - const CLEANUP_VERBATIM = 'verbatim'; + public const CLEANUP_VERBATIM = 'verbatim'; - const CLEANUP_WHITESPACE = 'whitespace'; + public const CLEANUP_WHITESPACE = 'whitespace'; - const CLEANUP_STRIP = 'strip'; + public const CLEANUP_STRIP = 'strip'; /** * Flag if signing shall be done. From 7b873ab9f7b39a7a0db250c2817d0055394829eb Mon Sep 17 00:00:00 2001 From: Sven Baumann Date: Tue, 27 Dec 2022 18:14:19 +0100 Subject: [PATCH 08/10] Fixed phpmd issues --- src/Command/CommitCommandBuilder.php | 1 + src/Command/LogCommandBuilder.php | 1 + src/Command/RevParseCommandBuilder.php | 1 + src/GitRepository.php | 3 ++- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Command/CommitCommandBuilder.php b/src/Command/CommitCommandBuilder.php index 5c7df1a..2208ebb 100644 --- a/src/Command/CommitCommandBuilder.php +++ b/src/Command/CommitCommandBuilder.php @@ -26,6 +26,7 @@ * Commit command builder. * * @SuppressWarnings(PHPMD.TooManyPublicMethods) + * @SuppressWarnings(PHPMD.TooManyMethods) */ class CommitCommandBuilder implements CommandBuilderInterface { diff --git a/src/Command/LogCommandBuilder.php b/src/Command/LogCommandBuilder.php index 4fa71e9..4224d4a 100644 --- a/src/Command/LogCommandBuilder.php +++ b/src/Command/LogCommandBuilder.php @@ -29,6 +29,7 @@ * @SuppressWarnings(PHPMD.ExcessivePublicCount) * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) * @SuppressWarnings(PHPMD.TooManyPublicMethods) + * @SuppressWarnings(PHPMD.TooManyMethods) */ class LogCommandBuilder implements CommandBuilderInterface { diff --git a/src/Command/RevParseCommandBuilder.php b/src/Command/RevParseCommandBuilder.php index 7409fb3..ab13c82 100644 --- a/src/Command/RevParseCommandBuilder.php +++ b/src/Command/RevParseCommandBuilder.php @@ -27,6 +27,7 @@ * Rev-parse command builder. * * @SuppressWarnings(PHPMD.TooManyPublicMethods) + * @SuppressWarnings(PHPMD.TooManyMethods) */ class RevParseCommandBuilder implements CommandBuilderInterface { diff --git a/src/GitRepository.php b/src/GitRepository.php index 20804cc..0e991f4 100644 --- a/src/GitRepository.php +++ b/src/GitRepository.php @@ -18,7 +18,7 @@ * @author Matthew Gamble * @author Ahmad Marzouq * @author Sven Baumann - * @copyright 2014-2018 Tristan Lins + * @copyright 2014-2022 Tristan Lins * @license https://github.com/bit3/git-php/blob/master/LICENSE MIT * @link https://github.com/bit3/git-php * @filesource @@ -54,6 +54,7 @@ * GIT repository adapter. * * @SuppressWarnings(PHPMD.TooManyPublicMethods) + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class GitRepository { From a5fc5a7818f12943d95e8abe47c6c78e45c49114 Mon Sep 17 00:00:00 2001 From: Sven Baumann Date: Tue, 27 Dec 2022 18:19:57 +0100 Subject: [PATCH 09/10] Update requirements --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index ae3ae5d..489d16c 100644 --- a/composer.json +++ b/composer.json @@ -3,13 +3,13 @@ "description": "Easy to use GIT wrapper for PHP.", "license": "MIT", "require": { - "php": "^5.6 || ^7.0", - "psr/log": "^1.0", - "symfony/process": "^3.4 || ^4.0 || ^5.0" + "php": "^7.4 || ^8.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "symfony/process": "^4.0 || ^5.0 || ^6.0" }, "require-dev": { - "symfony/filesystem": "^4.0 || ^5.0", - "phpcq/runner-bootstrap": "^1.0@dev" + "phpcq/runner-bootstrap": "^1.0@dev", + "symfony/filesystem": "^4.0 || ^5.0 || ^6.0" }, "autoload": { "psr-4": { From a19e7ba4c1ea388ef064cb8d97455c4940fa801d Mon Sep 17 00:00:00 2001 From: Sven Baumann Date: Tue, 27 Dec 2022 18:55:21 +0100 Subject: [PATCH 10/10] Update github action --- .github/workflows/diagnostics.yml | 98 ++++++++++++++++++++++++++----- 1 file changed, 82 insertions(+), 16 deletions(-) diff --git a/.github/workflows/diagnostics.yml b/.github/workflows/diagnostics.yml index 9952d42..4d8c649 100644 --- a/.github/workflows/diagnostics.yml +++ b/.github/workflows/diagnostics.yml @@ -7,42 +7,108 @@ on: jobs: build: runs-on: ubuntu-latest + name: 'PHP: ${{ matrix.php }} Symfony: ${{ matrix.symfony}} Experimental: ${{ matrix.experimental}}' + continue-on-error: ${{ matrix.experimental }} strategy: + fail-fast: true matrix: - php: [5.6, 7.1, 7.2, 7.3, 7.4] + include: + - php: '7.4' + symfony: '^4.0' + phpcq_install: 'install' + output: '-o github-action -o default' + experimental: false + - php: '7.4' + symfony: '^5.0' + phpcq_install: 'update' + output: '-o github-action -o default' + experimental: false + - php: '8.0' + symfony: '^4.0' + phpcq_install: 'update' + output: '-o github-action -o default' + experimental: false + - php: '8.0' + symfony: '^5.0' + phpcq_install: 'update' + output: '-o github-action -o default' + experimental: false + - php: '8.1' + symfony: '^5.0' + phpcq_install: 'update' + output: '-o github-action -o default' + experimental: false + - php: '8.1' + symfony: '^6.0' + phpcq_install: 'update' + output: '-o github-action -o default' + experimental: false + - php: '8.2' + symfony: '^6.0' + phpcq_install: 'update' + output: '-o github-action -o default' + experimental: false + - php: '8.3' + symfony: '^6.0' + phpcq_install: 'update' + output: '-o github-action -o default' + experimental: true steps: - - name: PHP ${{ matrix.php }} Pull source + - name: Pull source uses: actions/checkout@v2 - with: - fetch-depth: 0 # see https://github.com/shivammathur/setup-php - - name: PHP ${{ matrix.php }} Setup PHP. + - name: Setup PHP with PECL extension uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - coverage: none - - name: PHP ${{ matrix.php }} Cache composer cache directory + # setup caches + - name: Cache composer cache directory uses: actions/cache@v1 env: cache-name: composer-cache-dir with: path: ~/.cache/composer - key: ${{ runner.os }}-build-${{ env.cache-name }} + key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }} - - name: PHP ${{ matrix.php }} Cache vendor directory + - name: Cache vendor directory uses: actions/cache@v1 env: - cache-name: composer-vendor + cache-name: vendor with: path: vendor - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }} + key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.symfony }}-build-${{ env.cache-name }}-${{ hashFiles('**/composer.lock') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - - name: PHP ${{ matrix.php }} Install composer dependencies - run: composer update --prefer-dist --no-interaction --no-suggest + ${{ runner.os }}-${{ matrix.php }}-${{ matrix.symfony }}-build-${{ env.cache-name }}- - - name: PHP ${{ matrix.php }} Run tests - run: ant -keep-going + - name: Cache phpcq directory + uses: actions/cache@v1 + env: + cache-name: phpcq + with: + path: .phpcq + key: ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}-${{ hashFiles('**/.phpcq.lock') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.php }}-build-${{ env.cache-name }}- + + # install dependencies and tools + - name: Install composer dependencies + run: | + composer require symfony/process ${{ matrix.symfony }} --no-update + composer require symfony/filesystem ${{ matrix.symfony }} --no-update + composer install + - name: Install phpcq toolchain + run: ./vendor/bin/phpcq ${{ matrix.phpcq_install }} -v + + # run tests + - name: Run tests + run: ./vendor/bin/phpcq run -v ${{ matrix.output }} + + - name: Upload build directory to artifact + uses: actions/upload-artifact@v2 + if: ${{ success() }} || ${{ failure() }} + with: + name: phpcq-builds-php-${{ matrix.php }}-${{ matrix.symfony }} + path: .phpcq/build/