mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
[Maintenance] Bump psalm, fix naming issues and build
This commit is contained in:
parent
996666c12f
commit
1d6f4dc9a2
10 changed files with 27 additions and 18 deletions
|
|
@ -147,7 +147,7 @@
|
|||
"symfony/dotenv": "^4.4",
|
||||
"symfony/flex": "^1.7",
|
||||
"symfony/web-profiler-bundle": "^4.4",
|
||||
"vimeo/psalm": "3.11.6"
|
||||
"vimeo/psalm": "^3.11.6"
|
||||
},
|
||||
"replace": {
|
||||
"sylius/addressing": "self.version",
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ The new rule needs a RuleChecker class:
|
|||
{
|
||||
public const TYPE = 'total_volume_less_than_or_equal';
|
||||
|
||||
public function isEligible(ShippingSubjectInterface $subject, array $configuration): bool
|
||||
public function isEligible(ShippingSubjectInterface $shippingSubject, array $configuration): bool
|
||||
{
|
||||
return $subject->getShippingVolume() <= $configuration['volume'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
|||
/** @experimental */
|
||||
final class SyliusApiExtension extends Extension
|
||||
{
|
||||
public function load(array $config, ContainerBuilder $container): void
|
||||
public function load(array $configs, ContainerBuilder $container): void
|
||||
{
|
||||
$config = $this->processConfiguration($this->getConfiguration([], $container), $config);
|
||||
$config = $this->processConfiguration($this->getConfiguration([], $container), $configs);
|
||||
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
|
||||
|
||||
$loader->load('services.xml');
|
||||
|
|
|
|||
|
|
@ -35,14 +35,14 @@ final class OrderProductEligibilityValidator extends ConstraintValidator
|
|||
/**
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function validate($command, Constraint $constraint): void
|
||||
public function validate($value, Constraint $constraint): void
|
||||
{
|
||||
Assert::isInstanceOf($command, OrderTokenValueAwareInterface::class);
|
||||
Assert::isInstanceOf($value, OrderTokenValueAwareInterface::class);
|
||||
|
||||
/** @var OrderProductEligibility $constraint */
|
||||
Assert::isInstanceOf($constraint, OrderProductEligibility::class);
|
||||
|
||||
$order = $this->orderRepository->findOneBy(['tokenValue' => $command->getOrderTokenValue()]);
|
||||
$order = $this->orderRepository->findOneBy(['tokenValue' => $value->getOrderTokenValue()]);
|
||||
|
||||
/** @var OrderInterface $order */
|
||||
Assert::isInstanceOf($order, OrderInterface::class);
|
||||
|
|
|
|||
|
|
@ -18,14 +18,14 @@ use Sylius\Component\Shipping\Model\ShippingSubjectInterface;
|
|||
|
||||
final class CategoryRequirementEligibilityChecker implements ShippingMethodEligibilityCheckerInterface
|
||||
{
|
||||
public function isEligible(ShippingSubjectInterface $subject, ShippingMethodInterface $shippingMethod): bool
|
||||
public function isEligible(ShippingSubjectInterface $shippingSubject, ShippingMethodInterface $shippingMethod): bool
|
||||
{
|
||||
if (!$category = $shippingMethod->getCategory()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$numMatches = $numShippables = 0;
|
||||
foreach ($subject->getShippables() as $shippable) {
|
||||
foreach ($shippingSubject->getShippables() as $shippable) {
|
||||
++$numShippables;
|
||||
if ($category === $shippable->getShippingCategory()) {
|
||||
++$numMatches;
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@ final class CompositeShippingMethodEligibilityChecker implements ShippingMethodE
|
|||
$this->eligibilityCheckers = $eligibilityCheckers;
|
||||
}
|
||||
|
||||
public function isEligible(ShippingSubjectInterface $subject, ShippingMethodInterface $shippingMethod): bool
|
||||
public function isEligible(ShippingSubjectInterface $shippingSubject, ShippingMethodInterface $shippingMethod): bool
|
||||
{
|
||||
foreach ($this->eligibilityCheckers as $eligibilityChecker) {
|
||||
if (!$eligibilityChecker->isEligible($subject, $shippingMethod)) {
|
||||
if (!$eligibilityChecker->isEligible($shippingSubject, $shippingMethod)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,14 +29,14 @@ final class ShippingMethodRulesEligibilityChecker implements ShippingMethodEligi
|
|||
$this->ruleRegistry = $ruleRegistry;
|
||||
}
|
||||
|
||||
public function isEligible(ShippingSubjectInterface $subject, ShippingMethodInterface $shippingMethod): bool
|
||||
public function isEligible(ShippingSubjectInterface $shippingSubject, ShippingMethodInterface $shippingMethod): bool
|
||||
{
|
||||
if (!$shippingMethod->hasRules()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach ($shippingMethod->getRules() as $rule) {
|
||||
if (!$this->isEligibleToRule($subject, $rule)) {
|
||||
if (!$this->isEligibleToRule($shippingSubject, $rule)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,21 +26,21 @@ use Sylius\Component\Shipping\Model\ShippingSubjectInterface;
|
|||
*/
|
||||
final class ShippingMethodEligibilityChecker implements ShippingMethodEligibilityCheckerInterface
|
||||
{
|
||||
public function isEligible(ShippingSubjectInterface $subject, ShippingMethodInterface $method): bool
|
||||
public function isEligible(ShippingSubjectInterface $shippingSubject, ShippingMethodInterface $shippingMethod): bool
|
||||
{
|
||||
if (!$category = $method->getCategory()) {
|
||||
if (!$category = $shippingMethod->getCategory()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$numMatches = $numShippables = 0;
|
||||
foreach ($subject->getShippables() as $shippable) {
|
||||
foreach ($shippingSubject->getShippables() as $shippable) {
|
||||
++$numShippables;
|
||||
if ($category === $shippable->getShippingCategory()) {
|
||||
++$numMatches;
|
||||
}
|
||||
}
|
||||
|
||||
switch ($method->getCategoryRequirement()) {
|
||||
switch ($shippingMethod->getCategoryRequirement()) {
|
||||
case ShippingMethodInterface::CATEGORY_REQUIREMENT_MATCH_NONE:
|
||||
return 0 === $numMatches;
|
||||
case ShippingMethodInterface::CATEGORY_REQUIREMENT_MATCH_ANY:
|
||||
|
|
|
|||
|
|
@ -27,5 +27,5 @@ use Sylius\Component\Shipping\Model\ShippingSubjectInterface;
|
|||
*/
|
||||
interface ShippingMethodEligibilityCheckerInterface extends NewShippingMethodEligibilityCheckerInterface
|
||||
{
|
||||
public function isEligible(ShippingSubjectInterface $subject, ShippingMethodInterface $method): bool;
|
||||
public function isEligible(ShippingSubjectInterface $shippingSubject, ShippingMethodInterface $shippingMethod): bool;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,9 @@
|
|||
"dmore/chrome-mink-driver": {
|
||||
"version": "2.7.0"
|
||||
},
|
||||
"dnoegel/php-xdg-base-dir": {
|
||||
"version": "v0.1.1"
|
||||
},
|
||||
"doctrine/annotations": {
|
||||
"version": "1.0",
|
||||
"recipe": {
|
||||
|
|
@ -786,6 +789,9 @@
|
|||
"ref": "87c585d24de9f43bca80ebcfd5cf5cb39445d95f"
|
||||
}
|
||||
},
|
||||
"symfony/http-client-contracts": {
|
||||
"version": "v2.3.1"
|
||||
},
|
||||
"symfony/http-foundation": {
|
||||
"version": "v4.1.3"
|
||||
},
|
||||
|
|
@ -1051,6 +1057,9 @@
|
|||
"symplify/smart-file-system": {
|
||||
"version": "8.2.21"
|
||||
},
|
||||
"symplify/symplify-kernel": {
|
||||
"version": "8.3.48"
|
||||
},
|
||||
"textalk/websocket": {
|
||||
"version": "1.2.0"
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue