From 8e51cb3b8053c8dc525c5e8fa18450a71b755754 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 27 Nov 2025 20:11:08 +0700 Subject: [PATCH 1/3] [ci] Add typos workflow --- .github/typos.toml | 2 ++ .github/workflows/typos.yaml | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .github/typos.toml create mode 100644 .github/workflows/typos.yaml diff --git a/.github/typos.toml b/.github/typos.toml new file mode 100644 index 00000000..5ad1e587 --- /dev/null +++ b/.github/typos.toml @@ -0,0 +1,2 @@ +[default.extend-words] +Symplify = "Symplify" diff --git a/.github/workflows/typos.yaml b/.github/workflows/typos.yaml new file mode 100644 index 00000000..f06e4f15 --- /dev/null +++ b/.github/workflows/typos.yaml @@ -0,0 +1,24 @@ +# see https://github.com/crate-ci/typos +name: "Typos" + +on: + pull_request: + push: + branches: + - "main" + +jobs: + typos: + name: "Check for typos" + runs-on: "ubuntu-latest" + + steps: + - uses: actions/checkout@v4 + + + + - name: "Check for typos" + uses: "crate-ci/typos@v1.40.0" + with: + config: .github/typos.toml + files: "README.md src config rules tests rules-tests" From 89a91c8fda86caf9d37e5020c9bf6e690adc317f Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 27 Nov 2025 20:16:19 +0700 Subject: [PATCH 2/3] fix typo --- ...stirng_variable.php.inc => in_string_variable.php.inc} | 4 ++-- .../Fixture/iterable.php.inc | 8 ++++---- .../Fixture/skip_zero_offset_with_positive_length.php.inc | 2 +- .../OverrideFromAnonymousClassMethodAnalyzer.php | 2 +- .../ClassMethod/DowngradeParameterTypeWideningRector.php | 2 +- .../NodeFactory/ArrayMergeFromArraySpreadFactory.php | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) rename rules-tests/DowngradePhp73/Rector/FuncCall/DowngradeTrailingCommasInFunctionCallsRector/Fixture/{in_stirng_variable.php.inc => in_string_variable.php.inc} (91%) diff --git a/rules-tests/DowngradePhp73/Rector/FuncCall/DowngradeTrailingCommasInFunctionCallsRector/Fixture/in_stirng_variable.php.inc b/rules-tests/DowngradePhp73/Rector/FuncCall/DowngradeTrailingCommasInFunctionCallsRector/Fixture/in_string_variable.php.inc similarity index 91% rename from rules-tests/DowngradePhp73/Rector/FuncCall/DowngradeTrailingCommasInFunctionCallsRector/Fixture/in_stirng_variable.php.inc rename to rules-tests/DowngradePhp73/Rector/FuncCall/DowngradeTrailingCommasInFunctionCallsRector/Fixture/in_string_variable.php.inc index 7dc01645..ec7cae22 100644 --- a/rules-tests/DowngradePhp73/Rector/FuncCall/DowngradeTrailingCommasInFunctionCallsRector/Fixture/in_stirng_variable.php.inc +++ b/rules-tests/DowngradePhp73/Rector/FuncCall/DowngradeTrailingCommasInFunctionCallsRector/Fixture/in_string_variable.php.inc @@ -2,7 +2,7 @@ namespace Rector\Tests\DowngradePhp73\Rector\FuncCall\DowngradeTrailingCommasInFunctionCallsRector\Fixture; -class InStirngVariable +class InStringVariable { public function run() { @@ -16,7 +16,7 @@ class InStirngVariable namespace Rector\Tests\DowngradePhp73\Rector\FuncCall\DowngradeTrailingCommasInFunctionCallsRector\Fixture; -class InStirngVariable +class InStringVariable { public function run() { diff --git a/rules-tests/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector/Fixture/iterable.php.inc b/rules-tests/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector/Fixture/iterable.php.inc index 635cdfe9..768d7789 100644 --- a/rules-tests/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector/Fixture/iterable.php.inc +++ b/rules-tests/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector/Fixture/iterable.php.inc @@ -2,13 +2,13 @@ namespace Rector\Tests\DowngradePhp74\Rector\ClassMethod\DowngradeCovariantReturnTypeRector\Fixture; -class InterableA +class IterableA { public function covariantReturnTypes(): iterable { /* … */ } } -class InterableB extends InterableA +class IterableB extends IterableA { public function covariantReturnTypes(): array { /* … */ } @@ -20,13 +20,13 @@ class InterableB extends InterableA namespace Rector\Tests\DowngradePhp74\Rector\ClassMethod\DowngradeCovariantReturnTypeRector\Fixture; -class InterableA +class IterableA { public function covariantReturnTypes(): iterable { /* … */ } } -class InterableB extends InterableA +class IterableB extends IterableA { /** * @return mixed[] diff --git a/rules-tests/DowngradePhp80/Rector/FuncCall/DowngradeSubstrFalsyRector/Fixture/skip_zero_offset_with_positive_length.php.inc b/rules-tests/DowngradePhp80/Rector/FuncCall/DowngradeSubstrFalsyRector/Fixture/skip_zero_offset_with_positive_length.php.inc index cfead068..e4aca0d7 100644 --- a/rules-tests/DowngradePhp80/Rector/FuncCall/DowngradeSubstrFalsyRector/Fixture/skip_zero_offset_with_positive_length.php.inc +++ b/rules-tests/DowngradePhp80/Rector/FuncCall/DowngradeSubstrFalsyRector/Fixture/skip_zero_offset_with_positive_length.php.inc @@ -3,7 +3,7 @@ namespace Rector\Tests\DowngradePhp80\Rector\FuncCall\DowngradeSubstrFalsyRector\Fixture; /** - * zero offset with postive length can't be false + * zero offset with positive length can't be false */ class SkipZeroOffsetWithPositiveLength { diff --git a/rules/DowngradePhp72/NodeAnalyzer/OverrideFromAnonymousClassMethodAnalyzer.php b/rules/DowngradePhp72/NodeAnalyzer/OverrideFromAnonymousClassMethodAnalyzer.php index 85586da2..bd69cfac 100644 --- a/rules/DowngradePhp72/NodeAnalyzer/OverrideFromAnonymousClassMethodAnalyzer.php +++ b/rules/DowngradePhp72/NodeAnalyzer/OverrideFromAnonymousClassMethodAnalyzer.php @@ -25,7 +25,7 @@ public function __construct( ) { } - public function matchAncestorClassReflectionOverrideable( + public function matchAncestorClassReflectionOverridable( ClassLike $classLike, ClassMethod $classMethod ): ?ClassReflection { diff --git a/rules/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector.php b/rules/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector.php index 6aa01b34..53027791 100644 --- a/rules/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector.php +++ b/rules/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector.php @@ -101,7 +101,7 @@ public function refactor(Node $node): ?Node $hasChanged = false; foreach ($node->getMethods() as $method) { - $ancestorOverridableAnonymousClass = $this->overrideFromAnonymousClassMethodAnalyzer->matchAncestorClassReflectionOverrideable( + $ancestorOverridableAnonymousClass = $this->overrideFromAnonymousClassMethodAnalyzer->matchAncestorClassReflectionOverridable( $node, $method ); diff --git a/rules/DowngradePhp81/NodeFactory/ArrayMergeFromArraySpreadFactory.php b/rules/DowngradePhp81/NodeFactory/ArrayMergeFromArraySpreadFactory.php index ce10386a..f2166018 100644 --- a/rules/DowngradePhp81/NodeFactory/ArrayMergeFromArraySpreadFactory.php +++ b/rules/DowngradePhp81/NodeFactory/ArrayMergeFromArraySpreadFactory.php @@ -28,7 +28,7 @@ public function __construct( public function createFromArray(Array_ $array, MutatingScope $mutatingScope): FuncCall { - $newArrayItems = $this->disolveArrayItems($array); + $newArrayItems = $this->dissolveArrayItems($array); return $this->createArrayMergeFuncCall($newArrayItems, $mutatingScope); } @@ -40,7 +40,7 @@ public function createFromArray(Array_ $array, MutatingScope $mutatingScope): Fu * to be added once the next spread is found, or at the end * @return ArrayItem[] */ - private function disolveArrayItems(Array_ $array): array + private function dissolveArrayItems(Array_ $array): array { $newItems = []; From 2b736bf6beb3b3ea12fe6206737dc2c5e081e91a Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 27 Nov 2025 20:17:42 +0700 Subject: [PATCH 3/3] fix typo --- .github/typos.toml | 2 ++ .../Fixture/{class_contant.php.inc => class_constant.php.inc} | 0 2 files changed, 2 insertions(+) rename rules-tests/DowngradePhp72/Rector/FuncCall/DowngradePregUnmatchedAsNullConstantRector/Fixture/{class_contant.php.inc => class_constant.php.inc} (100%) diff --git a/.github/typos.toml b/.github/typos.toml index 5ad1e587..4f773c0f 100644 --- a/.github/typos.toml +++ b/.github/typos.toml @@ -1,2 +1,4 @@ [default.extend-words] Symplify = "Symplify" + +Invokable = "Invokable" \ No newline at end of file diff --git a/rules-tests/DowngradePhp72/Rector/FuncCall/DowngradePregUnmatchedAsNullConstantRector/Fixture/class_contant.php.inc b/rules-tests/DowngradePhp72/Rector/FuncCall/DowngradePregUnmatchedAsNullConstantRector/Fixture/class_constant.php.inc similarity index 100% rename from rules-tests/DowngradePhp72/Rector/FuncCall/DowngradePregUnmatchedAsNullConstantRector/Fixture/class_contant.php.inc rename to rules-tests/DowngradePhp72/Rector/FuncCall/DowngradePregUnmatchedAsNullConstantRector/Fixture/class_constant.php.inc