Skip to content

Commit 75f420e

Browse files
committed
[Test] run tests with lowest requirements
1 parent 9ec16e3 commit 75f420e

File tree

14 files changed

+151
-28
lines changed

14 files changed

+151
-28
lines changed

phpstan-package.neon

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,16 @@ parameters:
1010
- '**/ProcessManager/IndexProcess.php'
1111
- '**/DataHub/*.php'
1212
- 'vendor/***'
13-
- 'Core/EventListener/SessionStoreStorageListSubscriber.php?'
14-
- 'Core/EventListener/SessionStoreStorageListLogoutSubscriber.php?'
15-
- 'Core/EventListener/StorageListBlamerListener.php?'
16-
- 'Core/Context/CustomerAndStoreBasedStorageListContext.php?'
17-
- 'Core/Context/SessionAndStoreBasedStorageListContext.php?'
18-
- 'Core/Context/StoreBasedStorageListContext.php?'
19-
- 'Core/Provider/CoreContextProvider.php?'
20-
- 'Core/Storage/SessionStorageListStorage.php?'
21-
- 'Core/Repository/CustomerAndStoreAwareRepositoryInterface.php?'
22-
- 'DependencyInjection/CoreShopStorageListExtension.php?'
23-
- SplPriorityQueue.php?
24-
- PriorityQueue.php?
13+
- Core/EventListener/*.php (?)
14+
- Core/Context/CustomerAndStoreBasedStorageListContext.php (?)
15+
- Core/Context/SessionAndStoreBasedStorageListContext.php (?)
16+
- Core/Context/StoreBasedStorageListContext.php (?)
17+
- Core/Provider/CoreContextProvider.php (?)
18+
- Core/Storage/SessionStorageListStorage.php (?)
19+
- Core/Repository/CustomerAndStoreAwareRepositoryInterface.php (?)
20+
- DependencyInjection/CoreShopStorageListExtension.php (?)
21+
- SplPriorityQueue.php (?)
22+
- PriorityQueue.php (?)
2523

2624
ignoreErrors:
2725
# Magic calls

src/CoreShop/Bundle/NotificationBundle/Controller/NotificationRuleController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
use CoreShop\Bundle\ResourceBundle\Controller\ResourceController;
2121
use CoreShop\Component\Notification\Model\NotificationRuleInterface;
22+
use CoreShop\Component\Resource\Repository\RepositoryInterface;
2223
use Doctrine\Common\Collections\Criteria;
2324
use Doctrine\ORM\EntityRepository;
2425
use Symfony\Component\HttpFoundation\Request;
@@ -86,7 +87,7 @@ public function getConfigAction(Request $request): Response
8687
public function sortAction(Request $request): Response
8788
{
8889
/**
89-
* @var EntityRepository $repository
90+
* @var EntityRepository&RepositoryInterface $repository
9091
*/
9192
$repository = $this->repository;
9293
$rule = $this->getParameterFromRequest($request, 'rule');

src/CoreShop/Bundle/OptimisticEntityLockBundle/EventListener/LockListener.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ public function preAddLock(DataObjectEvent $dataObjectEvent): void
5656
}
5757

5858
/**
59-
* @var Concrete $object
60-
* @var OptimisticLockedInterface $object
59+
* @var Concrete&OptimisticLockedInterface $object
6160
*/
6261
$object->setOptimisticLockVersion(1);
6362
}
@@ -75,7 +74,7 @@ public function postUpdateLock(DataObjectEvent $dataObjectEvent): void
7574
}
7675

7776
/**
78-
* @var Concrete $object
77+
* @var Concrete&OptimisticLockedInterface $object
7978
*/
8079
$this->lockManager->updateLock($object);
8180
}
@@ -95,8 +94,7 @@ public function checkLock(DataObjectEvent $dataObjectEvent): void
9594
$this->ensureVersionMatch($object);
9695

