mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
[Maintenance] Fix static analysis
This commit is contained in:
parent
c4c7c568e8
commit
09c8a8bba2
164 changed files with 482 additions and 147 deletions
|
|
@ -182,7 +182,7 @@ To ease the update process, we have grouped the changes into the following categ
|
|||
|
||||
`Sylius\Bundle\CoreBundle\Fixture\Factory\PromotionExampleFactory`
|
||||
```diff
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Sylius\Component\Resource\Repository\RepositoryInterface;
|
||||
|
||||
public function __construct(
|
||||
FactoryInterface $promotionFactory,
|
||||
|
|
@ -285,7 +285,7 @@ To ease the update process, we have grouped the changes into the following categ
|
|||
`Sylius\Component\Addressing\Matcher\ZoneMatcher`
|
||||
```diff
|
||||
use Sylius\Component\Addressing\Repository\ZoneRepositoryInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Sylius\Component\Resource\Repository\RepositoryInterface;
|
||||
|
||||
public function __construct(
|
||||
- private RepositoryInterface $zoneRepository,
|
||||
|
|
|
|||
|
|
@ -34,35 +34,6 @@ parameters:
|
|||
# To investigate, occurs after release of doctrine/orm 2.14, the processing of these classes ends with exit code 143
|
||||
- 'src/Sylius/Bundle/CoreBundle/Doctrine/DQL/**.php'
|
||||
- 'src/Sylius/Bundle/CoreBundle/Doctrine/ORM/SqlWalker/**.php'
|
||||
|
||||
# To support both sylius/resource-bundle 1.11 and older versions
|
||||
- 'src/Sylius/Bundle/AdminBundle/Controller/RedirectHandler.php'
|
||||
- 'src/Sylius/Bundle/ApiBundle/OpenApi/Documentation/AcceptLanguageHeaderDocumentationModifier.php'
|
||||
- 'src/Sylius/Bundle/CoreBundle/Doctrine/ORM/Handler/ResourceDeleteHandler.php'
|
||||
- 'src/Sylius/Bundle/CoreBundle/Doctrine/ORM/Handler/ResourceUpdateHandler.php'
|
||||
- 'src/Sylius/Bundle/CoreBundle/Fixture/Factory/PromotionExampleFactory.php'
|
||||
- 'src/Sylius/Bundle/CoreBundle/Resource/StateMachine/Controller/CompositeStateMachine.php'
|
||||
- 'src/Sylius/Bundle/CoreBundle/Validator/Constraints/ChannelCodeCollectionValidator.php'
|
||||
- 'src/Sylius/Bundle/CoreBundle/Validator/Constraints/CountryCodeExistsValidator.php'
|
||||
- 'src/Sylius/Bundle/CoreBundle/Validator/Constraints/ResendOrderConfirmationEmailWithValidOrderStateValidator.php'
|
||||
- 'src/Sylius/Bundle/CoreBundle/Validator/Constraints/ResendShipmentConfirmationEmailWithValidShipmentStateValidator.php'
|
||||
- 'src/Sylius/Bundle/PromotionBundle/Form/Type/PromotionCouponToCodeType.php'
|
||||
- 'src/Sylius/Bundle/TaxonomyBundle/Controller/TaxonSlugController.php'
|
||||
- 'src/Sylius/Bundle/UserBundle/Factory/UserWithEncoderFactory.php'
|
||||
- 'src/Sylius/Component/Addressing/Matcher/ZoneMatcher.php'
|
||||
- 'src/Sylius/Component/Core/Customer/Statistics/CustomerStatisticsProvider.php'
|
||||
- 'src/Sylius/Component/Core/Factory/ChannelFactory.php'
|
||||
- 'src/Sylius/Component/Core/Factory/PaymentMethodFactory.php'
|
||||
- 'src/Sylius/Component/Core/Factory/PromotionActionFactory.php'
|
||||
- 'src/Sylius/Component/Core/Promotion/Checker/ProductInPromotionRuleChecker.php'
|
||||
- 'src/Sylius/Component/Core/Promotion/Checker/TaxonInPromotionRuleChecker.php'
|
||||
- 'src/Sylius/Component/Core/Provider/TranslationLocaleProvider.php'
|
||||
- 'src/Sylius/Component/Core/Test/Tests/Taxation/Applicator/OrderItemUnitsTaxesApplicatorTest.php'
|
||||
- 'src/Sylius/Component/Core/Test/Tests/Taxation/Applicator/OrderItemsTaxesApplicatorTest.php'
|
||||
- 'src/Sylius/Component/Core/Translation/TranslatableEntityLocaleAssigner.php'
|
||||
- 'src/Sylius/Component/Locale/Provider/LocaleCollectionProvider.php'
|
||||
- 'src/Sylius/Component/Locale/Provider/LocaleProvider.php'
|
||||
|
||||
ignoreErrors:
|
||||
- '/(Interface|Class) [a-zA-Z\\]+ specifies template type (\w+) of interface [a-zA-Z\\]+ as [a-zA-Z\\]+ (of [a-zA-Z\\]+ )?but it''s already specified as/' # turns off a weird generics check behavior, we are basing on Psalm for generics checks
|
||||
- '/Access to an undefined property Doctrine\\Common\\Collections\\ArrayCollection/'
|
||||
|
|
@ -74,12 +45,4 @@ parameters:
|
|||
- '/Method Sylius\\Component\\(\w+)\\Model\\(\w+)\:\:getId\(\) has no return type specified./'
|
||||
- '/Method [a-zA-z\\]+Filter\:\:filterProperty\(\) has parameter \$value with no type specified./'
|
||||
- '/Method [a-zA-z\\]+Persister\:\:(persist|remove|supports)\(\) has parameter \$data with no type specified./'
|
||||
|
||||
# To support both sylius/resource-bundle 1.11 and older versions
|
||||
- '/Call to an undefined method Sylius\\Resource\\Model\\ResourceInterface::\w+\(\)\./'
|
||||
- '/Method Sylius\\Component\\Payment\\Resolver\\PaymentMethodsResolver::getSupportedMethods\(\) should return array<Sylius\\Component\\Payment\\Model\\PaymentMethodInterface> but returns array<int, Sylius\\Resource\\Model\\ResourceInterface>\./'
|
||||
- '/Method Sylius\\Component\\Taxation\\Resolver\\TaxRateResolver::resolve\(\) should return Sylius\\Component\\Taxation\\Model\\TaxRateInterface\|null but returns Sylius\\Resource\\Model\\ResourceInterface\|null\./'
|
||||
- '/Parameter #\d+ \$(\w+) \(Sylius\\Component\\\w+\\Model\\\w+(\|null)?\) of method Sylius\\Bundle\\\w+\\Controller\\\w+::\w+\(\) is not contravariant with parameter #\d+ \$(\w+) \(Sylius\\Resource\\Model\\\w+(\|null)?\) of method Sylius\\Bundle\\\w+\\Controller\\\w+\::\w+\(\)\./'
|
||||
- '/PHPDoc tag @extends contains generic type Sylius\\Component\\Resource\\\w+\\\w+<Sylius\\Component\\\w+\\Model\\\w+> but interface Sylius\\Component\\Resource\\\w+\\\w+ is not generic\./'
|
||||
- '/PHPDoc tag @param for parameter \$(\w+) contains generic type Sylius\\Component\\Resource\\\w+\\\w+<Sylius\\Component\\\w+\\Model\\\w+> but interface Sylius\\Component\\Resource\\\w+\\\w+ is not generic\./'
|
||||
- '/PHPDoc type for property Sylius\\Bundle\\\w+\\\w+\\\w+::\$(\w+) contains generic type Sylius\\Component\\Resource\\\w+\\\w+<Sylius\\Component\\\w+\\Model\\\w+> but interface Sylius\\Component\\Resource\\\w+\\\w+ is not generic\./'
|
||||
- '/Method Sylius\\Bundle\\CoreBundle\\Fixture\\OptionsResolver\\LazyOption\:\:(\w+)\(\) has parameter \$repository with generic interface Sylius\\Resource\\Doctrine\\Persistence\\RepositoryInterface but does not specify its types\: T/'
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ use Sylius\Component\Addressing\Model\Zone;
|
|||
use Sylius\Component\Addressing\Model\ZoneInterface;
|
||||
use Sylius\Component\Addressing\Model\ZoneMember;
|
||||
use Sylius\Component\Addressing\Model\ZoneMemberInterface;
|
||||
use Sylius\Component\Resource\Factory\Factory;
|
||||
use Sylius\Resource\Factory\Factory;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
final class CountryChoiceType extends AbstractType
|
||||
{
|
||||
/** @param RepositoryInterface<CountryInterface> $countryRepository */
|
||||
public function __construct(private RepositoryInterface $countryRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
|||
namespace Sylius\Bundle\AddressingBundle\Form\Type;
|
||||
|
||||
use Sylius\Bundle\ResourceBundle\Form\DataTransformer\ResourceToIdentifierTransformer;
|
||||
use Sylius\Component\Addressing\Model\CountryInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
|
@ -21,6 +22,7 @@ use Symfony\Component\Form\ReversedTransformer;
|
|||
|
||||
final class CountryCodeChoiceType extends AbstractType
|
||||
{
|
||||
/** @param RepositoryInterface<CountryInterface> $countryRepository */
|
||||
public function __construct(private RepositoryInterface $countryRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
|||
namespace Sylius\Bundle\AddressingBundle\Form\Type;
|
||||
|
||||
use Sylius\Component\Addressing\Model\CountryInterface;
|
||||
use Sylius\Component\Addressing\Model\ProvinceInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
|
|
@ -22,6 +23,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
final class ProvinceChoiceType extends AbstractType
|
||||
{
|
||||
/** @param RepositoryInterface<ProvinceInterface> $provinceRepository */
|
||||
public function __construct(private RepositoryInterface $provinceRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
|||
namespace Sylius\Bundle\AddressingBundle\Form\Type;
|
||||
|
||||
use Sylius\Bundle\ResourceBundle\Form\DataTransformer\ResourceToIdentifierTransformer;
|
||||
use Sylius\Component\Addressing\Model\ProvinceInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
|
@ -21,6 +22,7 @@ use Symfony\Component\Form\ReversedTransformer;
|
|||
|
||||
final class ProvinceCodeChoiceType extends AbstractType
|
||||
{
|
||||
/** @param RepositoryInterface<ProvinceInterface> $provinceRepository */
|
||||
public function __construct(private RepositoryInterface $provinceRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
|||
namespace Sylius\Bundle\AddressingBundle\Form\Type;
|
||||
|
||||
use Sylius\Component\Addressing\Model\Scope as AddressingScope;
|
||||
use Sylius\Component\Addressing\Model\ZoneInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
|
|
@ -22,6 +23,10 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
final class ZoneChoiceType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* @param RepositoryInterface<ZoneInterface> $zoneRepository
|
||||
* @param array<string, mixed> $scopeTypes
|
||||
*/
|
||||
public function __construct(private RepositoryInterface $zoneRepository, private array $scopeTypes = [])
|
||||
{
|
||||
if (count($scopeTypes) === 0) {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
|||
namespace Sylius\Bundle\AddressingBundle\Form\Type;
|
||||
|
||||
use Sylius\Bundle\ResourceBundle\Form\DataTransformer\ResourceToIdentifierTransformer;
|
||||
use Sylius\Component\Addressing\Model\ZoneInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
|
|
@ -24,6 +25,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
final class ZoneCodeChoiceType extends AbstractType
|
||||
{
|
||||
/** @param RepositoryInterface<ZoneInterface> $zoneRepository */
|
||||
public function __construct(private RepositoryInterface $zoneRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,10 @@ use Webmozart\Assert\Assert;
|
|||
|
||||
class ProvinceAddressConstraintValidator extends ConstraintValidator
|
||||
{
|
||||
/**
|
||||
* @param RepositoryInterface<CountryInterface> $countryRepository
|
||||
* @param RepositoryInterface<ProvinceInterface> $provinceRepository
|
||||
*/
|
||||
public function __construct(private RepositoryInterface $countryRepository, private RepositoryInterface $provinceRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ use Twig\Environment;
|
|||
|
||||
final class CustomerStatisticsController
|
||||
{
|
||||
/** @param RepositoryInterface<CustomerInterface> $customerRepository */
|
||||
public function __construct(
|
||||
private CustomerStatisticsProviderInterface $statisticsProvider,
|
||||
private RepositoryInterface $customerRepository,
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ use Symfony\Component\Messenger\Stamp\DispatchAfterCurrentBusStamp;
|
|||
|
||||
final class RegisterShopUserHandler implements MessageHandlerInterface
|
||||
{
|
||||
/** @param FactoryInterface<ShopUserInterface> $shopUserFactory */
|
||||
public function __construct(
|
||||
private FactoryInterface $shopUserFactory,
|
||||
private ObjectManager $shopUserManager,
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ use Symfony\Component\Messenger\Stamp\DispatchAfterCurrentBusStamp;
|
|||
|
||||
final class VerifyCustomerAccountHandler implements MessageHandlerInterface
|
||||
{
|
||||
/** @param RepositoryInterface<ShopUserInterface> $shopUserRepository */
|
||||
public function __construct(
|
||||
private RepositoryInterface $shopUserRepository,
|
||||
private DateTimeProviderInterface $calendar,
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ namespace Sylius\Bundle\ApiBundle\CommandHandler\Catalog;
|
|||
use Sylius\Bundle\ApiBundle\Command\Catalog\AddProductReview;
|
||||
use Sylius\Bundle\ApiBundle\Exception\ProductNotFoundException;
|
||||
use Sylius\Bundle\CoreBundle\Resolver\CustomerResolverInterface;
|
||||
use Sylius\Component\Core\Model\CustomerInterface;
|
||||
use Sylius\Component\Core\Model\ProductInterface;
|
||||
use Sylius\Component\Core\Model\ProductReviewInterface;
|
||||
use Sylius\Component\Core\Repository\ProductRepositoryInterface;
|
||||
use Sylius\Resource\Factory\FactoryInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
|
|
@ -27,6 +27,10 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
|||
|
||||
final class AddProductReviewHandler implements MessageHandlerInterface
|
||||
{
|
||||
/**
|
||||
* @param FactoryInterface<ProductReviewInterface> $productReviewFactory
|
||||
* @param RepositoryInterface<ProductReviewInterface> $productReviewRepository
|
||||
*/
|
||||
public function __construct(
|
||||
private FactoryInterface $productReviewFactory,
|
||||
private RepositoryInterface $productReviewRepository,
|
||||
|
|
@ -51,7 +55,6 @@ final class AddProductReviewHandler implements MessageHandlerInterface
|
|||
throw new \InvalidArgumentException('Visitor should provide an email');
|
||||
}
|
||||
|
||||
/** @var CustomerInterface $customer */
|
||||
$customer = $this->customerResolver->resolve($email);
|
||||
|
||||
/** @var ReviewInterface $review */
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ use Webmozart\Assert\Assert;
|
|||
|
||||
final class UploadAvatarImageAction
|
||||
{
|
||||
/** @param FactoryInterface<ImageInterface> $avatarImageFactory */
|
||||
public function __construct(
|
||||
private FactoryInterface $avatarImageFactory,
|
||||
private AvatarImageRepositoryInterface $avatarImageRepository,
|
||||
|
|
|
|||
|
|
@ -21,9 +21,7 @@ use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
|||
|
||||
final class AcceptLanguageHeaderDocumentationModifier implements DocumentationModifierInterface
|
||||
{
|
||||
/**
|
||||
* @param RepositoryInterface<LocaleInterface> $localeRepository
|
||||
*/
|
||||
/** @param RepositoryInterface<LocaleInterface> $localeRepository */
|
||||
public function __construct(private RepositoryInterface $localeRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ final class ChannelPriceHistoryConfigDenormalizer implements ContextAwareDenorma
|
|||
|
||||
private const ALREADY_CALLED = 'sylius_channel_price_history_config_denormalizer_already_called';
|
||||
|
||||
/**
|
||||
* @param FactoryInterface<ChannelPriceHistoryConfigInterface> $channelPriceHistoryConfigFactory
|
||||
* @param array<string, string> $validationGroups
|
||||
*/
|
||||
public function __construct(
|
||||
private IriConverterInterface $iriConverter,
|
||||
private FactoryInterface $channelPriceHistoryConfigFactory,
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
|||
namespace Sylius\Bundle\ApiBundle\Validator\Constraints;
|
||||
|
||||
use Sylius\Bundle\ApiBundle\Command\Account\VerifyCustomerAccount;
|
||||
use Sylius\Component\Core\Model\ShopUserInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Sylius\Component\User\Model\UserInterface;
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
|
|
@ -22,6 +23,7 @@ use Webmozart\Assert\Assert;
|
|||
|
||||
final class AccountVerificationTokenEligibilityValidator extends ConstraintValidator
|
||||
{
|
||||
/** @param RepositoryInterface<ShopUserInterface> $shopUserRepository */
|
||||
public function __construct(private RepositoryInterface $shopUserRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ use Webmozart\Assert\Assert;
|
|||
|
||||
final class CorrectOrderAddressValidator extends ConstraintValidator
|
||||
{
|
||||
/** @param RepositoryInterface<CountryInterface> $countryRepository */
|
||||
public function __construct(private RepositoryInterface $countryRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ use Sylius\Component\Attribute\Model\Attribute;
|
|||
use Sylius\Component\Attribute\Model\AttributeInterface;
|
||||
use Sylius\Component\Attribute\Model\AttributeTranslation;
|
||||
use Sylius\Component\Attribute\Model\AttributeTranslationInterface;
|
||||
use Sylius\Component\Resource\Factory\Factory;
|
||||
use Sylius\Component\Resource\Factory\TranslatableFactory;
|
||||
use Sylius\Resource\Factory\Factory;
|
||||
use Sylius\Resource\Factory\TranslatableFactory;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Sylius\Bundle\AttributeBundle\Form\Type;
|
||||
|
||||
use Sylius\Component\Attribute\Model\AttributeInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Bridge\Doctrine\Form\DataTransformer\CollectionToArrayTransformer;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
|
|
@ -22,6 +23,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
abstract class AttributeChoiceType extends AbstractType
|
||||
{
|
||||
/** @param RepositoryInterface<AttributeInterface> $attributeRepository */
|
||||
public function __construct(protected RepositoryInterface $attributeRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ abstract class AttributeValueType extends AbstractResourceType
|
|||
{
|
||||
/**
|
||||
* @param DataTransformerInterface<LocaleInterface, string|null>|null $localeToCodeTransformer
|
||||
* @param RepositoryInterface<AttributeInterface> $attributeRepository
|
||||
* @param RepositoryInterface<LocaleInterface> $localeRepository
|
||||
*/
|
||||
public function __construct(
|
||||
string $dataClass,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use Sylius\Bundle\ResourceBundle\Controller\ResourceController;
|
|||
use Sylius\Bundle\ResourceBundle\SyliusResourceBundle;
|
||||
use Sylius\Component\Channel\Model\Channel;
|
||||
use Sylius\Component\Channel\Model\ChannelInterface;
|
||||
use Sylius\Component\Resource\Factory\Factory;
|
||||
use Sylius\Resource\Factory\Factory;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Sylius\Bundle\ChannelBundle\Form\Type;
|
||||
|
||||
use Sylius\Component\Core\Model\ChannelInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Bridge\Doctrine\Form\DataTransformer\CollectionToArrayTransformer;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
|
|
@ -23,6 +24,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
final class ChannelChoiceType extends AbstractType
|
||||
{
|
||||
/** @param RepositoryInterface<ChannelInterface> $channelRepository */
|
||||
public function __construct(private RepositoryInterface $channelRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
|||
|
||||
final class UpdateCatalogPromotionStateHandler
|
||||
{
|
||||
/** @param RepositoryInterface<CatalogPromotionInterface> $catalogPromotionRepository */
|
||||
public function __construct(
|
||||
private CatalogPromotionStateProcessorInterface $catalogPromotionStateProcessor,
|
||||
private RepositoryInterface $catalogPromotionRepository,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ use Symfony\Component\Messenger\MessageBusInterface;
|
|||
|
||||
final class CatalogPromotionCreatedListener
|
||||
{
|
||||
/** @param RepositoryInterface<CatalogPromotionInterface> $catalogPromotionRepository */
|
||||
public function __construct(
|
||||
private AllProductVariantsCatalogPromotionsProcessorInterface $allProductVariantsCatalogPromotionsProcessor,
|
||||
private RepositoryInterface $catalogPromotionRepository,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ use Symfony\Component\Messenger\MessageBusInterface;
|
|||
|
||||
final class CatalogPromotionEndedListener
|
||||
{
|
||||
/** @param RepositoryInterface<CatalogPromotionInterface> $catalogPromotionRepository */
|
||||
public function __construct(
|
||||
private AllProductVariantsCatalogPromotionsProcessorInterface $allProductVariantsCatalogPromotionsProcessor,
|
||||
private RepositoryInterface $catalogPromotionRepository,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ use Symfony\Component\Messenger\MessageBusInterface;
|
|||
|
||||
final class CatalogPromotionUpdatedListener
|
||||
{
|
||||
/** @param RepositoryInterface<CatalogPromotionInterface> $catalogPromotionRepository */
|
||||
public function __construct(
|
||||
private AllProductVariantsCatalogPromotionsProcessorInterface $allProductVariantsCatalogPromotionsProcessor,
|
||||
private RepositoryInterface $catalogPromotionRepository,
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class ProductTaxonController extends ResourceController
|
|||
{
|
||||
$firstProductTaxonId = array_keys($productTaxonsPositions)[0];
|
||||
|
||||
/** @var EntityRepository&RepositoryInterface $repository */
|
||||
/** @var EntityRepository&RepositoryInterface<ProductTaxonInterface> $repository */
|
||||
$repository = $this->repository;
|
||||
|
||||
/** @var ProductTaxonInterface $productTaxon */
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ use Sylius\Component\Core\Model\ShopBillingData;
|
|||
use Sylius\Component\Core\Model\ShopBillingDataInterface;
|
||||
use Sylius\Component\Core\Model\TaxonImage;
|
||||
use Sylius\Component\Core\Model\TaxonImageInterface;
|
||||
use Sylius\Component\Resource\Factory\Factory;
|
||||
use Sylius\Resource\Factory\Factory;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
|
|
|||
|
|
@ -23,11 +23,15 @@ use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
|||
|
||||
final class ResourceDeleteHandler implements ResourceDeleteHandlerInterface
|
||||
{
|
||||
public function __construct(private ResourceDeleteHandlerInterface $decoratedHandler, private EntityManagerInterface $entityManager)
|
||||
{
|
||||
public function __construct(
|
||||
private ResourceDeleteHandlerInterface $decoratedHandler,
|
||||
private EntityManagerInterface $entityManager
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RepositoryInterface<ResourceInterface> $repository
|
||||
*
|
||||
* @throws DeleteHandlingException
|
||||
*/
|
||||
public function handle(ResourceInterface $resource, RepositoryInterface $repository): void
|
||||
|
|
|
|||
|
|
@ -20,10 +20,13 @@ use Sylius\Component\Core\Model\OrderInterface;
|
|||
use Sylius\Resource\Factory\FactoryInterface;
|
||||
|
||||
/**
|
||||
* @implements OrderFactoryInterface<OrderInterface>
|
||||
* @template T of OrderInterface
|
||||
*
|
||||
* @implements OrderFactoryInterface<T>
|
||||
*/
|
||||
final class OrderFactory implements OrderFactoryInterface
|
||||
{
|
||||
/** @param FactoryInterface<T> $decoratedFactory */
|
||||
public function __construct(
|
||||
private FactoryInterface $decoratedFactory,
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
|||
|
||||
class CurrencyFixture extends AbstractFixture
|
||||
{
|
||||
/** @param FactoryInterface<CurrencyInterface> $currencyFactory */
|
||||
public function __construct(private FactoryInterface $currencyFactory, private ObjectManager $currencyManager)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,11 @@ class AddressExampleFactory extends AbstractExampleFactory
|
|||
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/**
|
||||
* @param FactoryInterface<AddressInterface> $addressFactory
|
||||
* @param RepositoryInterface<CountryInterface> $countryRepository
|
||||
* @param RepositoryInterface<CustomerInterface> $customerRepository
|
||||
*/
|
||||
public function __construct(
|
||||
private FactoryInterface $addressFactory,
|
||||
private RepositoryInterface $countryRepository,
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ use Faker\Factory;
|
|||
use Faker\Generator;
|
||||
use Sylius\Component\Core\Model\AdminUserInterface;
|
||||
use Sylius\Component\Core\Model\AvatarImage;
|
||||
use Sylius\Component\Core\Model\ImageInterface;
|
||||
use Sylius\Component\Core\Uploader\ImageUploaderInterface;
|
||||
use Sylius\Resource\Factory\FactoryInterface;
|
||||
use Symfony\Component\Config\FileLocatorInterface;
|
||||
|
|
@ -30,6 +31,10 @@ class AdminUserExampleFactory extends AbstractExampleFactory implements ExampleF
|
|||
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/**
|
||||
* @param FactoryInterface<AdminUserInterface> $userFactory
|
||||
* @param FactoryInterface<ImageInterface>|null $avatarImageFactory
|
||||
*/
|
||||
public function __construct(
|
||||
private FactoryInterface $userFactory,
|
||||
private string $localeCode,
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ final class CatalogPromotionActionExampleFactory extends AbstractExampleFactory
|
|||
{
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/** @param FactoryInterface<CatalogPromotionActionInterface> $catalogPromotionActionFactory */
|
||||
public function __construct(private FactoryInterface $catalogPromotionActionFactory)
|
||||
{
|
||||
$this->optionsResolver = new OptionsResolver();
|
||||
|
|
|
|||
|
|
@ -33,6 +33,10 @@ class CatalogPromotionExampleFactory extends AbstractExampleFactory implements E
|
|||
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/**
|
||||
* @param FactoryInterface<CatalogPromotionInterface> $catalogPromotionFactory
|
||||
* @param RepositoryInterface<LocaleInterface> $localeRepository
|
||||
*/
|
||||
public function __construct(
|
||||
private FactoryInterface $catalogPromotionFactory,
|
||||
private RepositoryInterface $localeRepository,
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ final class CatalogPromotionScopeExampleFactory extends AbstractExampleFactory i
|
|||
{
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/** @param FactoryInterface<CatalogPromotionScopeInterface> $catalogPromotionScopeFactory */
|
||||
public function __construct(private FactoryInterface $catalogPromotionScopeFactory)
|
||||
{
|
||||
$this->optionsResolver = new OptionsResolver();
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ use Sylius\Component\Core\Formatter\StringInflector;
|
|||
use Sylius\Component\Core\Model\ChannelInterface;
|
||||
use Sylius\Component\Core\Model\Scope;
|
||||
use Sylius\Component\Core\Model\ShopBillingData;
|
||||
use Sylius\Component\Core\Model\ShopBillingDataInterface;
|
||||
use Sylius\Component\Core\Model\TaxonInterface;
|
||||
use Sylius\Component\Currency\Model\CurrencyInterface;
|
||||
use Sylius\Component\Locale\Model\LocaleInterface;
|
||||
|
|
@ -40,8 +41,15 @@ class ChannelExampleFactory extends AbstractExampleFactory implements ExampleFac
|
|||
|
||||
private ?TaxonRepositoryInterface $taxonRepository;
|
||||
|
||||
/** @var FactoryInterface<ShopBillingDataInterface>|null */
|
||||
private ?FactoryInterface $shopBillingDataFactory;
|
||||
|
||||
/**
|
||||
* @param RepositoryInterface<LocaleInterface> $localeRepository
|
||||
* @param RepositoryInterface<CurrencyInterface> $currencyRepository
|
||||
* @param RepositoryInterface<ZoneInterface> $zoneRepository
|
||||
* @param FactoryInterface<ShopBillingDataInterface>|null $shopBillingDataFactory
|
||||
*/
|
||||
public function __construct(
|
||||
private ChannelFactoryInterface $channelFactory,
|
||||
private RepositoryInterface $localeRepository,
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class CustomerGroupExampleFactory extends AbstractExampleFactory implements Exam
|
|||
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/** @param FactoryInterface<CustomerGroupInterface> $customerGroupFactory */
|
||||
public function __construct(private FactoryInterface $customerGroupFactory)
|
||||
{
|
||||
$this->faker = Factory::create();
|
||||
|
|
|
|||
|
|
@ -51,6 +51,14 @@ class OrderExampleFactory extends AbstractExampleFactory implements ExampleFacto
|
|||
/** @var Generator */
|
||||
protected $faker;
|
||||
|
||||
/**
|
||||
* @param FactoryInterface<OrderInterface> $orderFactory
|
||||
* @param FactoryInterface<OrderItemInterface> $orderItemFactory
|
||||
* @param RepositoryInterface<ChannelInterface> $channelRepository
|
||||
* @param RepositoryInterface<CustomerInterface> $customerRepository
|
||||
* @param RepositoryInterface<CountryInterface> $countryRepository
|
||||
* @param FactoryInterface<AddressInterface> $addressFactory
|
||||
*/
|
||||
public function __construct(
|
||||
protected FactoryInterface $orderFactory,
|
||||
protected FactoryInterface $orderItemFactory,
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ class PaymentMethodExampleFactory extends AbstractExampleFactory implements Exam
|
|||
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/** @param RepositoryInterface<LocaleInterface> $localeRepository */
|
||||
public function __construct(
|
||||
private PaymentMethodFactoryInterface $paymentMethodFactory,
|
||||
private RepositoryInterface $localeRepository,
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ class ProductAssociationExampleFactory extends AbstractExampleFactory implements
|
|||
{
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/** @param FactoryInterface<ProductAssociationInterface> $productAssociationFactory */
|
||||
public function __construct(
|
||||
private FactoryInterface $productAssociationFactory,
|
||||
private ProductAssociationTypeRepositoryInterface $productAssociationTypeRepository,
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ class ProductAssociationTypeExampleFactory extends AbstractExampleFactory implem
|
|||
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/**
|
||||
* @param FactoryInterface<ProductAssociationTypeInterface> $productAssociationTypeFactory
|
||||
* @param RepositoryInterface<LocaleInterface> $localeRepository
|
||||
*/
|
||||
public function __construct(
|
||||
private FactoryInterface $productAssociationTypeFactory,
|
||||
private RepositoryInterface $localeRepository,
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ class ProductAttributeExampleFactory extends AbstractExampleFactory implements E
|
|||
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/**
|
||||
* @param RepositoryInterface<LocaleInterface> $localeRepository
|
||||
* @param array<string, string> $attributeTypes
|
||||
*/
|
||||
public function __construct(
|
||||
private AttributeFactoryInterface $productAttributeFactory,
|
||||
private RepositoryInterface $localeRepository,
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ use Sylius\Component\Core\Formatter\StringInflector;
|
|||
use Sylius\Component\Core\Model\ChannelInterface;
|
||||
use Sylius\Component\Core\Model\ChannelPricingInterface;
|
||||
use Sylius\Component\Core\Model\ImageInterface;
|
||||
use Sylius\Component\Core\Model\ProductImageInterface;
|
||||
use Sylius\Component\Core\Model\ProductInterface;
|
||||
use Sylius\Component\Core\Model\ProductTaxonInterface;
|
||||
use Sylius\Component\Core\Model\ProductVariantInterface;
|
||||
|
|
@ -31,6 +32,7 @@ use Sylius\Component\Product\Generator\ProductVariantGeneratorInterface;
|
|||
use Sylius\Component\Product\Generator\SlugGeneratorInterface;
|
||||
use Sylius\Component\Product\Model\ProductAttributeInterface;
|
||||
use Sylius\Component\Product\Model\ProductAttributeValueInterface;
|
||||
use Sylius\Component\Product\Model\ProductOptionInterface;
|
||||
use Sylius\Component\Product\Model\ProductOptionValueInterface;
|
||||
use Sylius\Resource\Factory\FactoryInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
|
|
@ -47,6 +49,20 @@ class ProductExampleFactory extends AbstractExampleFactory implements ExampleFac
|
|||
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/**
|
||||
* @param FactoryInterface<ProductInterface> $productFactory
|
||||
* @param FactoryInterface<ProductVariantInterface> $productVariantFactory
|
||||
* @param FactoryInterface<ChannelPricingInterface> $channelPricingFactory
|
||||
* @param FactoryInterface<ProductAttributeValueInterface> $productAttributeValueFactory
|
||||
* @param FactoryInterface<ProductImageInterface> $productImageFactory
|
||||
* @param FactoryInterface<ProductTaxonInterface> $productTaxonFactory
|
||||
* @param RepositoryInterface<TaxonInterface> $taxonRepository
|
||||
* @param RepositoryInterface<ProductAttributeInterface> $productAttributeRepository
|
||||
* @param RepositoryInterface<ProductOptionInterface> $productOptionRepository
|
||||
* @param RepositoryInterface<ChannelInterface> $channelRepository
|
||||
* @param RepositoryInterface<LocaleInterface> $localeRepository
|
||||
* @param RepositoryInterface<TaxCategoryInterface>|null $taxCategoryRepository
|
||||
*/
|
||||
public function __construct(
|
||||
private FactoryInterface $productFactory,
|
||||
private FactoryInterface $productVariantFactory,
|
||||
|
|
|
|||
|
|
@ -30,6 +30,11 @@ class ProductOptionExampleFactory extends AbstractExampleFactory implements Exam
|
|||
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/**
|
||||
* @param FactoryInterface<ProductOptionInterface> $productOptionFactory
|
||||
* @param FactoryInterface<ProductOptionValueInterface> $productOptionValueFactory
|
||||
* @param RepositoryInterface<LocaleInterface> $localeRepository
|
||||
*/
|
||||
public function __construct(
|
||||
private FactoryInterface $productOptionFactory,
|
||||
private FactoryInterface $productOptionValueFactory,
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ class PromotionExampleFactory extends AbstractExampleFactory implements ExampleF
|
|||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/**
|
||||
* @param FactoryInterface<PromotionInterface> $promotionFactory
|
||||
* @param FactoryInterface<PromotionCouponInterface>|null $couponFactory
|
||||
* @param RepositoryInterface<LocaleInterface>|null $localeRepository
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -171,6 +173,7 @@ class PromotionExampleFactory extends AbstractExampleFactory implements ExampleF
|
|||
;
|
||||
}
|
||||
|
||||
/** @param FactoryInterface<PromotionCouponInterface>|null $couponFactory */
|
||||
private static function getCouponNormalizer(?FactoryInterface $couponFactory): \Closure
|
||||
{
|
||||
return function (Options $options, array $couponDefinitions) use ($couponFactory): array {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class ShippingCategoryExampleFactory extends AbstractExampleFactory implements E
|
|||
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/** @param FactoryInterface<ShippingCategoryInterface> $shippingCategoryFactory */
|
||||
public function __construct(private FactoryInterface $shippingCategoryFactory)
|
||||
{
|
||||
$this->faker = Factory::create();
|
||||
|
|
|
|||
|
|
@ -36,6 +36,13 @@ class ShippingMethodExampleFactory extends AbstractExampleFactory implements Exa
|
|||
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/**
|
||||
* @param FactoryInterface<ShippingMethodInterface> $shippingMethodFactory
|
||||
* @param RepositoryInterface<ZoneInterface> $zoneRepository
|
||||
* @param RepositoryInterface<ShippingCategoryInterface> $shippingCategoryRepository
|
||||
* @param RepositoryInterface<LocaleInterface> $localeRepository
|
||||
* @param RepositoryInterface<TaxCategoryInterface>|null $taxCategoryRepository
|
||||
*/
|
||||
public function __construct(
|
||||
private FactoryInterface $shippingMethodFactory,
|
||||
private RepositoryInterface $zoneRepository,
|
||||
|
|
|
|||
|
|
@ -31,6 +31,11 @@ class ShopUserExampleFactory extends AbstractExampleFactory implements ExampleFa
|
|||
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/**
|
||||
* @param FactoryInterface<ShopUserInterface> $shopUserFactory
|
||||
* @param FactoryInterface<CustomerInterface> $customerFactory
|
||||
* @param RepositoryInterface<CustomerGroupInterface> $customerGroupRepository
|
||||
*/
|
||||
public function __construct(
|
||||
private FactoryInterface $shopUserFactory,
|
||||
private FactoryInterface $customerFactory,
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class TaxCategoryExampleFactory extends AbstractExampleFactory implements Exampl
|
|||
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/** @param FactoryInterface<TaxCategoryInterface> $taxCategoryFactory */
|
||||
public function __construct(private FactoryInterface $taxCategoryFactory)
|
||||
{
|
||||
$this->faker = Factory::create();
|
||||
|
|
|
|||
|
|
@ -31,6 +31,11 @@ class TaxRateExampleFactory extends AbstractExampleFactory implements ExampleFac
|
|||
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/**
|
||||
* @param FactoryInterface<TaxRateInterface> $taxRateFactory
|
||||
* @param RepositoryInterface<ZoneInterface> $zoneRepository
|
||||
* @param RepositoryInterface<TaxCategoryInterface> $taxCategoryRepository
|
||||
*/
|
||||
public function __construct(
|
||||
private FactoryInterface $taxRateFactory,
|
||||
private RepositoryInterface $zoneRepository,
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@ class TaxonExampleFactory extends AbstractExampleFactory implements ExampleFacto
|
|||
|
||||
private OptionsResolver $optionsResolver;
|
||||
|
||||
/**
|
||||
* @param FactoryInterface<TaxonInterface> $taxonFactory
|
||||
* @param RepositoryInterface<LocaleInterface> $localeRepository
|
||||
*/
|
||||
public function __construct(
|
||||
private FactoryInterface $taxonFactory,
|
||||
private TaxonRepositoryInterface $taxonRepository,
|
||||
|
|
|
|||
|
|
@ -26,6 +26,11 @@ use Webmozart\Assert\Assert;
|
|||
|
||||
class GeographicalFixture extends AbstractFixture
|
||||
{
|
||||
/**
|
||||
* @param FactoryInterface<CountryInterface> $countryFactory
|
||||
* @param FactoryInterface<ProvinceInterface> $provinceFactory
|
||||
* @param ZoneFactoryInterface<ZoneInterface> $zoneFactory
|
||||
*/
|
||||
public function __construct(
|
||||
private FactoryInterface $countryFactory,
|
||||
private ObjectManager $countryManager,
|
||||
|
|
|
|||
|
|
@ -21,11 +21,12 @@ use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
|||
|
||||
class LocaleFixture extends AbstractFixture
|
||||
{
|
||||
/**
|
||||
* @param string $baseLocaleCode
|
||||
*/
|
||||
public function __construct(private FactoryInterface $localeFactory, private ObjectManager $localeManager, private $baseLocaleCode)
|
||||
{
|
||||
/** @param FactoryInterface<LocaleInterface> $localeFactory */
|
||||
public function __construct(
|
||||
private FactoryInterface $localeFactory,
|
||||
private ObjectManager $localeManager,
|
||||
private string $baseLocaleCode,
|
||||
) {
|
||||
}
|
||||
|
||||
public function load(array $options): void
|
||||
|
|
|
|||
|
|
@ -20,12 +20,19 @@ use SM\Factory\FactoryInterface as StateMachineFactoryInterface;
|
|||
use Sylius\Abstraction\StateMachine\StateMachineInterface;
|
||||
use Sylius\Bundle\CoreBundle\Fixture\Factory\OrderExampleFactory;
|
||||
use Sylius\Bundle\FixturesBundle\Fixture\AbstractFixture;
|
||||
use Sylius\Component\Addressing\Model\CountryInterface;
|
||||
use Sylius\Component\Core\Checker\OrderPaymentMethodSelectionRequirementCheckerInterface;
|
||||
use Sylius\Component\Core\Checker\OrderShippingMethodSelectionRequirementCheckerInterface;
|
||||
use Sylius\Component\Core\Model\AddressInterface;
|
||||
use Sylius\Component\Core\Model\ChannelInterface;
|
||||
use Sylius\Component\Core\Model\CustomerInterface;
|
||||
use Sylius\Component\Core\Model\OrderInterface;
|
||||
use Sylius\Component\Core\Model\OrderItemInterface;
|
||||
use Sylius\Component\Core\Repository\PaymentMethodRepositoryInterface;
|
||||
use Sylius\Component\Core\Repository\ProductRepositoryInterface;
|
||||
use Sylius\Component\Core\Repository\ShippingMethodRepositoryInterface;
|
||||
use Sylius\Component\Order\Modifier\OrderItemQuantityModifierInterface;
|
||||
use Sylius\Component\Core\Model\ProductInterface;
|
||||
use Sylius\Resource\Factory\FactoryInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
|
@ -41,6 +48,15 @@ class OrderFixture extends AbstractFixture
|
|||
|
||||
private Generator $faker;
|
||||
|
||||
/**
|
||||
* @param FactoryInterface<OrderInterface> $orderFactory
|
||||
* @param FactoryInterface<OrderItemInterface> $orderItemFactory
|
||||
* @param RepositoryInterface<ChannelInterface> $channelRepository
|
||||
* @param RepositoryInterface<CustomerInterface> $customerRepository
|
||||
* @param RepositoryInterface<ProductInterface>|ProductRepositoryInterface<ProductInterface> $productRepository
|
||||
* @param RepositoryInterface<CountryInterface> $countryRepository
|
||||
* @param FactoryInterface<AddressInterface> $addressFactory
|
||||
*/
|
||||
public function __construct(
|
||||
FactoryInterface $orderFactory,
|
||||
FactoryInterface $orderItemFactory,
|
||||
|
|
@ -48,7 +64,7 @@ class OrderFixture extends AbstractFixture
|
|||
ObjectManager $orderManager,
|
||||
RepositoryInterface $channelRepository,
|
||||
RepositoryInterface $customerRepository,
|
||||
RepositoryInterface $productRepository,
|
||||
RepositoryInterface|ProductRepositoryInterface $productRepository,
|
||||
RepositoryInterface $countryRepository,
|
||||
PaymentMethodRepositoryInterface $paymentMethodRepository,
|
||||
ShippingMethodRepositoryInterface $shippingMethodRepository,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,10 @@ use Symfony\Component\Form\Exception\TransformationFailedException;
|
|||
|
||||
final class ProductTaxonToTaxonTransformer implements DataTransformerInterface
|
||||
{
|
||||
/**
|
||||
* @param FactoryInterface<ProductTaxonInterface> $productTaxonFactory
|
||||
* @param RepositoryInterface<ProductTaxonInterface> $productTaxonRepository
|
||||
*/
|
||||
public function __construct(
|
||||
private FactoryInterface $productTaxonFactory,
|
||||
private RepositoryInterface $productTaxonRepository,
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ use Webmozart\Assert\Assert;
|
|||
|
||||
final class CustomerRegistrationFormSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
/** @param RepositoryInterface<CustomerInterface> $customerRepository */
|
||||
public function __construct(private RepositoryInterface $customerRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ use Symfony\Component\Intl\Countries;
|
|||
|
||||
final class CountryTypeExtension extends AbstractTypeExtension
|
||||
{
|
||||
/** @param RepositoryInterface<CountryInterface> $countryRepository */
|
||||
public function __construct(private RepositoryInterface $countryRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ trigger_deprecation(
|
|||
/** @deprecated since Sylius 1.14 and will be removed in Sylius 2.0. */
|
||||
final class LocaleTypeExtension extends AbstractTypeExtension
|
||||
{
|
||||
/** @param RepositoryInterface<LocaleInterface> $localeRepository */
|
||||
public function __construct(private RepositoryInterface $localeRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,10 @@ use Symfony\Component\Form\FormEvents;
|
|||
|
||||
final class CustomerCheckoutGuestType extends AbstractResourceType
|
||||
{
|
||||
/**
|
||||
* @param RepositoryInterface<CustomerInterface> $customerRepository
|
||||
* @param FactoryInterface<CustomerInterface> $customerFactory
|
||||
*/
|
||||
public function __construct(
|
||||
string $dataClass,
|
||||
array $validationGroups,
|
||||
|
|
|
|||
|
|
@ -25,6 +25,10 @@ use Symfony\Component\Form\FormEvents;
|
|||
|
||||
final class CustomerGuestType extends AbstractResourceType
|
||||
{
|
||||
/**
|
||||
* @param RepositoryInterface<CustomerInterface> $customerRepository
|
||||
* @param FactoryInterface<CustomerInterface> $customerFactory
|
||||
*/
|
||||
public function __construct(
|
||||
string $dataClass,
|
||||
array $validationGroups,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ namespace Sylius\Bundle\CoreBundle\Form\Type\Customer;
|
|||
use Sylius\Bundle\CoreBundle\Form\EventSubscriber\CustomerRegistrationFormSubscriber;
|
||||
use Sylius\Bundle\CoreBundle\Form\Type\User\ShopUserRegistrationType;
|
||||
use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
|
||||
use Sylius\Component\Core\Model\CustomerInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
|
@ -24,8 +25,12 @@ use Symfony\Component\Validator\Constraints\Valid;
|
|||
|
||||
final class CustomerSimpleRegistrationType extends AbstractResourceType
|
||||
{
|
||||
public function __construct(string $dataClass, array $validationGroups, private RepositoryInterface $customerRepository)
|
||||
{
|
||||
/** @param RepositoryInterface<CustomerInterface> $customerRepository */
|
||||
public function __construct(
|
||||
string $dataClass,
|
||||
array $validationGroups,
|
||||
private RepositoryInterface $customerRepository,
|
||||
) {
|
||||
parent::__construct($dataClass, $validationGroups);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
|
|||
use Sylius\Component\Core\Model\ChannelInterface;
|
||||
use Sylius\Component\Core\Model\ChannelPricingInterface;
|
||||
use Sylius\Component\Core\Model\ProductVariantInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Component\Form\FormEvents;
|
||||
|
|
@ -26,10 +27,11 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
final class ChannelPricingType extends AbstractResourceType
|
||||
{
|
||||
/** @param RepositoryInterface<ChannelPricingInterface>|null $channelPricingRepository */
|
||||
public function __construct(
|
||||
string $dataClass,
|
||||
array $validationGroups,
|
||||
private ?\Sylius\Resource\Doctrine\Persistence\RepositoryInterface $channelPricingRepository = null,
|
||||
private ?RepositoryInterface $channelPricingRepository = null,
|
||||
) {
|
||||
parent::__construct($dataClass, $validationGroups);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ namespace Sylius\Bundle\CoreBundle\Form\Type\Promotion\Rule;
|
|||
|
||||
use Sylius\Bundle\ProductBundle\Form\Type\ProductAutocompleteChoiceType;
|
||||
use Sylius\Bundle\ResourceBundle\Form\DataTransformer\ResourceToIdentifierTransformer;
|
||||
use Sylius\Component\Core\Model\ProductInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
|
@ -22,6 +23,7 @@ use Symfony\Component\Form\ReversedTransformer;
|
|||
|
||||
final class ContainsProductConfigurationType extends AbstractType
|
||||
{
|
||||
/** @param RepositoryInterface<ProductInterface> $productRepository */
|
||||
public function __construct(private RepositoryInterface $productRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ namespace Sylius\Bundle\CoreBundle\Form\Type\Promotion\Rule;
|
|||
use Sylius\Bundle\MoneyBundle\Form\Type\MoneyType;
|
||||
use Sylius\Bundle\ResourceBundle\Form\DataTransformer\ResourceToIdentifierTransformer;
|
||||
use Sylius\Bundle\TaxonomyBundle\Form\Type\TaxonAutocompleteChoiceType;
|
||||
use Sylius\Component\Core\Model\TaxonInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
|
@ -24,6 +25,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
final class TotalOfItemsFromTaxonConfigurationType extends AbstractType
|
||||
{
|
||||
/** @param RepositoryInterface<TaxonInterface> $taxonRepository */
|
||||
public function __construct(private RepositoryInterface $taxonRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ use Sylius\Bundle\CoreBundle\Form\DataTransformer\ProductTaxonToTaxonTransformer
|
|||
use Sylius\Bundle\ResourceBundle\Form\DataTransformer\RecursiveTransformer;
|
||||
use Sylius\Bundle\ResourceBundle\Form\Type\ResourceAutocompleteChoiceType;
|
||||
use Sylius\Component\Core\Model\ProductInterface;
|
||||
use Sylius\Component\Core\Model\ProductTaxonInterface;
|
||||
use Sylius\Resource\Factory\FactoryInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
|
|
@ -25,8 +26,14 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
final class ProductTaxonAutocompleteChoiceType extends AbstractType
|
||||
{
|
||||
public function __construct(private FactoryInterface $productTaxonFactory, private RepositoryInterface $productTaxonRepository)
|
||||
{
|
||||
/**
|
||||
* @param FactoryInterface<ProductTaxonInterface> $productTaxonFactory
|
||||
* @param RepositoryInterface<ProductTaxonInterface> $productTaxonRepository
|
||||
*/
|
||||
public function __construct(
|
||||
private FactoryInterface $productTaxonFactory,
|
||||
private RepositoryInterface $productTaxonRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
|
|
|
|||
|
|
@ -22,6 +22,10 @@ use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
|||
|
||||
final class ChannelSetup implements ChannelSetupInterface
|
||||
{
|
||||
/**
|
||||
* @param RepositoryInterface<ChannelInterface> $channelRepository
|
||||
* @param FactoryInterface<ChannelInterface> $channelFactory
|
||||
*/
|
||||
public function __construct(
|
||||
private RepositoryInterface $channelRepository,
|
||||
private FactoryInterface $channelFactory,
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@ final class CurrencySetup implements CurrencySetupInterface
|
|||
{
|
||||
private string $currency;
|
||||
|
||||
/**
|
||||
* @param RepositoryInterface<CurrencyInterface> $currencyRepository
|
||||
* @param FactoryInterface<CurrencyInterface> $currencyFactory
|
||||
*/
|
||||
public function __construct(
|
||||
private RepositoryInterface $currencyRepository,
|
||||
private FactoryInterface $currencyFactory,
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@ use Symfony\Component\Yaml\Yaml;
|
|||
|
||||
final class LocaleSetup implements LocaleSetupInterface
|
||||
{
|
||||
/**
|
||||
* @param RepositoryInterface<LocaleInterface> $localeRepository
|
||||
* @param FactoryInterface<LocaleInterface> $localeFactory
|
||||
*/
|
||||
public function __construct(
|
||||
private RepositoryInterface $localeRepository,
|
||||
private FactoryInterface $localeFactory,
|
||||
|
|
|
|||
|
|
@ -22,9 +22,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
|||
|
||||
final class ResendOrderConfirmationEmailHandler implements MessageHandlerInterface
|
||||
{
|
||||
/**
|
||||
* @param RepositoryInterface<OrderInterface> $orderRepository
|
||||
*/
|
||||
/** @param RepositoryInterface<OrderInterface> $orderRepository */
|
||||
public function __construct(
|
||||
private OrderEmailManagerInterface $orderEmailManager,
|
||||
private RepositoryInterface $orderRepository,
|
||||
|
|
|
|||
|
|
@ -22,9 +22,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
|
|||
|
||||
final class ResendShipmentConfirmationEmailHandler implements MessageHandlerInterface
|
||||
{
|
||||
/**
|
||||
* @param RepositoryInterface<ShipmentInterface> $shipmentRepository
|
||||
*/
|
||||
/** @param RepositoryInterface<ShipmentInterface> $shipmentRepository */
|
||||
public function __construct(
|
||||
private RepositoryInterface $shipmentRepository,
|
||||
private ShipmentEmailManagerInterface $shipmentEmailManager,
|
||||
|
|
|
|||
|
|
@ -35,6 +35,12 @@ use Webmozart\Assert\Assert;
|
|||
*/
|
||||
class UserProvider extends BaseUserProvider implements AccountConnectorInterface, OAuthAwareUserProviderInterface
|
||||
{
|
||||
/**
|
||||
* @param FactoryInterface<CustomerInterface> $customerFactory
|
||||
* @param FactoryInterface<SyliusUserInterface> $userFactory
|
||||
* @param FactoryInterface<UserOAuthInterface> $oauthFactory
|
||||
* @param RepositoryInterface<UserOAuthInterface> $oauthRepository
|
||||
*/
|
||||
public function __construct(
|
||||
string $supportedUserClass,
|
||||
private FactoryInterface $customerFactory,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,10 @@ use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
|||
|
||||
final class SequentialOrderNumberGenerator implements OrderNumberGeneratorInterface
|
||||
{
|
||||
/**
|
||||
* @param RepositoryInterface<OrderSequenceInterface> $sequenceRepository
|
||||
* @param FactoryInterface<OrderSequenceInterface> $sequenceFactory
|
||||
*/
|
||||
public function __construct(
|
||||
private RepositoryInterface $sequenceRepository,
|
||||
private FactoryInterface $sequenceFactory,
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ use Symfony\Component\Messenger\MessageBusInterface;
|
|||
|
||||
final class BatchedApplyLowestPriceOnChannelPricingsCommandDispatcher implements ApplyLowestPriceOnChannelPricingsCommandDispatcherInterface
|
||||
{
|
||||
/** @param RepositoryInterface<ChannelPricingInterface> $channelPricingRepository */
|
||||
public function __construct(
|
||||
private RepositoryInterface $channelPricingRepository,
|
||||
private MessageBusInterface $commandBus,
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
|||
|
||||
final class ApplyLowestPriceOnChannelPricingsHandler
|
||||
{
|
||||
/** @param RepositoryInterface<ChannelPricingInterface> $channelPricingRepository */
|
||||
public function __construct(
|
||||
private ProductLowestPriceBeforeDiscountProcessorInterface $productLowestPriceBeforeDiscountProcessor,
|
||||
private RepositoryInterface $channelPricingRepository,
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ use Sylius\Resource\Factory\FactoryInterface;
|
|||
|
||||
final class CustomerResolver implements CustomerResolverInterface
|
||||
{
|
||||
/** @param FactoryInterface<CustomerInterface> $customerFactory */
|
||||
public function __construct(
|
||||
private FactoryInterface $customerFactory,
|
||||
private CustomerProviderInterface $customerProvider,
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ use Webmozart\Assert\Assert;
|
|||
|
||||
final class RegisteredUserValidator extends ConstraintValidator
|
||||
{
|
||||
/** @param RepositoryInterface<CustomerInterface> $customerRepository */
|
||||
public function __construct(private RepositoryInterface $customerRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,9 +22,7 @@ use Symfony\Component\Validator\Exception\UnexpectedTypeException;
|
|||
|
||||
final class ResendShipmentConfirmationEmailWithValidShipmentStateValidator extends ConstraintValidator
|
||||
{
|
||||
/**
|
||||
* @param RepositoryInterface<ShipmentInterface> $shipmentRepository
|
||||
*/
|
||||
/** @param RepositoryInterface<ShipmentInterface> $shipmentRepository */
|
||||
public function __construct(private RepositoryInterface $shipmentRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ use Webmozart\Assert\Assert;
|
|||
|
||||
final class TranslationForExistingLocalesValidator extends ConstraintValidator
|
||||
{
|
||||
/** @param RepositoryInterface<LocaleInterface> $localeRepository */
|
||||
public function __construct(private RepositoryInterface $localeRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ use Sylius\Component\Currency\Model\Currency;
|
|||
use Sylius\Component\Currency\Model\CurrencyInterface;
|
||||
use Sylius\Component\Currency\Model\ExchangeRate;
|
||||
use Sylius\Component\Currency\Model\ExchangeRateInterface;
|
||||
use Sylius\Component\Resource\Factory\Factory;
|
||||
use Sylius\Resource\Factory\Factory;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Sylius\Bundle\CurrencyBundle\Form\Type;
|
||||
|
||||
use Sylius\Component\Currency\Model\CurrencyInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Bridge\Doctrine\Form\DataTransformer\CollectionToArrayTransformer;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
|
|
@ -23,6 +24,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
final class CurrencyChoiceType extends AbstractType
|
||||
{
|
||||
/** @param RepositoryInterface<CurrencyInterface> $currencyRepository */
|
||||
public function __construct(private RepositoryInterface $currencyRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ use Sylius\Component\Customer\Model\Customer;
|
|||
use Sylius\Component\Customer\Model\CustomerGroup;
|
||||
use Sylius\Component\Customer\Model\CustomerGroupInterface;
|
||||
use Sylius\Component\Customer\Model\CustomerInterface;
|
||||
use Sylius\Component\Resource\Factory\Factory;
|
||||
use Sylius\Resource\Factory\Factory;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
final class CustomerChoiceType extends AbstractType
|
||||
{
|
||||
/** @param RepositoryInterface<CustomerInterface> $customerRepository */
|
||||
public function __construct(private RepositoryInterface $customerRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Sylius\Bundle\CustomerBundle\Form\Type;
|
||||
|
||||
use Sylius\Component\Customer\Model\CustomerGroupInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Bridge\Doctrine\Form\DataTransformer\CollectionToArrayTransformer;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
|
|
@ -23,6 +24,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
final class CustomerGroupChoiceType extends AbstractType
|
||||
{
|
||||
/** @param RepositoryInterface<CustomerGroupInterface> $customerGroupRepository */
|
||||
public function __construct(private RepositoryInterface $customerGroupRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
|||
namespace Sylius\Bundle\CustomerBundle\Form\Type;
|
||||
|
||||
use Sylius\Bundle\ResourceBundle\Form\DataTransformer\ResourceToIdentifierTransformer;
|
||||
use Sylius\Component\Customer\Model\CustomerGroupInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
|
@ -21,6 +22,7 @@ use Symfony\Component\Form\ReversedTransformer;
|
|||
|
||||
final class CustomerGroupCodeChoiceType extends AbstractType
|
||||
{
|
||||
/** @param RepositoryInterface<CustomerGroupInterface> $customerGroupRepository */
|
||||
public function __construct(private RepositoryInterface $customerGroupRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use Sylius\Bundle\ResourceBundle\Controller\ResourceController;
|
|||
use Sylius\Bundle\ResourceBundle\SyliusResourceBundle;
|
||||
use Sylius\Component\Inventory\Model\InventoryUnit;
|
||||
use Sylius\Component\Inventory\Model\InventoryUnitInterface;
|
||||
use Sylius\Component\Resource\Factory\Factory;
|
||||
use Sylius\Resource\Factory\Factory;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
|
|
|||
|
|
@ -23,9 +23,7 @@ use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
|||
|
||||
final class LocaleUsageChecker implements LocaleUsageCheckerInterface
|
||||
{
|
||||
/**
|
||||
* @param RepositoryInterface<LocaleInterface> $localeRepository
|
||||
*/
|
||||
/** @param RepositoryInterface<LocaleInterface> $localeRepository */
|
||||
public function __construct(
|
||||
private RepositoryInterface $localeRepository,
|
||||
private RegistryInterface $resourceRegistry,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use Sylius\Bundle\ResourceBundle\Controller\ResourceController;
|
|||
use Sylius\Bundle\ResourceBundle\SyliusResourceBundle;
|
||||
use Sylius\Component\Locale\Model\Locale;
|
||||
use Sylius\Component\Locale\Model\LocaleInterface;
|
||||
use Sylius\Component\Resource\Factory\Factory;
|
||||
use Sylius\Resource\Factory\Factory;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Sylius\Bundle\LocaleBundle\Form\Type;
|
||||
|
||||
use Sylius\Component\Locale\Model\LocaleInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Bridge\Doctrine\Form\DataTransformer\CollectionToArrayTransformer;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
|
|
@ -23,6 +24,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
final class LocaleChoiceType extends AbstractType
|
||||
{
|
||||
/** @param RepositoryInterface<LocaleInterface> $localeRepository */
|
||||
public function __construct(private RepositoryInterface $localeRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ use Sylius\Component\Order\Model\OrderItemUnit;
|
|||
use Sylius\Component\Order\Model\OrderItemUnitInterface;
|
||||
use Sylius\Component\Order\Model\OrderSequence;
|
||||
use Sylius\Component\Order\Model\OrderSequenceInterface;
|
||||
use Sylius\Component\Resource\Factory\Factory;
|
||||
use Sylius\Resource\Factory\Factory;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@ use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
|||
|
||||
final class SequentialOrderNumberGenerator implements OrderNumberGeneratorInterface
|
||||
{
|
||||
/**
|
||||
* @param RepositoryInterface<OrderSequenceInterface> $sequenceRepository
|
||||
* @param FactoryInterface<OrderSequenceInterface> $sequenceFactory
|
||||
*/
|
||||
public function __construct(
|
||||
private RepositoryInterface $sequenceRepository,
|
||||
private FactoryInterface $sequenceFactory,
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ use Sylius\Component\Payment\Model\PaymentMethod;
|
|||
use Sylius\Component\Payment\Model\PaymentMethodInterface;
|
||||
use Sylius\Component\Payment\Model\PaymentMethodTranslation;
|
||||
use Sylius\Component\Payment\Model\PaymentMethodTranslationInterface;
|
||||
use Sylius\Component\Resource\Factory\Factory;
|
||||
use Sylius\Component\Resource\Factory\TranslatableFactory;
|
||||
use Sylius\Resource\Factory\Factory;
|
||||
use Sylius\Resource\Factory\TranslatableFactory;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
|||
namespace Sylius\Bundle\PaymentBundle\Form\Type;
|
||||
|
||||
use Sylius\Component\Payment\Model\PaymentInterface;
|
||||
use Sylius\Component\Payment\Model\PaymentMethodInterface;
|
||||
use Sylius\Component\Payment\Resolver\PaymentMethodsResolverInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Bridge\Doctrine\Form\DataTransformer\CollectionToArrayTransformer;
|
||||
|
|
@ -25,6 +26,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
final class PaymentMethodChoiceType extends AbstractType
|
||||
{
|
||||
/** @param RepositoryInterface<PaymentMethodInterface> $paymentMethodRepository */
|
||||
public function __construct(
|
||||
private PaymentMethodsResolverInterface $paymentMethodsResolver,
|
||||
private RepositoryInterface $paymentMethodRepository,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use Sylius\Bundle\PayumBundle\Model\PaymentSecurityToken;
|
|||
use Sylius\Bundle\PayumBundle\Model\PaymentSecurityTokenInterface;
|
||||
use Sylius\Bundle\ResourceBundle\Controller\ResourceController;
|
||||
use Sylius\Bundle\ResourceBundle\SyliusResourceBundle;
|
||||
use Sylius\Component\Resource\Factory\Factory;
|
||||
use Sylius\Resource\Factory\Factory;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@ use Sylius\Component\Product\Model\ProductVariant;
|
|||
use Sylius\Component\Product\Model\ProductVariantInterface;
|
||||
use Sylius\Component\Product\Model\ProductVariantTranslation;
|
||||
use Sylius\Component\Product\Model\ProductVariantTranslationInterface;
|
||||
use Sylius\Component\Resource\Factory\Factory;
|
||||
use Sylius\Component\Resource\Factory\TranslatableFactory;
|
||||
use Sylius\Resource\Factory\Factory;
|
||||
use Sylius\Resource\Factory\TranslatableFactory;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ final class ProductsToProductAssociationsTransformer implements DataTransformerI
|
|||
/** @var Collection<array-key, ProductAssociationInterface> */
|
||||
private ?Collection $productAssociations = null;
|
||||
|
||||
/**
|
||||
* @param FactoryInterface<ProductAssociationInterface> $productAssociationFactory
|
||||
* @param RepositoryInterface<ProductAssociationTypeInterface> $productAssociationTypeRepository
|
||||
*/
|
||||
public function __construct(
|
||||
private FactoryInterface $productAssociationFactory,
|
||||
private ProductRepositoryInterface $productRepository,
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ use Webmozart\Assert\Assert;
|
|||
|
||||
final class BuildAttributesFormSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
/** @param FactoryInterface<AttributeValueInterface> $attributeValueFactory */
|
||||
public function __construct(
|
||||
private FactoryInterface $attributeValueFactory,
|
||||
private TranslationLocaleProviderInterface $localeProvider,
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Sylius\Bundle\ProductBundle\Form\Type;
|
||||
|
||||
use Sylius\Component\Product\Model\ProductAssociationTypeInterface;
|
||||
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
|
||||
use Symfony\Bridge\Doctrine\Form\DataTransformer\CollectionToArrayTransformer;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
|
|
@ -23,6 +24,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
final class ProductAssociationTypeChoiceType extends AbstractType
|
||||
{
|
||||
/** @param RepositoryInterface<ProductAssociationTypeInterface> $productAssociationTypeRepository */
|
||||
public function __construct(private RepositoryInterface $productAssociationTypeRepository)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue