diff --git a/.gitattributes b/.gitattributes index 9e7b1a00..bd650c54 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,3 +9,4 @@ stubs export-ignore tests export-ignore rules-tests export-ignore rector.php export-ignore +structarmed.php export-ignore diff --git a/.github/workflows/code_analysis.yaml b/.github/workflows/code_analysis.yaml index 6f6f9f0d..b5d58010 100644 --- a/.github/workflows/code_analysis.yaml +++ b/.github/workflows/code_analysis.yaml @@ -36,6 +36,10 @@ jobs: name: 'Tests' run: vendor/bin/phpunit + - + name: 'Run StructArmed' + run: vendor/bin/structarmed analyze + name: ${{ matrix.actions.name }} runs-on: ubuntu-latest timeout-minutes: 10 diff --git a/composer.json b/composer.json index d19863c9..dfbd41a1 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,7 @@ "php": ">=8.3" }, "require-dev": { + "boundwize/structarmed": "^0.7.7", "phpstan/extension-installer": "^1.4", "phpstan/phpstan": "^2.1.38", "phpstan/phpstan-deprecation-rules": "^2.0", diff --git a/rules-tests/CodeQuality/Rector/ClassMethod/ReplaceTestFunctionPrefixWithAttributeRector/ReplaceTestFunctionPrefixWithAttributeRectorTest.php b/rules-tests/CodeQuality/Rector/ClassMethod/ReplaceTestFunctionPrefixWithAttributeRector/ReplaceTestFunctionPrefixWithAttributeRectorTest.php index f3030c08..487abf75 100644 --- a/rules-tests/CodeQuality/Rector/ClassMethod/ReplaceTestFunctionPrefixWithAttributeRector/ReplaceTestFunctionPrefixWithAttributeRectorTest.php +++ b/rules-tests/CodeQuality/Rector/ClassMethod/ReplaceTestFunctionPrefixWithAttributeRector/ReplaceTestFunctionPrefixWithAttributeRectorTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace CodeQuality\Rector\ClassMethod\ReplaceTestFunctionPrefixWithAttributeRector; +namespace Rector\PHPUnit\Tests\CodeQuality\Rector\ClassMethod\ReplaceTestFunctionPrefixWithAttributeRector; use Iterator; use PHPUnit\Framework\Attributes\DataProvider; diff --git a/rules-tests/CodeQuality/Rector/MethodCall/AssertEmptyNullableObjectToAssertInstanceofRector/Fixture/assert_make_empty.php.inc b/rules-tests/CodeQuality/Rector/MethodCall/AssertEmptyNullableObjectToAssertInstanceofRector/Fixture/assert_make_empty.php.inc index c0649330..06b0ca19 100644 --- a/rules-tests/CodeQuality/Rector/MethodCall/AssertEmptyNullableObjectToAssertInstanceofRector/Fixture/assert_make_empty.php.inc +++ b/rules-tests/CodeQuality/Rector/MethodCall/AssertEmptyNullableObjectToAssertInstanceofRector/Fixture/assert_make_empty.php.inc @@ -2,7 +2,7 @@ namespace Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\AssertEmptyNullableObjectToAssertInstanceofRector\Fixture; -use CodeQuality\Rector\MethodCall\AssertEmptyNullableObjectToAssertInstanceofRector\Source\SomeTypeObject; +use Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\AssertEmptyNullableObjectToAssertInstanceofRector\Source\SomeTypeObject; use PHPUnit\Framework\TestCase; final class AssertMakeEmpty extends TestCase @@ -25,7 +25,7 @@ final class AssertMakeEmpty extends TestCase namespace Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\AssertEmptyNullableObjectToAssertInstanceofRector\Fixture; -use CodeQuality\Rector\MethodCall\AssertEmptyNullableObjectToAssertInstanceofRector\Source\SomeTypeObject; +use Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\AssertEmptyNullableObjectToAssertInstanceofRector\Source\SomeTypeObject; use PHPUnit\Framework\TestCase; final class AssertMakeEmpty extends TestCase @@ -38,7 +38,7 @@ final class AssertMakeEmpty extends TestCase $someObject = new SomeTypeObject(); } - $this->assertNotInstanceOf(\CodeQuality\Rector\MethodCall\AssertEmptyNullableObjectToAssertInstanceofRector\Source\SomeTypeObject::class, $someObject); + $this->assertNotInstanceOf(\Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\AssertEmptyNullableObjectToAssertInstanceofRector\Source\SomeTypeObject::class, $someObject); } } diff --git a/rules-tests/CodeQuality/Rector/MethodCall/AssertEmptyNullableObjectToAssertInstanceofRector/Source/SomeTypeObject.php b/rules-tests/CodeQuality/Rector/MethodCall/AssertEmptyNullableObjectToAssertInstanceofRector/Source/SomeTypeObject.php index 19dcb9e0..5305ec62 100644 --- a/rules-tests/CodeQuality/Rector/MethodCall/AssertEmptyNullableObjectToAssertInstanceofRector/Source/SomeTypeObject.php +++ b/rules-tests/CodeQuality/Rector/MethodCall/AssertEmptyNullableObjectToAssertInstanceofRector/Source/SomeTypeObject.php @@ -1,6 +1,6 @@ withPreset(Preset::PSR4()); diff --git a/tests/Issues/AnnotationParsing/AnnotationParsingTest.php b/tests/Issues/AnnotationParsing/AnnotationParsingTest.php index b915b2ad..dc247249 100644 --- a/tests/Issues/AnnotationParsing/AnnotationParsingTest.php +++ b/tests/Issues/AnnotationParsing/AnnotationParsingTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Rector\PHPUnit\Tests\Issues\WrongAnnotation; +namespace Rector\PHPUnit\Tests\Issues\AnnotationParsing; use Iterator; use PHPUnit\Framework\Attributes\DataProvider;