9796
/**
98-
* @var Concrete $object
99-
* @var OptimisticLockedInterface $object
97+
* @var Concrete&OptimisticLockedInterface $object
10098
*/
10199
$object->setOptimisticLockVersion(($object->getOptimisticLockVersion() ?? 1) + 1);
102100
}

src/CoreShop/Bundle/OptimisticEntityLockBundle/composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
}
5252
},
5353
"config": {
54-
"sort-packages": true
54+
"sort-packages": true,
55+
"allow-plugins": {
56+
"php-http/discovery": true
57+
}
5558
}
5659
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
parameters:
2+
reportUnmatchedIgnoredErrors: false
3+
4+
excludePaths:
5+
# Makes PHPStan crash
6+
- '**/DependencyInjection/Configuration.php'
7+
- '**/Migrations/Version*.php'
8+
# Ignore cause the file uses external dependencies and will only be used if those dependencies are met
9+
- '**/ProcessManager/IndexListener.php'
10+
- '**/ProcessManager/IndexProcess.php'
11+
- '**/DataHub/*.php'
12+
- 'vendor/***'
13+
- 'Core/EventListener/SessionStoreStorageListSubscriber.php?'
14+
- 'Core/EventListener/SessionStoreStorageListLogoutSubscriber.php?'
15+
- 'Core/EventListener/StorageListBlamerListener.php?'
16+
- 'Core/Context/CustomerAndStoreBasedStorageListContext.php?'
17+
- 'Core/Context/SessionAndStoreBasedStorageListContext.php?'
18+
- 'Core/Context/StoreBasedStorageListContext.php?'
19+
- 'Core/Provider/CoreContextProvider.php?'
20+
- 'Core/Storage/SessionStorageListStorage.php?'
21+
- 'Core/Repository/CustomerAndStoreAwareRepositoryInterface.php?'
22+
- 'DependencyInjection/CoreShopStorageListExtension.php?'
23+
- SplPriorityQueue.php?
24+
- PriorityQueue.php?
25+
26+
ignoreErrors:
27+
# Magic calls
28+
- '/Call to an undefined static method Webmozart\\Assert\\Assert::all/'
29+
- '/Call to an undefined static method Webmozart\\Assert\\Assert::nullOr/'
30+
- '/Call to an undefined method Faker\\Generator::/'
31+
- '/Access to an undefined property Faker\\Generator::/'
32+
- '/Constant PIMCORE_CONFIGURATION_DIRECTORY not found./'
33+
- '/Constant PIMCORE_CLASS_DIRECTORY not found./'
34+
- '/Constant PIMCORE_WEB_ROOT not found./'
35+
- '/Constant PIMCORE_DEVMODE not found./'
36+
- '/Class Zend_Paginator_Adapter_Interface not found and could not be autoloaded./'
37+
38+
- '/Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition::children\(\)/'
39+
- '/Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface/'
40+
- '/Call to an undefined method Pimcore\\Model\\(.*)::save\(\)./'
41+
- '/Call to an undefined method Pimcore\\Model\\(.*)::delete\(\)./'
42+
- '/Method Pimcore\\Model\\DataObject\\Concrete::getLatestVersion\(\)\(.*\)/'
43+
- '/Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\)/'
44+
- '/Method CoreShop\\Bundle\\ResourceBundle\\Routing\\ResourceLoader::getResolver\(\) should return Symfony\\Component\\Config\\Loader\\LoaderResolverInterface but return statement is missing./'
45+
- '/PHPDoc type string of property CoreShop\\Bundle\\PayumBundle\\Request\\GetStatus::\$status is not covariant with PHPDoc type int of overridden property Payum\\Core\\Request\\BaseGetStatus::\$status./'
46+
- '/Method CoreShop\\Bundle\\ResourceBundle\\Controller\\AdminController::getSubscribedServices\(\) should return non-empty-array<string|Symfony\\Contracts\\Service\\Attribute\\SubscribedService> but returns array<string>./'
47+
48+
# Pimcore BC Breaks
49+
- '/Class Pimcore\\Bundle\\AdminBundle\\Helper\\GridHelperService not found/'
50+
- '/Class Pimcore\\Model\\DataObject\\LazyLoadedFieldsInterface not found/'
51+
- '/Class Pimcore\\Model\\DataObject\\ClassDefinition\\Data\\\CustomVersionMarshalInterface not found/'
52+
- '/Call to method markLazyKeyAsLoaded\(\) on an unknown class Pimcore\\Model\\DataObject\\LazyLoadedFieldsInterface/'
53+
- '/Call to method isLazyKeyLoaded\(\) on an unknown class Pimcore\\Model\\DataObject\\LazyLoadedFieldsInterface/'
54+
- '/Access to undefined constant PackageVersions\\Versions::VERSIONS/'
55+
56+
includes:
57+
- ./vendor/phpstan/phpstan-doctrine/extension.neon
58+
- ./vendor/phpstan/phpstan-webmozart-assert/extension.neon

