Skip to content

Commit f792083

Browse files
Bump phpstan and psalm (#1805)
1 parent 79c9b2b commit f792083

16 files changed

+44
-19
lines changed

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,21 @@
6161
"matthiasnoback/symfony-dependency-injection-test": "^4.1.1 || ^5.0",
6262
"phpstan/extension-installer": "^1.0",
6363
"phpstan/phpdoc-parser": "^1.0",
64-
"phpstan/phpstan": "^1.0",
65-
"phpstan/phpstan-phpunit": "^1.0",
66-
"phpstan/phpstan-strict-rules": "^1.3",
67-
"phpstan/phpstan-symfony": "^1.0",
64+
"phpstan/phpstan": "^1.0 || ^2.0",
65+
"phpstan/phpstan-phpunit": "^1.0 || ^2.0",
66+
"phpstan/phpstan-strict-rules": "^1.3 || ^2.0",
67+
"phpstan/phpstan-symfony": "^1.0 || ^2.0",
6868
"phpunit/phpunit": "^9.5",
6969
"psalm/plugin-phpunit": "^0.19",
7070
"psalm/plugin-symfony": "^5.0",
71-
"rector/rector": "^1.1",
71+
"rector/rector": "^1.1 || ^2.0",
7272
"symfony/browser-kit": "^6.4 || ^7.1",
7373
"symfony/css-selector": "^6.4 || ^7.1",
7474
"symfony/filesystem": "^6.4 || ^7.1",
7575
"symfony/panther": "^2.0.1",
7676
"symfony/phpunit-bridge": "^7.1",
7777
"symfony/yaml": "^6.4 || ^7.1",
78-
"vimeo/psalm": "^5.0"
78+
"vimeo/psalm": "^5.0 || ^6.10"
7979
},
8080
"conflict": {
8181
"doctrine/dbal": "<3.4",

phpstan-baseline.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ parameters:
2222
message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, array\\<string, bool\\|string\\>\\|Sonata\\\\PageBundle\\\\Model\\\\PageInterface\\|Sonata\\\\PageBundle\\\\Model\\\\SiteInterface\\|null given\\.$#"
2323
count: 1
2424
path: src/Form/Type/PageSelectorType.php
25+
-
26+
message: '#^Call to internal method Symfony\\Component\\HttpFoundation\\Request\:\:get\(\) from outside its root namespace Symfony.$#'
27+
path: .
28+
-
29+
message: '#^Call to method (s|g)et\(\) of internal class Symfony\\Bundle\\FrameworkBundle\\Test\\TestContainer from outside its root namespace Symfony.$#'
30+
path: tests/

psalm.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@
1515
<!-- Psalm equivalent of PHPStan config `treatPhpDocTypesAsCertain: false` -->
1616
<DocblockTypeContradiction errorLevel="suppress"/>
1717
<RedundantConditionGivenDocblockType errorLevel="suppress"/>
18-
<UndefinedDocblockClass>
19-
<errorLevel type="suppress">
20-
<!-- https://github.com/symfony/symfony/issues/45609 -->
21-
<referencedClass name="UnitEnum"/>
22-
</errorLevel>
23-
</UndefinedDocblockClass>
2418
<InternalClass errorLevel="suppress"/>
2519
<InternalMethod errorLevel="suppress"/>
2620
<InternalProperty errorLevel="suppress"/>
@@ -31,5 +25,6 @@
3125
</errorLevel>
3226
</UndefinedInterfaceMethod>
3327
<MissingClassConstType errorLevel="suppress"/>
28+
<MissingOverrideAttribute errorLevel="suppress"/>
3429
</issueHandlers>
3530
</psalm>

src/Admin/SharedBlockAdmin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ protected function configureQuery(ProxyQueryInterface $query): ProxyQueryInterfa
5050
// Filter on blocks without page and parents
5151
$queryBuilder = $query->getQueryBuilder();
5252
$rootAlias = current($queryBuilder->getRootAliases());
53+
\assert(false !== $rootAlias);
5354
$queryBuilder->andWhere($queryBuilder->expr()->isNull($rootAlias.'.page'));
5455
$queryBuilder->andWhere($queryBuilder->expr()->isNull($rootAlias.'.parent'));
5556

src/Template/Matrix/Parser.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
final class Parser
3131
{
3232
/**
33+
* @psalm-suppress InvalidOperand
34+
*
3335
* @param array<string> $mapping
3436
*
3537
* @throws \InvalidArgumentException

src/Twig/PageRuntime.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
use Twig\Error\SyntaxError;
3232
use Twig\Extension\RuntimeExtensionInterface;
3333

34+
/**
35+
* NEXT_MAJOR: Declare this class as final.
36+
*
37+
* @final since 4.9.0
38+
*/
3439
class PageRuntime implements RuntimeExtensionInterface
3540
{
3641
/**

src/Validator/Constraints/UniqueUrl.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
/**
1919
* @Annotation
20+
*
21+
* NEXT_MAJOR: Declare this class as final.
22+
*
23+
* @final since 4.9.0
2024
*/
2125
class UniqueUrl extends Constraint
2226
{

tests/App/Entity/SonataPageBlock.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
use Doctrine\ORM\Mapping as ORM;
1818
use Sonata\PageBundle\Entity\BaseBlock;
1919

20+
/**
21+
* @psalm-suppress ClassMustBeFinal
22+
*/
2023
#[ORM\Entity]
2124
#[ORM\Table(name: 'page__block')]
2225
class SonataPageBlock extends BaseBlock

tests/App/Entity/SonataPagePage.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
use Doctrine\ORM\Mapping as ORM;
1818
use Sonata\PageBundle\Entity\BasePage;
1919

20+
/**
21+
* @psalm-suppress ClassMustBeFinal
22+
*/
2023
#[ORM\Entity]
2124
#[ORM\Table(name: 'page__page')]
2225
#[ORM\HasLifecycleCallbacks]

tests/App/Entity/SonataPageSite.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
use Doctrine\ORM\Mapping as ORM;
1818
use Sonata\PageBundle\Entity\BaseSite;
1919

20+
/**
21+
* @psalm-suppress ClassMustBeFinal
22+
*/
2023
#[ORM\Entity]
2124
#[ORM\Table(name: 'page__site')]
2225
#[ORM\HasLifecycleCallbacks]

0 commit comments

Comments
 (0)