diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a28041ec..1048ef9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,3 +96,6 @@ jobs: - name: Run PHP CodeSniffer run: vendor/bin/phpcs --report=checkstyle | cs2pr + + - name: Run StructArmed + run: vendor/bin/structarmed analyze diff --git a/Makefile b/Makefile index 16c57f0a..372ae5ec 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,8 @@ DEV_DEPENDENCIES = cakephp/cakephp:5.x-dev \ cakephp/cakephp-codesniffer:^5.0 \ mikey179/vfsstream:^1.6.8 \ phpunit/phpunit:^10.5.38 \ - cakephp/migrations:^4.5.0 + cakephp/migrations:^4.5.0 \ + boundwize/structarmed:^0.7.7 install-dev: composer require --dev $(DEV_DEPENDENCIES) diff --git a/composer.json b/composer.json index 609d7398..b6c74c6c 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,10 @@ "autoload-dev": { "psr-4": { "Cake\\Upgrade\\Test\\TestCase\\": "tests/TestCase/" - } + }, + "classmap": [ + "stubs" + ] }, "prefer-stable": true, "minimum-stability": "dev", diff --git a/structarmed.php b/structarmed.php new file mode 100644 index 00000000..2cd501fd --- /dev/null +++ b/structarmed.php @@ -0,0 +1,9 @@ +withPreset(Preset::PSR4()); diff --git a/tests/TestCase/Rector/Namespace_/AppUsesStaticCallToUseStatementRector/Source/App.php b/stubs/App.php similarity index 100% rename from tests/TestCase/Rector/Namespace_/AppUsesStaticCallToUseStatementRector/Source/App.php rename to stubs/App.php diff --git a/tests/TestCase/Rector/Namespace_/AppUsesStaticCallToUseStatementRector/Source/Xml.php b/stubs/Cake/Utility/Xml.php similarity index 100% rename from tests/TestCase/Rector/Namespace_/AppUsesStaticCallToUseStatementRector/Source/Xml.php rename to stubs/Cake/Utility/Xml.php diff --git a/tests/TestCase/Rector/MethodCall/RemoveMethodCallArgsRector/Fixture/fixture.php.inc b/tests/TestCase/Rector/MethodCall/RemoveMethodCallArgsRector/Fixture/fixture.php.inc index 4dbbc418..25d4969d 100644 --- a/tests/TestCase/Rector/MethodCall/RemoveMethodCallArgsRector/Fixture/fixture.php.inc +++ b/tests/TestCase/Rector/MethodCall/RemoveMethodCallArgsRector/Fixture/fixture.php.inc @@ -1,8 +1,8 @@