src/CoreShop/Bundle/OrderBundle/Controller/OrderController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ protected function getMailCorrespondence(OrderInterface $order): array
517517
$list = [];
518518

519519
/**
520-
* @var DataObject\Concrete $order
520+
* @var DataObject\Concrete&OrderInterface $order
521521
*/
522522
$notes = $this->container->get(NoteServiceInterface::class)->getObjectNotes($order, Notes::NOTE_EMAIL);
523523

@@ -676,7 +676,7 @@ protected function prepareSaleItem(OrderItemInterface $item): array
676676
protected function getStatesHistory(OrderInterface $order): array
677677
{
678678
/**
679-
* @var DataObject\Concrete $order
679+
* @var DataObject\Concrete&OrderInterface $order
680680
*/
681681
$history = $this->container->get(WorkflowStateInfoManagerInterface::class)->getStateHistory($order);
682682

src/CoreShop/Bundle/PayumBundle/Extension/UpdatePaymentStateExtension.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ public function onPostExecute(Context $context): void
5050

5151
$previousStack = $context->getPrevious();
5252
/**
53-
* @var int
54-
*
53+
* @var int<0, max> $previousStackSize
5554
* @psalm-type int
5655
*/
5756
$previousStackSize = count($previousStack);

src/CoreShop/Bundle/StorageListBundle/DependencyInjection/CoreShopStorageListExtension.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,11 @@ public function load(array $configs, ContainerBuilder $container): void
221221
$simpleStorage = new Definition(SimpleStorageListStorage::class);
222222
$container->setDefinition('coreshop.storage_list.storage.' . $name, $simpleStorage);
223223

224-
if (interface_exists(CustomerAwareInterface::class) && interface_exists(StoreAwareInterface::class)) {
224+
if (interface_exists(CustomerAwareInterface::class) &&
225+
interface_exists(StoreAwareInterface::class) &&
226+
interface_exists(ShopperContextInterface::class) &&
227+
interface_exists(StoreContextInterface::class) &&
228+
interface_exists(CustomerContextInterface::class)) {
225229
$implements = \class_implements($list['resource']['interface']);
226230

227231
if (isset($implements[StoreAwareInterface::class], $implements[CustomerAwareInterface::class])) {

src/CoreShop/Bundle/StorageListBundle/composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,10 @@
5050
"dev-main": "5.0-dev",
5151
"dev-master": "5.0-dev"
5252
}
53+
},
54+
"config": {
55+
"allow-plugins": {
56+
"php-http/discovery": true
57+
}
5358
}
5459
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
parameters:
2+
reportUnmatchedIgnoredErrors: false
3+
4+
excludePaths:
5+
# Makes PHPStan crash
6+
- '**/DependencyInjection/Configuration.php'
7+
- '**/Migrations/Version*.php'
8+
# Ignore cause the file uses external dependencies and will only be used if those dependencies are met
9+
- '**/ProcessManager/IndexListener.php'
10+
- '**/ProcessManager/IndexProcess.php'
11+
- '**/DataHub/*.php'
12+
- 'vendor/***'
13+
- Core/EventListener/*.php (?)
14+
- Core/Context/CustomerAndStoreBasedStorageListContext.php (?)
15+
- Core/Context/SessionAndStoreBasedStorageListContext.php (?)
16+
- Core/Context/StoreBasedStorageListContext.php (?)
17+
- Core/Provider/CoreContextProvider.php (?)
18+
- Core/Storage/SessionStorageListStorage.php (?)
19+
- Core/Repository/CustomerAndStoreAwareRepositoryInterface.php (?)
20+
- DependencyInjection/CoreShopStorageListExtension.php (?)
21+
- SplPriorityQueue.php (?)
22+
- PriorityQueue.php (?)
23+
24+
ignoreErrors:
25+
# Magic calls
26+
- '/Call to an undefined static method Webmozart\\Assert\\Assert::all/'
27+
- '/Call to an undefined static method Webmozart\\Assert\\Assert::nullOr/'
28+
- '/Call to an undefined method Faker\\Generator::/'
29+
- '/Access to an undefined property Faker\\Generator::/'
30+
- '/Constant PIMCORE_CONFIGURATION_DIRECTORY not found./'
31+
- '/Constant PIMCORE_CLASS_DIRECTORY not found./'
32+
- '/Constant PIMCORE_WEB_ROOT not found./'
33+
- '/Constant PIMCORE_DEVMODE not found./'
34+
- '/Class Zend_Paginator_Adapter_Interface not found and could not be autoloaded./'
35+
36+
- '/Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition::children\(\)/'
37+
- '/Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface/'
38+
- '/Call to an undefined method Pimcore\\Model\\(.*)::save\(\)./'
39+
- '/Call to an undefined method Pimcore\\Model\\(.*)::delete\(\)./'
40+
- '/Method Pimcore\\Model\\DataObject\\Concrete::getLatestVersion\(\)\(.*\)/'
41+
- '/Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch\(\)/'
42+
- '/Method CoreShop\\Bundle\\ResourceBundle\\Routing\\ResourceLoader::getResolver\(\) should return Symfony\\Component\\Config\\Loader\\LoaderResolverInterface but return statement is missing./'
43+
- '/PHPDoc type string of property CoreShop\\Bundle\\PayumBundle\\Request\\GetStatus::\$status is not covariant with PHPDoc type int of overridden property Payum\\Core\\Request\\BaseGetStatus::\$status./'
44+
- '/Method CoreShop\\Bundle\\ResourceBundle\\Controller\\AdminController::getSubscribedServices\(\) should return non-empty-array<string|Symfony\\Contracts\\Service\\Attribute\\SubscribedService> but returns array<string>./'
45+
46+
# Pimcore BC Breaks
47+
- '/Class Pimcore\\Bundle\\AdminBundle\\Helper\\GridHelperService not found/'
48+
- '/Class Pimcore\\Model\\DataObject\\LazyLoadedFieldsInterface not found/'
49+
- '/Class Pimcore\\Model\\DataObject\\ClassDefinition\\Data\\\CustomVersionMarshalInterface not found/'
50+
- '/Call to method markLazyKeyAsLoaded\(\) on an unknown class Pimcore\\Model\\DataObject\\LazyLoadedFieldsInterface/'
51+
- '/Call to method isLazyKeyLoaded\(\) on an unknown class Pimcore\\Model\\DataObject\\LazyLoadedFieldsInterface/'
52+
- '/Access to undefined constant PackageVersions\\Versions::VERSIONS/'
53+
54+
includes:
55+
- ./vendor/phpstan/phpstan-doctrine/extension.neon
56+
- ./vendor/phpstan/phpstan-webmozart-assert/extension.neon

0 commit comments

Comments
 (0)