Skip to content

Commit

Permalink
Merge pull request #2283 from coreshop/coding-standard/refactor-3.0
Browse files Browse the repository at this point in the history
[CS] Refactor
  • Loading branch information
dpfaffenbauer committed May 19, 2023
2 parents 8980417 + 1832d87 commit 8cf0136
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public function supports($request): bool
{
return
$request instanceof Capture &&
$request->getModel() instanceof \ArrayAccess
;
$request->getModel() instanceof \ArrayAccess;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public function supports($request): bool
return
$request instanceof Convert &&
$request->getSource() instanceof PaymentInterface &&
$request->getTo() === 'array'
;
$request->getTo() === 'array';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public function supports($request): bool
{
return
$request instanceof Notify &&
$request->getModel() instanceof \ArrayAccess
;
$request->getModel() instanceof \ArrayAccess;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public function supports($request): bool
{
return
$request instanceof GetStatusInterface &&
$request->getModel() instanceof \ArrayAccess
;
$request->getModel() instanceof \ArrayAccess;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
->add('quantity', IntegerType::class, [
'attr' => ['min' => 1],
'label' => 'coreshop.ui.quantity',
])->setDataMapper($this->dataMapper);
])->setDataMapper($this->dataMapper)
;

if ($options['allow_custom_price']) {
$builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public function supports($request): bool
{
return
$request instanceof Capture &&
$request->getModel() instanceof CoreShopPaymentInterface
;
$request->getModel() instanceof CoreShopPaymentInterface;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ public function supports($request): bool
return
$request instanceof Convert &&
$request->getSource() instanceof PaymentInterface &&
$request->getTo() === 'array'
;
$request->getTo() === 'array';
}

private function formatPrice(int $price): float
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public function installResources(OutputInterface $output, string $applicationNam
{
$parameter = $applicationName ?
sprintf('%s.dependant.bundles', $applicationName) :
'coreshop.all.dependant.bundles'
;
'coreshop.all.dependant.bundles';

if ($this->kernel->getContainer()->hasParameter($parameter)) {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
use CoreShop\Bundle\StorageListBundle\EventListener\SessionSubscriber;
use CoreShop\Component\Customer\Model\CustomerAwareInterface;
use CoreShop\Component\StorageList\Context\CompositeStorageListContext;
use CoreShop\Component\StorageList\Context\SessionBasedListContext;
use CoreShop\Component\StorageList\Context\StorageListContextInterface;
use CoreShop\Component\StorageList\Context\StorageListFactoryContext;
use CoreShop\Component\StorageList\Core\Context\CustomerAndStoreBasedStorageListContext;
use CoreShop\Component\StorageList\Core\Context\SessionAndStoreBasedStorageListContext;
use CoreShop\Component\StorageList\Context\SessionBasedListContext;
use CoreShop\Component\StorageList\Core\Context\StoreBasedStorageListContext;
use CoreShop\Component\StorageList\StorageListsManager;
use CoreShop\Component\Store\Model\StoreAwareInterface;
Expand Down Expand Up @@ -223,14 +223,14 @@ public function load(array $configs, ContainerBuilder $container): void
);
$sessionContext->setArgument(
'$inner',
new Reference('coreshop.storage_list.context.' . $name .'.session.inner'),
new Reference('coreshop.storage_list.context.' . $name . '.session.inner'),
);
$sessionContext->setArgument('$requestStack', new Reference('request_stack'));
$sessionContext->setArgument('$sessionKeyName', $list['session']['key']);
$sessionContext->setArgument('$repository', new Reference($list['resource']['repository']));
$sessionContext->setDecoratedService('coreshop.storage_list.context.factory.' . $name);

$container->setDefinition('coreshop.storage_list.context.' . $name .'.session', $sessionContext);
$container->setDefinition('coreshop.storage_list.context.' . $name . '.session', $sessionContext);
}

$tags[] = [
Expand Down

0 comments on commit 8cf0136

Please sign in to comment.