Skip to content

Commit

Permalink
Merge pull request #21 from spryker-sdk/feature/te-10139/dev-phpstan-…
Browse files Browse the repository at this point in the history
…integration

TE-10139 PHPStan 1.0 upgrade
  • Loading branch information
dereuromark authored Dec 10, 2021
2 parents 6596d79 + a42d8ee commit 302b681
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: [ '7.2', '8.0', '8.1' ]
php-version: [ '7.3', '8.0', '8.1' ]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: [ '7.2' ]
php-version: [ '7.3' ]

steps:
- name: Checkout
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@
}
],
"require": {
"php": ">=7.2",
"phpunit/phpunit": "^8.5 || ^9.5",
"phpstan/phpstan": "^0.12.4"
"php": ">=7.3",
"phpunit/phpunit": "^9.5",
"phpstan/phpstan": "^1.0.0"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.1.1",
"jakub-onderka/php-parallel-lint": "^1.0",
"phing/phing": "^2.16.0",
"phpstan/phpstan-strict-rules": "^0.12.0",
"phpstan/phpstan-strict-rules": "^1.0.0",
"spryker/code-sniffer": "*",
"squizlabs/php_codesniffer": "^3.3.1"
"squizlabs/php_codesniffer": "^3.6.0"
},
"autoload": {
"psr-4": {
"PHPStan\\": "src/"
"SprykerSdk\\PHPStanSpryker\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"PHPStan\\Test\\": "tests/"
"SprykerSdk\\PHPStanSpryker\\Test\\": "tests/"
}
},
"scripts": {
Expand Down
54 changes: 27 additions & 27 deletions extension.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
# Rules
-
class: PHPStan\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
class: SprykerSdk\PHPStanSpryker\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
tags:
- phpstan.rules.rule
arguments:
Expand All @@ -11,7 +11,7 @@ services:
- getFacade

-
class: PHPStan\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
class: SprykerSdk\PHPStanSpryker\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
tags:
- phpstan.rules.rule
arguments:
Expand All @@ -21,7 +21,7 @@ services:
- getClient

-
class: PHPStan\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
class: SprykerSdk\PHPStanSpryker\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
tags:
- phpstan.rules.rule
arguments:
Expand All @@ -31,7 +31,7 @@ services:
- getFacade

-
class: PHPStan\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
class: SprykerSdk\PHPStanSpryker\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
tags:
- phpstan.rules.rule
arguments:
Expand All @@ -41,7 +41,7 @@ services:
- getFactory

-
class: PHPStan\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
class: SprykerSdk\PHPStanSpryker\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
tags:
- phpstan.rules.rule
arguments:
Expand All @@ -50,7 +50,7 @@ services:
- getSharedConfig

-
class: PHPStan\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
class: SprykerSdk\PHPStanSpryker\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
tags:
- phpstan.rules.rule
arguments:
Expand All @@ -61,7 +61,7 @@ services:
- getFactory

-
class: PHPStan\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
class: SprykerSdk\PHPStanSpryker\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
tags:
- phpstan.rules.rule
arguments:
Expand All @@ -72,7 +72,7 @@ services:
- getFactory

-
class: PHPStan\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
class: SprykerSdk\PHPStanSpryker\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
tags:
- phpstan.rules.rule
arguments:
Expand All @@ -81,7 +81,7 @@ services:
- getFactory

-
class: PHPStan\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
class: SprykerSdk\PHPStanSpryker\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
tags:
- phpstan.rules.rule
arguments:
Expand All @@ -93,7 +93,7 @@ services:
- getConfig

-
class: PHPStan\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
class: SprykerSdk\PHPStanSpryker\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
tags:
- phpstan.rules.rule
arguments:
Expand All @@ -102,7 +102,7 @@ services:
- getFactory

-
class: PHPStan\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
class: SprykerSdk\PHPStanSpryker\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
tags:
- phpstan.rules.rule
arguments:
Expand All @@ -112,7 +112,7 @@ services:
- getConfig

-
class: PHPStan\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
class: SprykerSdk\PHPStanSpryker\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
tags:
- phpstan.rules.rule
arguments:
Expand All @@ -123,7 +123,7 @@ services:
- getQueryContainer

-
class: PHPStan\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
class: SprykerSdk\PHPStanSpryker\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule
tags:
- phpstan.rules.rule
arguments:
Expand All @@ -136,7 +136,7 @@ services:

# Extensions
-
class: PHPStan\Type\Spryker\DynamicMethodMissingTypeExtension
class: SprykerSdk\PHPStanSpryker\Type\Spryker\DynamicMethodMissingTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
arguments:
Expand All @@ -146,7 +146,7 @@ services:
- getFacade

-
class: PHPStan\Type\Spryker\DynamicMethodMissingTypeExtension
class: SprykerSdk\PHPStanSpryker\Type\Spryker\DynamicMethodMissingTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
arguments:
Expand All @@ -156,7 +156,7 @@ services:
- getClient

-
class: PHPStan\Type\Spryker\DynamicMethodMissingTypeExtension
class: SprykerSdk\PHPStanSpryker\Type\Spryker\DynamicMethodMissingTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
arguments:
Expand All @@ -166,7 +166,7 @@ services:
- getFacade

-
class: PHPStan\Type\Spryker\DynamicMethodMissingTypeExtension
class: SprykerSdk\PHPStanSpryker\Type\Spryker\DynamicMethodMissingTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
arguments:
Expand All @@ -176,7 +176,7 @@ services:
- getFactory

-
class: PHPStan\Type\Spryker\DynamicMethodMissingTypeExtension
class: SprykerSdk\PHPStanSpryker\Type\Spryker\DynamicMethodMissingTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
arguments:
Expand All @@ -185,7 +185,7 @@ services:
- getSharedConfig

-
class: PHPStan\Type\Spryker\DynamicMethodMissingTypeExtension
class: SprykerSdk\PHPStanSpryker\Type\Spryker\DynamicMethodMissingTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
arguments:
Expand All @@ -196,7 +196,7 @@ services:
- getFactory

-
class: PHPStan\Type\Spryker\DynamicMethodMissingTypeExtension
class: SprykerSdk\PHPStanSpryker\Type\Spryker\DynamicMethodMissingTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
arguments:
Expand All @@ -207,7 +207,7 @@ services:
- getFactory

-
class: PHPStan\Type\Spryker\DynamicMethodMissingTypeExtension
class: SprykerSdk\PHPStanSpryker\Type\Spryker\DynamicMethodMissingTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
arguments:
Expand All @@ -216,7 +216,7 @@ services:
- getFactory

-
class: PHPStan\Type\Spryker\DynamicMethodMissingTypeExtension
class: SprykerSdk\PHPStanSpryker\Type\Spryker\DynamicMethodMissingTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
arguments:
Expand All @@ -228,7 +228,7 @@ services:
- getConfig

-
class: PHPStan\Type\Spryker\DynamicMethodMissingTypeExtension
class: SprykerSdk\PHPStanSpryker\Type\Spryker\DynamicMethodMissingTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
arguments:
Expand All @@ -237,7 +237,7 @@ services:
- getFactory

-
class: PHPStan\Type\Spryker\DynamicMethodMissingTypeExtension
class: SprykerSdk\PHPStanSpryker\Type\Spryker\DynamicMethodMissingTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
arguments:
Expand All @@ -247,7 +247,7 @@ services:
- getConfig

-
class: PHPStan\Type\Spryker\DynamicMethodMissingTypeExtension
class: SprykerSdk\PHPStanSpryker\Type\Spryker\DynamicMethodMissingTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
arguments:
Expand All @@ -258,7 +258,7 @@ services:
- getQueryContainer

-
class: PHPStan\Type\Spryker\DynamicMethodMissingTypeExtension
class: SprykerSdk\PHPStanSpryker\Type\Spryker\DynamicMethodMissingTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
arguments:
Expand All @@ -267,4 +267,4 @@ services:
- getFacade
- getFactory
- getConfig
- getQueryContainer
- getQueryContainer
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* For full license information, please view the LICENSE file that was distributed with this source code.
*/

namespace PHPStan\Rules\Spryker;
namespace SprykerSdk\PHPStanSpryker\Rules\Spryker;

use PhpParser\Node;
use PhpParser\Node\Expr\MethodCall;
Expand Down
2 changes: 1 addition & 1 deletion src/Type/Spryker/DynamicMethodMissingTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* For full license information, please view the LICENSE file that was distributed with this source code.
*/

namespace PHPStan\Type\Spryker;
namespace SprykerSdk\PHPStanSpryker\Type\Spryker;

use PhpParser\Node\Expr\MethodCall;
use PHPStan\Analyser\Scope;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* For full license information, please view the LICENSE file that was distributed with this source code.
*/

namespace PHPStan\Test\Rules\Spryker;
namespace SprykerSdk\PHPStanSpryker\Test\Rules\Spryker;

use PHPStan\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule;
use SprykerSdk\PHPStanSpryker\Rules\Spryker\DynamicMethodMissingPhpDocAnnotationRule;
use PHPUnit\Framework\TestCase;

class DynamicMethodMissingPhpDocAnnotationRuleTest extends TestCase
Expand Down
4 changes: 2 additions & 2 deletions tests/Type/Spryker/DynamicMethodMissingTypeExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* For full license information, please view the LICENSE file that was distributed with this source code.
*/

namespace PHPStan\Test\Rules\Spryker;
namespace SprykerSdk\PHPStanSpryker\Test\Rules\Spryker;

use PHPStan\Cache\Cache;
use PHPStan\Reflection\Annotations\AnnotationsMethodsClassReflectionExtension;
use PHPStan\Type\Spryker\DynamicMethodMissingTypeExtension;
use SprykerSdk\PHPStanSpryker\Type\Spryker\DynamicMethodMissingTypeExtension;
use PHPUnit\Framework\TestCase;

class DynamicMethodMissingTypeExtensionTest extends TestCase
Expand Down
19 changes: 18 additions & 1 deletion tests/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,27 @@ parameters:
checkGenericClassInNonGenericObjectType: false
ignoreErrors:
-
message: "#^Parameter \\#1 \\$node \\(PhpParser\\\\Node\\\\Expr\\\\MethodCall\\) of method PHPStan\\\\Rules\\\\Spryker\\\\DynamicMethodMissingPhpDocAnnotationRule\\:\\:processNode\\(\\) should be contravariant with parameter \\$node \\(PhpParser\\\\Node\\) of method PHPStan\\\\Rules\\\\Rule\\<PhpParser\\\\Node\\>\\:\\:processNode\\(\\)$#"
message: "#.+DynamicMethodMissingPhpDocAnnotationRule::processNode\\(\\) should be contravariant with parameter .+ of method .+Node\\>::processNode\\(\\)#"
count: 1
path: ../src/Rules/Spryker/DynamicMethodMissingPhpDocAnnotationRule.php
-
message: "#.+DynamicMethodMissingPhpDocAnnotationRule::getNodeType\\(\\) should be covariant with return type .+ of method .+Node\\>::getNodeType\\(\\)#"
count: 1
path: ../src/Rules/Spryker/DynamicMethodMissingPhpDocAnnotationRule.php
-
message: '#Calling PHPStan\\Cache\\Cache::load\(\) .+.#'
count: 1
path: '%rootDir%/../../../src/Type/Spryker/DynamicMethodMissingTypeExtension.php'
-
message: '#Calling PHPStan\\Cache\\Cache::save\(\) .+.#'
count: 1
path: '%rootDir%/../../../src/Type/Spryker/DynamicMethodMissingTypeExtension.php'
-
message: '#Calling PHPStan\\Reflection\\Annotations\\AnnotationsMethodsClassReflectionExtension::getMethod\(\) .+.#'
count: 1
path: '%rootDir%/../../../src/Type/Spryker/DynamicMethodMissingTypeExtension.php'
-
message: '#Calling PHPStan\\Reflection\\Annotations\\AnnotationsMethodsClassReflectionExtension::hasMethod\(\) .+.#'
count: 1
path: '%rootDir%/../../../src/Type/Spryker/DynamicMethodMissingTypeExtension.php'
reportUnmatchedIgnoredErrors: false

0 comments on commit 302b681

Please sign in to comment.