diff --git a/.github/typos.toml b/.github/typos.toml new file mode 100644 index 00000000..4f773c0f --- /dev/null +++ b/.github/typos.toml @@ -0,0 +1,4 @@ +[default.extend-words] +Symplify = "Symplify" + +Invokable = "Invokable" \ No newline at end of file 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" 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 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 = [];