Skip to content

Commit

Permalink
add phpstan-symfony & phpstan-phpunit
Browse files Browse the repository at this point in the history
  • Loading branch information
DjordyKoert committed Mar 2, 2024
1 parent 9341389 commit 85bbf81
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 11 deletions.
13 changes: 10 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"symfony/deprecation-contracts": "^2.1|^3"
},
"require-dev": {
"sensio/framework-extra-bundle": "^6.0",
"symfony/asset": "^6.4|^7.0",
"symfony/dom-crawler": "^6.4|^7.0",
"symfony/browser-kit": "^6.4|^7.0",
Expand All @@ -47,15 +46,18 @@
"symfony/security-csrf": "^6.4|^7.0",

"api-platform/core": "^2.7.0|^3",
"friendsofsymfony/rest-bundle": "^2.8|^3.0",
"willdurand/hateoas-bundle": "^1.0|^2.0",
"jms/serializer-bundle": "^2.3|^3.0|^4.0|^5.0",
"jms/serializer": "^1.14|^3.0",
"composer/package-versions-deprecated": "1.11.99.1",

"phpunit/phpunit": "^9.6",
"doctrine/annotations": "^2.0",
"phpstan/phpstan": "^1.10"

"phpstan/phpstan": "^1.10",
"phpstan/phpstan-symfony": "^1.3",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/extension-installer": "^1.3"
},
"suggest": {
"api-platform/core": "For using an API oriented framework.",
Expand Down Expand Up @@ -95,5 +97,10 @@
"phpunit": "phpunit",
"phpstan": "phpstan analyse --memory-limit=2G",
"phpstan-baseline": "phpstan analyse --generate-baseline --memory-limit=2G"
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
}
}
46 changes: 38 additions & 8 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ parameters:
path: src/Controller/YamlDocumentationController.php

-
message: "#^Argument of an invalid type array\\|bool\\|float\\|int\\|string\\|UnitEnum\\|null supplied for foreach, only iterables are supported\\.$#"
message: "#^Argument of an invalid type array\\|bool\\|float\\|int\\|string\\|null supplied for foreach, only iterables are supported\\.$#"
count: 1
path: src/DependencyInjection/Compiler/TagDescribersPass.php

Expand Down Expand Up @@ -2100,11 +2100,6 @@ parameters:
count: 1
path: src/Util/ControllerReflector.php

-
message: "#^Comparison operation \"\\>\\=\" between 70004 and 40100 is always true\\.$#"
count: 1
path: src/Util/ControllerReflector.php

-
message: "#^Method Nelmio\\\\ApiDocBundle\\\\Util\\\\ControllerReflector\\:\\:getClassAndMethod\\(\\) has no return type specified\\.$#"
count: 1
Expand Down Expand Up @@ -2981,7 +2976,7 @@ parameters:
path: tests/Functional/Controller/UndocumentedController.php

-
message: "#^Call to an undefined method object\\:\\:generate\\(\\)\\.$#"
message: "#^Cannot call method generate\\(\\) on object\\|null\\.$#"
count: 1
path: tests/Functional/ControllerTest.php

Expand Down Expand Up @@ -4530,6 +4525,26 @@ parameters:
count: 1
path: tests/Functional/FOSRestTest.php

-
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with '@OA\\\\\\\\Generator\\:…' and OpenApi\\\\Annotations\\\\Post will always evaluate to false\\.$#"
count: 1
path: tests/Functional/FunctionalTest.php

-
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with '@OA\\\\\\\\Generator\\:…' and array\\<OpenApi\\\\Annotations\\\\Property\\> will always evaluate to false\\.$#"
count: 4
path: tests/Functional/FunctionalTest.php

-
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with '@OA\\\\\\\\Generator\\:…' and array\\<string\\> will always evaluate to false\\.$#"
count: 1
path: tests/Functional/FunctionalTest.php

-
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with '@OA\\\\\\\\Generator\\:…' and bool will always evaluate to false\\.$#"
count: 3
path: tests/Functional/FunctionalTest.php

-
message: "#^Cannot access offset 'application/json' on array\\<OpenApi\\\\Annotations\\\\Attachable\\|OpenApi\\\\Annotations\\\\JsonContent\\|OpenApi\\\\Annotations\\\\MediaType\\|OpenApi\\\\Annotations\\\\XmlContent\\>\\|OpenApi\\\\Annotations\\\\Attachable\\|OpenApi\\\\Annotations\\\\JsonContent\\|OpenApi\\\\Annotations\\\\MediaType\\|OpenApi\\\\Annotations\\\\XmlContent\\.$#"
count: 2
Expand Down Expand Up @@ -4930,6 +4945,11 @@ parameters:
count: 1
path: tests/Functional/SwaggerUiTest.php

-
message: "#^You should use assertCount\\(\\$expectedCount, \\$variable\\) instead of assertSame\\(\\$expectedCount, \\$variable\\-\\>count\\(\\)\\)\\.$#"
count: 1
path: tests/Functional/SwaggerUiTest.php

-
message: "#^Cannot access offset 'parameters' on mixed\\.$#"
count: 4
Expand Down Expand Up @@ -5021,7 +5041,7 @@ parameters:
path: tests/Functional/WebTestCase.php

-
message: "#^Call to an undefined method object\\:\\:generate\\(\\)\\.$#"
message: "#^Cannot call method generate\\(\\) on object\\|null\\.$#"
count: 1
path: tests/Functional/WebTestCase.php

Expand Down Expand Up @@ -5780,6 +5800,11 @@ parameters:
count: 1
path: tests/ModelDescriber/Fixtures/SelfDescribingModel.php

-
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with '@OA\\\\\\\\Generator\\:…' and array\\<OpenApi\\\\Annotations\\\\Property\\> will always evaluate to false\\.$#"
count: 1
path: tests/ModelDescriber/FormModelDescriberTest.php

-
message: "#^Method Nelmio\\\\ApiDocBundle\\\\Tests\\\\ModelDescriber\\\\FormModelDescriberTest\\:\\:provideCsrfProtectionOptions\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -6075,6 +6100,11 @@ parameters:
count: 1
path: tests/SwaggerPhp/UtilTest.php

-
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) with array\\<string, mixed\\> and stdClass will always evaluate to false\\.$#"
count: 1
path: tests/SwaggerPhp/UtilTest.php

-
message: "#^Cannot access property \\$nested on OpenApi\\\\Context\\|null\\.$#"
count: 1
Expand Down

0 comments on commit 85bbf81

Please sign in to comment.