From d263216c3abe313fb681e8e0ba2286a4eb1571c6 Mon Sep 17 00:00:00 2001 From: Evan Sims Date: Fri, 12 Jul 2024 06:14:01 -0500 Subject: [PATCH] chore: fix linter warnings (#767) ### Changes This PR fixes a number of linter warnings that are breaking pull requests. It also pins certain development dependencies that have been prone to introducing these types of breaking changes in their minor releases to help avoid future breaks. ### References ### Testing ### Contributor Checklist - [x] I agree to adhere to the [Auth0 General Contribution Guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md). - [x] I agree to uphold the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md). --- .php-cs-fixer.dist.php | 1 + composer.json | 22 +++++++++++----------- phpstan.neon.dist | 1 + rector.php | 17 +++++++++-------- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 5a9e5d0d..f3a46981 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,6 +1,7 @@ setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) ->setRiskyAllowed(true) ->setRules([ 'array_indentation' => true, diff --git a/composer.json b/composer.json index 08fbf679..932f78b1 100644 --- a/composer.json +++ b/composer.json @@ -39,19 +39,19 @@ "psr/http-message-implementation": "^1" }, "require-dev": { - "ergebnis/composer-normalize": "^2", - "friendsofphp/php-cs-fixer": "^3", - "mockery/mockery": "^1", - "pestphp/pest": "^2", - "phpstan/phpstan": "^1", - "phpstan/phpstan-strict-rules": "^1", - "psr-mock/http": "^1", - "rector/rector": "0.17.6", - "spatie/ray": "^1", + "ergebnis/composer-normalize": "~2.43.0", + "friendsofphp/php-cs-fixer": "~3.59.0", + "mockery/mockery": "~1.6.0", + "pestphp/pest": "~2.34.0", + "phpstan/phpstan": "~1.11.0", + "phpstan/phpstan-strict-rules": "~1.6.0", + "psr-mock/http": "~1.0.0", + "rector/rector": "~0.17.0", + "spatie/ray": "~1.41.0", "symfony/cache": "^4 || ^5 || ^6", "symfony/event-dispatcher": "^4 || ^5 || ^6", - "vimeo/psalm": "^5", - "wikimedia/composer-merge-plugin": "^2" + "vimeo/psalm": "~5.25.0", + "wikimedia/composer-merge-plugin": "~2.1.0" }, "suggest": { "psr/cache-implementation": "(PSR-6 Cache) Improve performance by avoiding making redundant network requests.", diff --git a/phpstan.neon.dist b/phpstan.neon.dist index dff6ccdf..cce7beac 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -48,3 +48,4 @@ parameters: path: src\Utility\HttpRequest.php reportUnmatchedIgnoredErrors: false + treatPhpDocTypesAsCertain: false diff --git a/rector.php b/rector.php index 386dfd70..3791375c 100644 --- a/rector.php +++ b/rector.php @@ -18,7 +18,8 @@ use Rector\CodeQuality\Rector\ClassMethod\{InlineArrayReturnAssignRector, NarrowUnionTypeDocRector, OptionalParametersAfterRequiredRector, - ReturnTypeFromStrictScalarReturnExprRector}; + // ReturnTypeFromStrictScalarReturnExprRector + }; use Rector\CodeQuality\Rector\Concat\JoinStringConcatRector; use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector; use Rector\CodeQuality\Rector\Equal\UseIdenticalOverEqualWithSameTypeRector; @@ -207,10 +208,10 @@ AddReturnTypeDeclarationBasedOnParentClassMethodRector, AddVoidReturnTypeWhereNoReturnRector, ArrayShapeFromConstantArrayReturnRector, - ParamAnnotationIncorrectNullableRector, + // ParamAnnotationIncorrectNullableRector, ParamTypeByMethodCallTypeRector, ParamTypeByParentCallTypeRector, - ReturnAnnotationIncorrectNullableRector, + // ReturnAnnotationIncorrectNullableRector, ReturnNeverTypeRector, ReturnTypeFromReturnDirectArrayRector, ReturnTypeFromReturnNewRector, @@ -220,7 +221,7 @@ ReturnTypeFromStrictNewArrayRector, ReturnTypeFromStrictTypedCallRector, ReturnTypeFromStrictTypedPropertyRector}; -use Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector; +// use Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector; use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector; use Rector\TypeDeclaration\Rector\FunctionLike\{AddParamTypeSplFixedArrayRector, AddReturnTypeDeclarationFromYieldsRector}; @@ -336,7 +337,7 @@ // ActionInjectionToConstructorInjectionRector::class, AddArrayDefaultToArrayPropertyRector::class, AddArrowFunctionReturnTypeRector::class, - AddClosureReturnTypeRector::class, + // AddClosureReturnTypeRector::class, // AddFalseDefaultToBoolPropertyRector::class, AddMethodCallBasedStrictParamTypeRector::class, AddParamBasedOnParentClassMethodRector::class, @@ -412,7 +413,7 @@ // NormalizeNamespaceByPSR4ComposerAutoloadRector::class, NullableCompareToNullRector::class, OptionalParametersAfterRequiredRector::class, - ParamAnnotationIncorrectNullableRector::class, + // ParamAnnotationIncorrectNullableRector::class, ParamTypeByMethodCallTypeRector::class, ParamTypeByParentCallTypeRector::class, ParamTypeFromStrictTypedPropertyRector::class, @@ -466,7 +467,7 @@ RenameForeachValueVariableToMatchExprVariableRector::class, RenameForeachValueVariableToMatchMethodCallReturnTypeRector::class, ReplaceMultipleBooleanNotRector::class, - ReturnAnnotationIncorrectNullableRector::class, + // ReturnAnnotationIncorrectNullableRector::class, // ReturnBinaryAndToEarlyReturnRector::class, ReturnBinaryOrToEarlyReturnRector::class, ReturnEarlyIfVariableRector::class, @@ -477,7 +478,7 @@ ReturnTypeFromStrictConstantReturnRector::class, ReturnTypeFromStrictNativeCallRector::class, ReturnTypeFromStrictNewArrayRector::class, - ReturnTypeFromStrictScalarReturnExprRector::class, + // ReturnTypeFromStrictScalarReturnExprRector::class, ReturnTypeFromStrictTernaryRector::class, ReturnTypeFromStrictTypedCallRector::class, ReturnTypeFromStrictTypedPropertyRector::class,