mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-15 09:30:58 +00:00
[CS][DX] Refactor
This commit is contained in:
parent
8c6ad41cb5
commit
d1c23790b6
2 changed files with 7 additions and 5 deletions
|
|
@ -22,10 +22,12 @@ final class DefaultProductVariantResolver implements ProductVariantResolverInter
|
|||
public function __construct(private ?ProductVariantRepositoryInterface $productVariantRepository = null)
|
||||
{
|
||||
if (null === $productVariantRepository) {
|
||||
trigger_deprecation('sylius/product', '1.12',
|
||||
trigger_deprecation(
|
||||
'sylius/product',
|
||||
'1.12',
|
||||
'Not passing a service that implements "%s" as a 1st argument of "%s" constructor is deprecated and will be prohibited in 2.0.',
|
||||
ProductVariantRepositoryInterface::class,
|
||||
self::class
|
||||
self::class,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -43,7 +45,7 @@ final class DefaultProductVariantResolver implements ProductVariantResolverInter
|
|||
'position' => 'ASC',
|
||||
'id' => 'ASC',
|
||||
],
|
||||
1
|
||||
1,
|
||||
);
|
||||
|
||||
return $productVariants[0] ?? null;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ final class DefaultProductVariantResolverSpec extends ObjectBehavior
|
|||
'position' => 'ASC',
|
||||
'id' => 'ASC',
|
||||
],
|
||||
1
|
||||
1,
|
||||
)->willReturn([$variant]);
|
||||
|
||||
$this->getVariant($product)->shouldReturn($variant);
|
||||
|
|
@ -86,7 +86,7 @@ final class DefaultProductVariantResolverSpec extends ObjectBehavior
|
|||
'position' => 'ASC',
|
||||
'id' => 'ASC',
|
||||
],
|
||||
1
|
||||
1,
|
||||
)->willReturn([]);
|
||||
|
||||
$this->getVariant($product)->shouldReturn(null);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue