Skip to content

Commit

Permalink
Merge pull request #1901 from dpfaffenbauer/issues/stan
Browse files Browse the repository at this point in the history
[Stan] fix tests
  • Loading branch information
dpfaffenbauer authored Mar 24, 2022
2 parents a95ab8f + 158c027 commit 08d451a
Show file tree
Hide file tree
Showing 25 changed files with 104 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
php: [7.2, 7.3, 7.4]
symfony: [~3.4, ^4.0]
symfony: [^4.0]
pimcore: [~6.6.0, ~6.7.0, ~6.8.0, ~6.9.0]

steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ tmp/
phpda.html
parameters.yml
var
vendor
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
"dpfaffenbauer/process-manager": "<2.4",
"pimcore/pimcore": "6.1.0 || 6.1.1 || 6.5.2",
"monolog/monolog": ">=2",
"symfony/monolog-bundle": "3.6.0"
"symfony/monolog-bundle": "3.6.0",
"symfony/symfony": "3.4.49"
},
"suggest": {
"dpfaffenbauer/process-manager": "Allows to start Processes from within Pimcore UI and also tracks the status."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public function process(ContainerBuilder $container)
if ($container->hasParameter($stackId)) {
$registry = $container->getDefinition('coreshop.registry.index.extensions');

/**
* @var array $stack
*/
$stack = $container->getParameter($stackId);

foreach ($stack as $class) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class RegisterFrontendControllerPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
/**
* @var array $controllers
*/
$controllers = $container->getParameter('coreshop.frontend.controllers');

foreach ($controllers as $key => $value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public function getConfigAction()
];
}

/**
* @var array $fieldTypes
*/
$fieldTypes = $this->getParameter('coreshop.index.mapping_types');
$fieldTypesResult = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ public function getConfigAction(Request $request)
$actions = [];
$types = [];

/**
* @var array $actionTypes
*/
$actionTypes = $this->getParameter('coreshop.notification_rule.actions.types');

/**
* @var array $conditionTypes
*/
$conditionTypes = $this->getParameter('coreshop.notification_rule.conditions.types');

foreach ($actionTypes as $type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ public function getFolderConfigurationAction()
*/
public function getStatesAction(Request $request)
{
/**
* @var array $identifiers
*/
$identifiers = $this->getParameter('coreshop.state_machines');
$states = [];
$transitions = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,20 @@ public function getDataForEditmode($data, $object = null, $params = [])
$calculationBehaviourTypes = [];
$pricingBehaviourTypes = [];

foreach ($this->getContainer()->getParameter('coreshop.product_quantity_price_rules.calculators') as $type) {
/**
* @var array $priceCalculators
*/
$priceCalculators = $this->getContainer()->getParameter('coreshop.product_quantity_price_rules.calculators');

/**
* @var array $actions
*/
$actions = $this->getContainer()->getParameter('coreshop.product_quantity_price_rules.actions');

foreach ($priceCalculators as $type) {
$calculationBehaviourTypes[] = [$type, 'coreshop_product_quantity_price_rules_calculator_' . strtolower($type)];
}
foreach ($this->getContainer()->getParameter('coreshop.product_quantity_price_rules.actions') as $type) {
foreach ($$actions as $type) {
$pricingBehaviourTypes[] = [$type, 'coreshop_product_quantity_price_rules_behaviour_' . strtolower($type)];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ public function getConfigAction()
'stack' => [],
];

if ($this->container->hasParameter('coreshop.all.pimcore_classes')) {
$classes = $this->getParameter('coreshop.all.pimcore_classes');
/**
* @var array $classes
*/
$classes = $this->container->hasParameter('coreshop.all.pimcore_classes');

if ($classes) {
foreach ($classes as $key => $definition) {
$alias = explode('.', $key);
$application = $alias[0];
Expand All @@ -63,6 +66,9 @@ public function getConfigAction()
$config['classMap'][$application][$alias] = $class;
}

/**
* @var array $stack
*/
$stack = $this->container->getParameter('coreshop.all.stack.pimcore_class_names');

foreach ($stack as $key => $impl) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ final class RegisterPimcoreResourcesPass implements CompilerPassInterface
public function process(ContainerBuilder $container)
{
try {
/**
* @var array $resources
*/
$resources = $container->getParameter('coreshop.all.pimcore_classes');
$registry = $container->findDefinition(RegistryInterface::class);
} catch (InvalidArgumentException $exception) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ final class RegisterResourcesPass implements CompilerPassInterface
public function process(ContainerBuilder $container)
{
try {
/**
* @var array $resources
*/
$resources = $container->getParameter('coreshop.resources');
$registry = $container->findDefinition(RegistryInterface::class);
} catch (InvalidArgumentException $exception) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ public function process(ContainerBuilder $container)
return;
}

/**
* @var array $classes
*/
$classes = $container->getParameter('coreshop.all.pimcore_classes');

/**
* @var array $stack
*/
$stack = $container->getParameter('coreshop.all.stack');

$classStack = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,17 @@ public function process(ContainerBuilder $container)
return;
}

/**
* @var array $stackConfig
*/
$stackConfig = $container->getParameter('coreshop.all.stack');

foreach ($container->getParameter('coreshop.all.stack.fqcns') as $alias => $classes) {
/**
* @var array $fqcns
*/
$fqcns = $container->getParameter('coreshop.all.stack.fqcns');

foreach ($fqcns as $alias => $classes) {
list($applicationName, $name) = explode('.', $alias);

$definition = new Definition(Metadata::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ protected function addPimcoreClass(ContainerBuilder $container, MetadataInterfac
$allPaths = [];

if ($container->hasParameter($parameterName)) {
/**
* @var array $allPaths
*/
$allPaths = $container->getParameter($parameterName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ public function registerStack($applicationName, $stack, ContainerBuilder $contai
$globalParameterName = 'coreshop.all.stack';

foreach ([$appParameterName, $globalParameterName] as $parameterName) {
/**
* @var array $stackConfig
*/
$stackConfig = $container->hasParameter($parameterName) ? $container->getParameter($parameterName) : [];

foreach ($stack as $key => $interface) {
Expand Down Expand Up @@ -144,10 +147,16 @@ protected function registerPimcoreResources($applicationName, $bundleResources,
$globalPermissions = [];

if ($container->hasParameter($applicationParameter)) {
/**
* @var array $applicationPermissions
*/
$applicationPermissions = $container->getParameter($applicationParameter);
}

if ($container->hasParameter($globalParameter)) {
/**
* @var array $globalPermissions
*/
$globalPermissions = $container->getParameter($globalParameter);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public function installResources(OutputInterface $output, $applicationName = nul
$parameter = $this->getIdentifier($applicationName);

if ($this->kernel->getContainer()->hasParameter($parameter)) {
/**
* @var array $translationFilesToInstall
*/
$translationFilesToInstall = $this->kernel->getContainer()->getParameter($parameter);
$translationsToInstall = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ public function installResources(OutputInterface $output, $applicationName = nul
$parameter = $applicationName ? sprintf('%s.pimcore_classes', $applicationName) : 'coreshop.all.pimcore_classes';

if ($this->kernel->getContainer()->hasParameter($parameter)) {
/**
* @var array $pimcoreClasses
*/
$pimcoreClasses = $this->kernel->getContainer()->getParameter($parameter);
$fieldCollections = [];
$bricks = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public function installResources(OutputInterface $output, $applicationName = nul
) : 'coreshop.all.pimcore.admin.install.documents';

if ($this->kernel->getContainer()->hasParameter($parameter)) {
/**
* @var array $documentFilesToInstall
*/
$documentFilesToInstall = $this->kernel->getContainer()->getParameter($parameter);
$docsToInstall = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public function installResources(OutputInterface $output, $applicationName = nul
$parameter = $applicationName ? sprintf('%s.pimcore.admin.install.grid_config', $applicationName) : 'coreshop.all.pimcore.admin.install.grid_config';

if ($this->kernel->getContainer()->hasParameter($parameter)) {
/**
* @var array $routeFilesToInstall
*/
$routeFilesToInstall = $this->kernel->getContainer()->getParameter($parameter);
$gridConfigsToInstall = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public function installResources(OutputInterface $output, $applicationName = nul
$parameter = $applicationName ? sprintf('%s.pimcore.admin.install.image_thumbnails', $applicationName) : 'coreshop.all.pimcore.admin.install.image_thumbnails';

if ($this->kernel->getContainer()->hasParameter($parameter)) {
/**
* @var array $thumbnailFilesToInstall
*/
$thumbnailFilesToInstall = $this->kernel->getContainer()->getParameter($parameter);
$thumbnailsToInstall = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public function installResources(OutputInterface $output, $applicationName = nul
$parameter = $applicationName ? sprintf('%s.permissions', $applicationName) : 'coreshop.all.permissions';

if ($this->kernel->getContainer()->hasParameter($parameter)) {
/**
* @var array $permissionGroups
*/
$permissionGroups = $this->kernel->getContainer()->getParameter($parameter);

if ($parameter !== 'coreshop.all.permissions') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public function installResources(OutputInterface $output, $applicationName = nul
$parameter = $applicationName ? sprintf('%s.pimcore.admin.install.routes', $applicationName) : 'coreshop.all.pimcore.admin.install.routes';

if ($this->kernel->getContainer()->hasParameter($parameter)) {
/**
* @var array $routeFilesToInstall
*/
$routeFilesToInstall = $this->kernel->getContainer()->getParameter($parameter);
$routesToInstall = [];

Expand Down
3 changes: 3 additions & 0 deletions src/CoreShop/Bundle/ResourceBundle/Installer/SqlInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public function installResources(OutputInterface $output, $applicationName = nul
$parameter = $applicationName ? sprintf('%s.pimcore.admin.install.sql', $applicationName) : 'coreshop.all.pimcore.admin.install.sql';

if ($this->kernel->getContainer()->hasParameter($parameter)) {
/**
* @var array $sqlFilesToExecute
*/
$sqlFilesToExecute = $this->kernel->getContainer()->getParameter($parameter);

$progress = new ProgressBar($output);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class CarrierController extends ResourceController
{
public function getConfigAction()
{
/**
* @var array $strategies
*/
$strategies = $this->getParameter('coreshop.shipping.tax_calculation_strategies');

$convertedStrategies = [];
Expand Down

0 comments on commit 08d451a

Please sign in to comment.