Skip to content

Commit 6a82931

Browse files
committed
Upgrade test application to 1.14 and use PHPStan instead of Psalm
1 parent 5d64ce6 commit 6a82931

File tree

6 files changed

+74
-63
lines changed

6 files changed

+74
-63
lines changed

composer.json

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
"sylius/inventory": "^1.0",
2323
"sylius/product": "^1.0",
2424
"sylius/resource-bundle": "^1.6",
25-
"symfony/config": "^6.4 || ^7.0",
26-
"symfony/dependency-injection": "^6.4 || ^7.0",
27-
"symfony/event-dispatcher": "^6.4 || ^7.0",
28-
"symfony/form": "^6.4 || ^7.0",
29-
"symfony/http-foundation": "^6.4 || ^7.0",
30-
"symfony/http-kernel": "^6.4 || ^7.0",
31-
"symfony/routing": "^6.4 || ^7.0",
32-
"symfony/string": "^6.4 || ^7.0",
25+
"symfony/config": "^6.4",
26+
"symfony/dependency-injection": "^6.4",
27+
"symfony/event-dispatcher": "^6.4",
28+
"symfony/form": "^6.4",
29+
"symfony/http-foundation": "^6.4",
30+
"symfony/http-kernel": "^6.4",
31+
"symfony/routing": "^6.4",
32+
"symfony/string": "^6.4",
3333
"twig/twig": "^2.15 || ^3.0",
3434
"webmozart/assert": "^1.11"
3535
},
@@ -41,18 +41,12 @@
4141
"infection/infection": "^0.27.10",
4242
"jms/serializer-bundle": "^4.2",
4343
"lexik/jwt-authentication-bundle": "^2.17",
44-
"matthiasnoback/symfony-dependency-injection-test": "^4.3 || ^5.1",
45-
"phpspec/prophecy-phpunit": "^2.4",
46-
"phpunit/phpunit": "^9.6.17",
47-
"psalm/plugin-phpunit": "^0.18.4",
48-
"setono/code-quality-pack": "^2.8.2",
49-
"shipmonk/composer-dependency-analyser": "^1.8",
50-
"sylius/sylius": "~1.12.13",
51-
"symfony/debug-bundle": "^6.4 || ^7.0",
52-
"symfony/dotenv": "^6.4 || ^7.0",
53-
"symfony/intl": "^6.4 || ^7.0",
54-
"symfony/property-info": "^6.4 || ^7.0",
55-
"symfony/web-profiler-bundle": "^6.4 || ^7.0",
44+
"setono/sylius-plugin-pack": "~1.14.2",
45+
"symfony/debug-bundle": "^6.4",
46+
"symfony/dotenv": "^6.4",
47+
"symfony/intl": "^6.4",
48+
"symfony/property-info": "^6.4",
49+
"symfony/web-profiler-bundle": "^6.4",
5650
"symfony/webpack-encore-bundle": "^1.17.2",
5751
"willdurand/negotiation": "^3.1"
5852
},
@@ -78,17 +72,13 @@
7872
"dealerdirect/phpcodesniffer-composer-installer": false,
7973
"ergebnis/composer-normalize": true,
8074
"infection/extension-installer": true,
75+
"phpstan/extension-installer": true,
8176
"symfony/thanks": false
8277
},
8378
"sort-packages": true
8479
},
85-
"extra": {
86-
"branch-alias": {
87-
"dev-master": "1.0-dev"
88-
}
89-
},
9080
"scripts": {
91-
"analyse": "psalm",
81+
"analyse": "phpstan analyse",
9282
"check-style": "ecs check",
9383
"fix-style": "ecs check --fix",
9484
"phpunit": "phpunit"

phpstan.neon

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
parameters:
2+
level: max
3+
4+
paths:
5+
- src
6+
- tests
7+
8+
excludePaths:
9+
- tests/Application/*
10+
11+
bootstrapFiles:
12+
- vendor/autoload.php
13+
14+
# Symfony Configuration
15+
symfony:
16+
consoleApplicationLoader: tests/PHPStan/console_application.php
17+
18+
# Doctrine Configuration
19+
doctrine:
20+
repositoryClass: Doctrine\ORM\EntityRepository
21+
objectManagerLoader: tests/PHPStan/object_manager.php
22+
23+
reportUnmatchedIgnoredErrors: false
24+
treatPhpDocTypesAsCertain: false

psalm.xml

Lines changed: 0 additions & 31 deletions
This file was deleted.

tests/Application/config/bundles.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
99
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
1010
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
11+
Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class => ['all' => true],
12+
Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
1113
Sylius\Bundle\OrderBundle\SyliusOrderBundle::class => ['all' => true],
1214
Sylius\Bundle\MoneyBundle\SyliusMoneyBundle::class => ['all' => true],
1315
Sylius\Bundle\CurrencyBundle\SyliusCurrencyBundle::class => ['all' => true],
@@ -29,6 +31,7 @@
2931
Sylius\Bundle\ReviewBundle\SyliusReviewBundle::class => ['all' => true],
3032
Sylius\Bundle\CoreBundle\SyliusCoreBundle::class => ['all' => true],
3133
Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true],
34+
Setono\SyliusSEOPlugin\SetonoSyliusSEOPlugin::class => ['all' => true],
3235
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
3336
winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true],
3437
Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true],
@@ -37,25 +40,24 @@
3740
FOS\RestBundle\FOSRestBundle::class => ['all' => true],
3841
Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true],
3942
Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
40-
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
4143
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
4244
Payum\Bundle\PayumBundle\PayumBundle::class => ['all' => true],
4345
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
46+
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
4447
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
4548
Sylius\Bundle\FixturesBundle\SyliusFixturesBundle::class => ['all' => true],
4649
Sylius\Bundle\PayumBundle\SyliusPayumBundle::class => ['all' => true],
4750
Sylius\Bundle\ThemeBundle\SyliusThemeBundle::class => ['all' => true],
4851
Sylius\Bundle\AdminBundle\SyliusAdminBundle::class => ['all' => true],
4952
Sylius\Bundle\ShopBundle\SyliusShopBundle::class => ['all' => true],
50-
Setono\SyliusSEOPlugin\SetonoSyliusSEOPlugin::class => ['all' => true],
51-
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
52-
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
53+
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
54+
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true],
55+
Sylius\Behat\Application\SyliusTestPlugin\SyliusTestPlugin::class => ['test' => true, 'test_cached' => true],
5356
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
5457
Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
5558
Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true],
5659
SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true],
57-
BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true],
5860
SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
61+
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
5962
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
60-
Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true],
6163
];
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Setono\SyliusSEOPlugin\Tests\Application\Kernel;
6+
use Symfony\Bundle\FrameworkBundle\Console\Application;
7+
8+
require __DIR__ . '/../../vendor/autoload.php';
9+
10+
$kernel = new Kernel('test', true);
11+
$kernel->boot();
12+
13+
return new Application($kernel);

tests/PHPStan/object_manager.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Setono\SyliusSEOPlugin\Tests\Application\Kernel;
6+
7+
require __DIR__ . '/../../vendor/autoload.php';
8+
9+
$kernel = new Kernel('test', true);
10+
$kernel->boot();
11+
12+
/** @phpstan-ignore method.notFound,method.nonObject */
13+
return $kernel->getContainer()->get('doctrine')->getManager();

0 commit comments

Comments
 (0)