diff --git a/.gitignore b/.gitignore index 5cefda9..6e023d3 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,7 @@ # Symfony CLI https://symfony.com/doc/current/setup/symfony_server.html#different-php-settings-per-project /.php-version /php.ini + +# Local web server files +supervisord.log + diff --git a/src/Foundry/Configurator/FactoryConfigurator.php b/src/Foundry/Configurator/FactoryConfigurator.php index d67f29c..4fd9f4e 100644 --- a/src/Foundry/Configurator/FactoryConfigurator.php +++ b/src/Foundry/Configurator/FactoryConfigurator.php @@ -16,7 +16,7 @@ use Akawakaweb\SyliusFixturesPlugin\Foundry\Factory\FactoryWithModelClassAwareInterface; use Sylius\Component\Resource\Metadata\MetadataInterface; use Sylius\Component\Resource\Metadata\RegistryInterface; -use Zenstruck\Foundry\ModelFactory; +use Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory; final class FactoryConfigurator { @@ -29,12 +29,12 @@ public function __construct(RegistryInterface $registry) public function configure(FactoryWithModelClassAwareInterface $factory): void { - if (!$factory instanceof ModelFactory) { + if (!$factory instanceof PersistentProxyObjectFactory) { return; } /** @var class-string|null $modelClass */ - $modelClass = $this->getModelClass($factory::getEntityClass()); + $modelClass = $this->getModelClass($factory::class()); if (null === $modelClass) { return; diff --git a/src/Foundry/DefaultValues/ChannelDefaultValues.php b/src/Foundry/DefaultValues/ChannelDefaultValues.php index e6f6159..17c0892 100644 --- a/src/Foundry/DefaultValues/ChannelDefaultValues.php +++ b/src/Foundry/DefaultValues/ChannelDefaultValues.php @@ -19,7 +19,7 @@ use Sylius\Component\Currency\Model\CurrencyInterface; use Sylius\Component\Locale\Model\LocaleInterface; use function Zenstruck\Foundry\lazy; -use Zenstruck\Foundry\Proxy; +use Zenstruck\Foundry\Persistence\Proxy; final class ChannelDefaultValues implements DefaultValuesInterface { diff --git a/src/Foundry/Factory/AbstractModelFactory.php b/src/Foundry/Factory/AbstractModelFactory.php index 2434962..c2ac20e 100644 --- a/src/Foundry/Factory/AbstractModelFactory.php +++ b/src/Foundry/Factory/AbstractModelFactory.php @@ -16,14 +16,14 @@ use Akawakaweb\SyliusFixturesPlugin\Foundry\DefaultValues\DefaultValuesInterface; use Akawakaweb\SyliusFixturesPlugin\Foundry\Initiator\InitiatorInterface; use Akawakaweb\SyliusFixturesPlugin\Foundry\Transformer\TransformerInterface; -use Zenstruck\Foundry\ModelFactory; +use Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory; /** * @template TModel of object * - * @template-extends ModelFactory + * @template-extends PersistentProxyObjectFactory */ -abstract class AbstractModelFactory extends ModelFactory +abstract class AbstractModelFactory extends PersistentProxyObjectFactory { public function __construct( private DefaultValuesInterface $defaultValues, @@ -33,12 +33,12 @@ public function __construct( parent::__construct(); } - protected function getDefaults(): array + protected function defaults(): array { return ($this->defaultValues)(self::faker()); } - protected function initialize(): ModelFactory + protected function initialize(): PersistentProxyObjectFactory { return $this ->beforeInstantiate([$this->transformer, 'transform']) diff --git a/src/Foundry/Factory/AddressFactory.php b/src/Foundry/Factory/AddressFactory.php index 9a79de2..a59a388 100644 --- a/src/Foundry/Factory/AddressFactory.php +++ b/src/Foundry/Factory/AddressFactory.php @@ -19,8 +19,8 @@ use Sylius\Bundle\CoreBundle\Doctrine\ORM\AddressRepository; use Sylius\Component\Core\Model\Address; use Sylius\Component\Core\Model\AddressInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -33,7 +33,7 @@ * @method static AddressInterface|Proxy last(string $sortedField = 'id') * @method static AddressInterface|Proxy random(array $attributes = []) * @method static AddressInterface|Proxy randomOrCreate(array $attributes = []) - * @method static AddressRepository|RepositoryProxy repository() + * @method static AddressRepository|ProxyRepositoryDecorator repository() * @method static AddressInterface[]|Proxy[] all() * @method static AddressInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static AddressInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -50,40 +50,40 @@ final class AddressFactory extends AbstractModelFactory implements FactoryWithMo public function withCompany(?string $company = null): self { - return $this->addState(['company' => $company ?? self::faker()->company()]); + return $this->with(['company' => $company ?? self::faker()->company()]); } public function withStreet(string $street): self { - return $this->addState(['street' => $street]); + return $this->with(['street' => $street]); } public function withCity(string $city): self { - return $this->addState(['city' => $city]); + return $this->with(['city' => $city]); } public function withPostcode(string $postcode): self { - return $this->addState(['postcode' => $postcode]); + return $this->with(['postcode' => $postcode]); } public function withCountryCode(string $countryCode): self { - return $this->addState(['countryCode' => $countryCode]); + return $this->with(['countryCode' => $countryCode]); } public function withProvinceName(string $provinceName): self { - return $this->addState(['provinceName' => $provinceName]); + return $this->with(['provinceName' => $provinceName]); } public function withProvinceCode(string $provinceCode): self { - return $this->addState(['provinceCode' => $provinceCode]); + return $this->with(['provinceCode' => $provinceCode]); } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? Address::class; } diff --git a/src/Foundry/Factory/AdminUserFactory.php b/src/Foundry/Factory/AdminUserFactory.php index 8989495..7cb60e3 100644 --- a/src/Foundry/Factory/AdminUserFactory.php +++ b/src/Foundry/Factory/AdminUserFactory.php @@ -24,8 +24,8 @@ use Sylius\Bundle\UserBundle\Doctrine\ORM\UserRepository; use Sylius\Component\Core\Model\AdminUser; use Sylius\Component\Core\Model\AdminUserInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -38,7 +38,7 @@ * @method static AdminUserInterface|Proxy last(string $sortedField = 'id') * @method static AdminUserInterface|Proxy random(array $attributes = []) * @method static AdminUserInterface|Proxy randomOrCreate(array $attributes = []) - * @method static UserRepository|RepositoryProxy repository() + * @method static UserRepository|ProxyRepositoryDecorator repository() * @method static AdminUserInterface[]|Proxy[] all() * @method static AdminUserInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static AdminUserInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -58,7 +58,7 @@ final class AdminUserFactory extends AbstractModelFactory implements FactoryWith use WithLocaleCodeTrait; use WithAvatarTrait; - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? AdminUser::class; } diff --git a/src/Foundry/Factory/CatalogPromotionActionFactory.php b/src/Foundry/Factory/CatalogPromotionActionFactory.php index 6d3aa92..f34d820 100644 --- a/src/Foundry/Factory/CatalogPromotionActionFactory.php +++ b/src/Foundry/Factory/CatalogPromotionActionFactory.php @@ -16,8 +16,8 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; use Sylius\Component\Promotion\Model\CatalogPromotionAction; use Sylius\Component\Promotion\Model\CatalogPromotionActionInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -30,7 +30,7 @@ * @method static CatalogPromotionActionInterface|Proxy last(string $sortedField = 'id') * @method static CatalogPromotionActionInterface|Proxy random(array $attributes = []) * @method static CatalogPromotionActionInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static CatalogPromotionActionInterface[]|Proxy[] all() * @method static CatalogPromotionActionInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static CatalogPromotionActionInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -44,15 +44,15 @@ final class CatalogPromotionActionFactory extends AbstractModelFactory implement public function withType(string $type): self { - return $this->addState(['type' => $type]); + return $this->with(['type' => $type]); } public function withConfiguration(array $configuration): self { - return $this->addState(['configuration' => $configuration]); + return $this->with(['configuration' => $configuration]); } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? CatalogPromotionAction::class; } diff --git a/src/Foundry/Factory/CatalogPromotionFactory.php b/src/Foundry/Factory/CatalogPromotionFactory.php index 03c9206..3127367 100644 --- a/src/Foundry/Factory/CatalogPromotionFactory.php +++ b/src/Foundry/Factory/CatalogPromotionFactory.php @@ -22,8 +22,8 @@ use Doctrine\ORM\EntityRepository; use Sylius\Component\Core\Model\CatalogPromotion; use Sylius\Component\Core\Model\CatalogPromotionInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -36,7 +36,7 @@ * @method static CatalogPromotionInterface|Proxy last(string $sortedField = 'id') * @method static CatalogPromotionInterface|Proxy random(array $attributes = []) * @method static CatalogPromotionInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static CatalogPromotionInterface[]|Proxy[] all() * @method static CatalogPromotionInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static CatalogPromotionInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -56,40 +56,40 @@ final class CatalogPromotionFactory extends AbstractModelFactory implements Fact public function withLabel(string $label): self { - return $this->addState(['label' => $label]); + return $this->with(['label' => $label]); } public function withScopes(array $scopes): self { - return $this->addState(['scopes' => $scopes]); + return $this->with(['scopes' => $scopes]); } public function withActions(array $actions): self { - return $this->addState(['actions' => $actions]); + return $this->with(['actions' => $actions]); } public function exclusive(): self { - return $this->addState(['exclusive' => true]); + return $this->with(['exclusive' => true]); } public function notExclusive(): self { - return $this->addState(['exclusive' => false]); + return $this->with(['exclusive' => false]); } public function withStartDate(\DateTimeInterface|string $startDate): self { - return $this->addState(['startDate' => $startDate]); + return $this->with(['startDate' => $startDate]); } public function withEndDate(\DateTimeInterface|string $endDate): self { - return $this->addState(['endDate' => $endDate]); + return $this->with(['endDate' => $endDate]); } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? CatalogPromotion::class; } diff --git a/src/Foundry/Factory/CatalogPromotionScopeFactory.php b/src/Foundry/Factory/CatalogPromotionScopeFactory.php index 0db8bbd..68142cd 100644 --- a/src/Foundry/Factory/CatalogPromotionScopeFactory.php +++ b/src/Foundry/Factory/CatalogPromotionScopeFactory.php @@ -16,8 +16,8 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; use Sylius\Component\Core\Model\CatalogPromotionScope; use Sylius\Component\Core\Model\CatalogPromotionScopeInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -30,7 +30,7 @@ * @method static CatalogPromotionScopeInterface|Proxy last(string $sortedField = 'id') * @method static CatalogPromotionScopeInterface|Proxy random(array $attributes = []) * @method static CatalogPromotionScopeInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static CatalogPromotionScopeInterface[]|Proxy[] all() * @method static CatalogPromotionScopeInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static CatalogPromotionScopeInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -44,15 +44,15 @@ final class CatalogPromotionScopeFactory extends AbstractModelFactory implements public function withType(string $type): self { - return $this->addState(['type' => $type]); + return $this->with(['type' => $type]); } public function withConfiguration(array $configuration): self { - return $this->addState(['configuration' => $configuration]); + return $this->with(['configuration' => $configuration]); } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? CatalogPromotionScope::class; } diff --git a/src/Foundry/Factory/ChannelFactory.php b/src/Foundry/Factory/ChannelFactory.php index 70186c6..4f60a98 100644 --- a/src/Foundry/Factory/ChannelFactory.php +++ b/src/Foundry/Factory/ChannelFactory.php @@ -25,8 +25,8 @@ use Sylius\Component\Core\Model\ShopBillingDataInterface; use Sylius\Component\Core\Model\TaxonInterface; use Sylius\Component\Locale\Model\LocaleInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -39,7 +39,7 @@ * @method static ChannelInterface|Proxy last(string $sortedField = 'id') * @method static ChannelInterface|Proxy random(array $attributes = []) * @method static ChannelInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static ChannelInterface[]|Proxy[] all() * @method static ChannelInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static ChannelInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -58,70 +58,70 @@ final class ChannelFactory extends AbstractModelFactory implements FactoryWithMo public function withDefaultLocale(Proxy|LocaleInterface|string $defaultLocale): self { - return $this->addState(['defaultLocale' => $defaultLocale]); + return $this->with(['defaultLocale' => $defaultLocale]); } public function withHostname(string $hostname): self { - return $this->addState(['hostname' => $hostname]); + return $this->with(['hostname' => $hostname]); } public function withColor(string $color): self { - return $this->addState(['color' => $color]); + return $this->with(['color' => $color]); } public function withSkippingShippingStepAllowed(): self { - return $this->addState(['skippingShippingStepAllowed' => true]); + return $this->with(['skippingShippingStepAllowed' => true]); } public function withSkippingPaymentStepAllowed(): self { - return $this->addState(['skippingPaymentStepAllowed' => true]); + return $this->with(['skippingPaymentStepAllowed' => true]); } public function withoutAccountVerificationRequired(): self { - return $this->addState(['accountVerificationRequired' => false]); + return $this->with(['accountVerificationRequired' => false]); } public function withDefaultTaxZone(Proxy|ZoneInterface|string $defaultTaxZone): self { - return $this->addState(['defaultTaxZone' => $defaultTaxZone]); + return $this->with(['defaultTaxZone' => $defaultTaxZone]); } public function withTaxCalculationStrategy(string $taxCalculationStrategy): self { - return $this->addState(['taxCalculationStrategy' => $taxCalculationStrategy]); + return $this->with(['taxCalculationStrategy' => $taxCalculationStrategy]); } public function withThemeName(?string $themeName): self { - return $this->addState(['themeName' => $themeName]); + return $this->with(['themeName' => $themeName]); } public function withContactEmail(string $contactEmail): self { - return $this->addState(['contactEmail' => $contactEmail]); + return $this->with(['contactEmail' => $contactEmail]); } public function withContactPhoneNumber(string $contactPhoneNumber): self { - return $this->addState(['contactPhoneNumber' => $contactPhoneNumber]); + return $this->with(['contactPhoneNumber' => $contactPhoneNumber]); } public function withShopBillingData(Proxy|ShopBillingDataInterface|array $shopBillingData): self { - return $this->addState(['shopBillingData' => $shopBillingData]); + return $this->with(['shopBillingData' => $shopBillingData]); } public function withMenuTaxon(Proxy|TaxonInterface|string $menuTaxon): self { - return $this->addState(['menuTaxon' => $menuTaxon]); + return $this->with(['menuTaxon' => $menuTaxon]); } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? Channel::class; } diff --git a/src/Foundry/Factory/CountryFactory.php b/src/Foundry/Factory/CountryFactory.php index 4197223..b72f4a8 100644 --- a/src/Foundry/Factory/CountryFactory.php +++ b/src/Foundry/Factory/CountryFactory.php @@ -18,8 +18,8 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; use Sylius\Component\Addressing\Model\Country; use Sylius\Component\Addressing\Model\CountryInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -32,7 +32,7 @@ * @method static CountryInterface|Proxy last(string $sortedField = 'id') * @method static CountryInterface|Proxy random(array $attributes = []) * @method static CountryInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static CountryInterface[]|Proxy[] all() * @method static CountryInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static CountryInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -46,7 +46,7 @@ final class CountryFactory extends AbstractModelFactory implements FactoryWithMo use WithCodeTrait; use ToggableTrait; - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? Country::class; } diff --git a/src/Foundry/Factory/CurrencyFactory.php b/src/Foundry/Factory/CurrencyFactory.php index 6d3ac28..1602ca0 100644 --- a/src/Foundry/Factory/CurrencyFactory.php +++ b/src/Foundry/Factory/CurrencyFactory.php @@ -17,8 +17,8 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; use Sylius\Component\Currency\Model\Currency; use Sylius\Component\Currency\Model\CurrencyInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -31,7 +31,7 @@ * @method static CurrencyInterface|Proxy last(string $sortedField = 'id') * @method static CurrencyInterface|Proxy random(array $attributes = []) * @method static CurrencyInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static CurrencyInterface[]|Proxy[] all() * @method static CurrencyInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static CurrencyInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -44,7 +44,7 @@ final class CurrencyFactory extends AbstractModelFactory implements FactoryWithM use WithModelClassTrait; use WithCodeTrait; - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? Currency::class; } diff --git a/src/Foundry/Factory/CustomerFactory.php b/src/Foundry/Factory/CustomerFactory.php index c2522c5..f602672 100644 --- a/src/Foundry/Factory/CustomerFactory.php +++ b/src/Foundry/Factory/CustomerFactory.php @@ -23,8 +23,8 @@ use Sylius\Bundle\CoreBundle\Doctrine\ORM\CustomerRepository; use Sylius\Component\Core\Model\Customer; use Sylius\Component\Core\Model\CustomerInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -37,7 +37,7 @@ * @method static CustomerInterface|Proxy last(string $sortedField = 'id') * @method static CustomerInterface|Proxy random(array $attributes = []) * @method static CustomerInterface|Proxy randomOrCreate(array $attributes = []) - * @method static CustomerRepository|RepositoryProxy repository() + * @method static CustomerRepository|ProxyRepositoryDecorator repository() * @method static CustomerInterface[]|Proxy[] all() * @method static CustomerInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static CustomerInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -56,7 +56,7 @@ final class CustomerFactory extends AbstractModelFactory implements FactoryWithM use WithPhoneNumberTrait; use WithBirthdayTrait; - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? Customer::class; } diff --git a/src/Foundry/Factory/CustomerGroupFactory.php b/src/Foundry/Factory/CustomerGroupFactory.php index 52d31dd..15b13f8 100644 --- a/src/Foundry/Factory/CustomerGroupFactory.php +++ b/src/Foundry/Factory/CustomerGroupFactory.php @@ -18,8 +18,8 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; use Sylius\Component\Customer\Model\CustomerGroup; use Sylius\Component\Customer\Model\CustomerGroupInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -32,7 +32,7 @@ * @method static CustomerGroupInterface|Proxy last(string $sortedField = 'id') * @method static CustomerGroupInterface|Proxy random(array $attributes = []) * @method static CustomerGroupInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static CustomerGroupInterface[]|Proxy[] all() * @method static CustomerGroupInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static CustomerGroupInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -46,7 +46,7 @@ final class CustomerGroupFactory extends AbstractModelFactory implements Factory use WithCodeTrait; use WithNameTrait; - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? CustomerGroup::class; } diff --git a/src/Foundry/Factory/LocaleFactory.php b/src/Foundry/Factory/LocaleFactory.php index fda7f00..cdab59d 100644 --- a/src/Foundry/Factory/LocaleFactory.php +++ b/src/Foundry/Factory/LocaleFactory.php @@ -17,8 +17,8 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; use Sylius\Component\Locale\Model\Locale; use Sylius\Component\Locale\Model\LocaleInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -31,7 +31,7 @@ * @method static LocaleInterface|Proxy last(string $sortedField = 'id') * @method static LocaleInterface|Proxy random(array $attributes = []) * @method static LocaleInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static LocaleInterface[]|Proxy[] all() * @method static LocaleInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static LocaleInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -44,7 +44,7 @@ final class LocaleFactory extends AbstractModelFactory implements FactoryWithMod use WithModelClassTrait; use WithCodeTrait; - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? Locale::class; } diff --git a/src/Foundry/Factory/OrderFactory.php b/src/Foundry/Factory/OrderFactory.php index 56f78b8..809522f 100644 --- a/src/Foundry/Factory/OrderFactory.php +++ b/src/Foundry/Factory/OrderFactory.php @@ -19,8 +19,8 @@ use Sylius\Bundle\CoreBundle\Doctrine\ORM\OrderRepository; use Sylius\Component\Core\Model\Order; use Sylius\Component\Core\Model\OrderInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -33,7 +33,7 @@ * @method static OrderInterface|Proxy last(string $sortedField = 'id') * @method static OrderInterface|Proxy random(array $attributes = []) * @method static OrderInterface|Proxy randomOrCreate(array $attributes = []) - * @method static OrderRepository|RepositoryProxy repository() + * @method static OrderRepository|ProxyRepositoryDecorator repository() * @method static OrderInterface[]|Proxy[] all() * @method static OrderInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static OrderInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -48,7 +48,7 @@ final class OrderFactory extends AbstractModelFactory implements FactoryWithMode use WithCustomerTrait; use WithCountryTrait; - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? Order::class; } diff --git a/src/Foundry/Factory/OrderItemFactory.php b/src/Foundry/Factory/OrderItemFactory.php index 6090160..3fa181e 100644 --- a/src/Foundry/Factory/OrderItemFactory.php +++ b/src/Foundry/Factory/OrderItemFactory.php @@ -17,8 +17,8 @@ use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Core\Model\OrderItem; use Sylius\Component\Core\Model\OrderItemInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -31,7 +31,7 @@ * @method static OrderItemInterface|Proxy last(string $sortedField = 'id') * @method static OrderItemInterface|Proxy random(array $attributes = []) * @method static OrderItemInterface|Proxy randomOrCreate(array $attributes = []) - * @method static OrderItemRepository|RepositoryProxy repository() + * @method static OrderItemRepository|ProxyRepositoryDecorator repository() * @method static OrderItemInterface[]|Proxy[] all() * @method static OrderItemInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static OrderItemInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -45,10 +45,10 @@ final class OrderItemFactory extends AbstractModelFactory implements FactoryWith public function withOrder(Proxy|OrderInterface $order): self { - return $this->addState(['order' => $order]); + return $this->with(['order' => $order]); } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? OrderItem::class; } diff --git a/src/Foundry/Factory/OrderSequenceFactory.php b/src/Foundry/Factory/OrderSequenceFactory.php index e446a77..89abc95 100644 --- a/src/Foundry/Factory/OrderSequenceFactory.php +++ b/src/Foundry/Factory/OrderSequenceFactory.php @@ -17,8 +17,8 @@ use Sylius\Component\Core\Model\OrderSequence; use Sylius\Component\Core\Model\OrderSequenceInterface; use Zenstruck\Foundry\ModelFactory; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends ModelFactory @@ -31,7 +31,7 @@ * @method static OrderSequenceInterface|Proxy last(string $sortedField = 'id') * @method static OrderSequenceInterface|Proxy random(array $attributes = []) * @method static OrderSequenceInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static OrderSequenceInterface[]|Proxy[] all() * @method static OrderSequenceInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static OrderSequenceInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -48,7 +48,7 @@ protected function getDefaults(): array return []; } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? OrderSequence::class; } diff --git a/src/Foundry/Factory/PaymentMethodFactory.php b/src/Foundry/Factory/PaymentMethodFactory.php index 2d3a90e..6823256 100644 --- a/src/Foundry/Factory/PaymentMethodFactory.php +++ b/src/Foundry/Factory/PaymentMethodFactory.php @@ -21,8 +21,8 @@ use Sylius\Bundle\CoreBundle\Doctrine\ORM\PaymentMethodRepository; use Sylius\Component\Core\Model\PaymentMethod; use Sylius\Component\Core\Model\PaymentMethodInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -35,7 +35,7 @@ * @method static PaymentMethodInterface|Proxy last(string $sortedField = 'id') * @method static PaymentMethodInterface|Proxy random(array $attributes = []) * @method static PaymentMethodInterface|Proxy randomOrCreate(array $attributes = []) - * @method static PaymentMethodRepository|RepositoryProxy repository() + * @method static PaymentMethodRepository|ProxyRepositoryDecorator repository() * @method static PaymentMethodInterface[]|Proxy[] all() * @method static PaymentMethodInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static PaymentMethodInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -54,25 +54,25 @@ final class PaymentMethodFactory extends AbstractModelFactory implements Factory public function withInstructions(string $instructions): self { - return $this->addState(['instructions' => $instructions]); + return $this->with(['instructions' => $instructions]); } public function withGatewayName(string $gatewayName): self { - return $this->addState(['gatewayName' => $gatewayName]); + return $this->with(['gatewayName' => $gatewayName]); } public function withGatewayFactory(string $gatewayFactory): self { - return $this->addState(['gatewayFactory' => $gatewayFactory]); + return $this->with(['gatewayFactory' => $gatewayFactory]); } public function withGatewayConfig(array $gatewayConfig): self { - return $this->addState(['gatewayConfig' => $gatewayConfig]); + return $this->with(['gatewayConfig' => $gatewayConfig]); } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? PaymentMethod::class; } diff --git a/src/Foundry/Factory/ProductAssociationFactory.php b/src/Foundry/Factory/ProductAssociationFactory.php index f5b75d0..f3e0c3b 100644 --- a/src/Foundry/Factory/ProductAssociationFactory.php +++ b/src/Foundry/Factory/ProductAssociationFactory.php @@ -18,8 +18,8 @@ use Sylius\Component\Product\Model\ProductAssociation; use Sylius\Component\Product\Model\ProductAssociationInterface; use Sylius\Component\Product\Model\ProductAssociationTypeInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -32,7 +32,7 @@ * @method static ProductAssociationInterface|Proxy last(string $sortedField = 'id') * @method static ProductAssociationInterface|Proxy random(array $attributes = []) * @method static ProductAssociationInterface|Proxy randomOrCreate(array $attributes = []) - * @method static ProductAssociationRepository|RepositoryProxy repository() + * @method static ProductAssociationRepository|ProxyRepositoryDecorator repository() * @method static ProductAssociationInterface[]|Proxy[] all() * @method static ProductAssociationInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static ProductAssociationInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -46,20 +46,20 @@ final class ProductAssociationFactory extends AbstractModelFactory implements Fa public function withType(Proxy|ProductAssociationTypeInterface|string $type): self { - return $this->addState(['type' => $type]); + return $this->with(['type' => $type]); } public function withOwner(Proxy|ProductInterface|string $owner): self { - return $this->addState(['owner' => $owner]); + return $this->with(['owner' => $owner]); } public function withAssociatedProducts(array $associatedProducts): self { - return $this->addState(['associatedProducts' => $associatedProducts]); + return $this->with(['associatedProducts' => $associatedProducts]); } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? ProductAssociation::class; } diff --git a/src/Foundry/Factory/ProductAssociationTypeFactory.php b/src/Foundry/Factory/ProductAssociationTypeFactory.php index fc31989..1849f4d 100644 --- a/src/Foundry/Factory/ProductAssociationTypeFactory.php +++ b/src/Foundry/Factory/ProductAssociationTypeFactory.php @@ -18,8 +18,8 @@ use Sylius\Bundle\ProductBundle\Doctrine\ORM\ProductAssociationTypeRepository; use Sylius\Component\Product\Model\ProductAssociationType; use Sylius\Component\Product\Model\ProductAssociationTypeInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -32,7 +32,7 @@ * @method static ProductAssociationTypeInterface|Proxy last(string $sortedField = 'id') * @method static ProductAssociationTypeInterface|Proxy random(array $attributes = []) * @method static ProductAssociationTypeInterface|Proxy randomOrCreate(array $attributes = []) - * @method static ProductAssociationTypeRepository|RepositoryProxy repository() + * @method static ProductAssociationTypeRepository|ProxyRepositoryDecorator repository() * @method static ProductAssociationTypeInterface[]|Proxy[] all() * @method static ProductAssociationTypeInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static ProductAssociationTypeInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -46,7 +46,7 @@ final class ProductAssociationTypeFactory extends AbstractModelFactory implement use WithCodeTrait; use WithNameTrait; - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? ProductAssociationType::class; } diff --git a/src/Foundry/Factory/ProductAttributeFactory.php b/src/Foundry/Factory/ProductAttributeFactory.php index 46d3370..cb8a70e 100644 --- a/src/Foundry/Factory/ProductAttributeFactory.php +++ b/src/Foundry/Factory/ProductAttributeFactory.php @@ -21,8 +21,8 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; use Sylius\Component\Product\Model\ProductAttribute; use Sylius\Component\Product\Model\ProductAttributeInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -35,7 +35,7 @@ * @method static ProductAttributeInterface|Proxy last(string $sortedField = 'id') * @method static ProductAttributeInterface|Proxy random(array $attributes = []) * @method static ProductAttributeInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static ProductAttributeInterface[]|Proxy[] all() * @method static ProductAttributeInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static ProductAttributeInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -52,7 +52,7 @@ final class ProductAttributeFactory extends AbstractModelFactory implements Fact use TranslatableTrait; use WithConfigurationTrait; - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? ProductAttribute::class; } diff --git a/src/Foundry/Factory/ProductFactory.php b/src/Foundry/Factory/ProductFactory.php index 79ad648..bfb9845 100644 --- a/src/Foundry/Factory/ProductFactory.php +++ b/src/Foundry/Factory/ProductFactory.php @@ -28,8 +28,8 @@ use Sylius\Component\Core\Model\Product; use Sylius\Component\Core\Model\ProductInterface; use Sylius\Component\Core\Model\TaxonInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -42,7 +42,7 @@ * @method static ProductInterface|Proxy last(string $sortedField = 'id') * @method static ProductInterface|Proxy random(array $attributes = []) * @method static ProductInterface|Proxy randomOrCreate(array $attributes = []) - * @method static ProductRepository|RepositoryProxy repository() + * @method static ProductRepository|ProxyRepositoryDecorator repository() * @method static ProductInterface[]|Proxy[] all() * @method static ProductInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static ProductInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -67,40 +67,40 @@ final class ProductFactory extends AbstractModelFactory implements FactoryWithMo public function tracked(): self { - return $this->addState(['tracked' => true]); + return $this->with(['tracked' => true]); } public function untracked(): self { - return $this->addState(['tracked' => false]); + return $this->with(['tracked' => false]); } public function withShippingRequired(): self { - return $this->addState(['shippingRequired' => true]); + return $this->with(['shippingRequired' => true]); } public function withShippingNotRequired(): self { - return $this->addState(['shippingRequired' => false]); + return $this->with(['shippingRequired' => false]); } public function withVariantSelectionMethod(string $variantSelectionMethod): self { - return $this->addState(['variantSelectionMethod' => $variantSelectionMethod]); + return $this->with(['variantSelectionMethod' => $variantSelectionMethod]); } public function withMainTaxon(Proxy|TaxonInterface|string $mainTaxon): self { - return $this->addState(['mainTaxon' => $mainTaxon]); + return $this->with(['mainTaxon' => $mainTaxon]); } public function withProductOptions(array $productOptions): self { - return $this->addState(['productOptions' => $productOptions]); + return $this->with(['productOptions' => $productOptions]); } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? Product::class; } diff --git a/src/Foundry/Factory/ProductOptionFactory.php b/src/Foundry/Factory/ProductOptionFactory.php index bfdf3a5..cf992ad 100644 --- a/src/Foundry/Factory/ProductOptionFactory.php +++ b/src/Foundry/Factory/ProductOptionFactory.php @@ -18,8 +18,8 @@ use Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductOptionRepository; use Sylius\Component\Product\Model\ProductOption; use Sylius\Component\Product\Model\ProductOptionInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -32,7 +32,7 @@ * @method static ProductOptionInterface|Proxy last(string $sortedField = 'id') * @method static ProductOptionInterface|Proxy random(array $attributes = []) * @method static ProductOptionInterface|Proxy randomOrCreate(array $attributes = []) - * @method static ProductOptionRepository|RepositoryProxy repository() + * @method static ProductOptionRepository|ProxyRepositoryDecorator repository() * @method static ProductOptionInterface[]|Proxy[] all() * @method static ProductOptionInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static ProductOptionInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -48,10 +48,10 @@ final class ProductOptionFactory extends AbstractModelFactory implements Factory public function withValues(array $values): self { - return $this->addState(['values' => $values]); + return $this->with(['values' => $values]); } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? ProductOption::class; } diff --git a/src/Foundry/Factory/ProductOptionValueFactory.php b/src/Foundry/Factory/ProductOptionValueFactory.php index fc03209..cea073c 100644 --- a/src/Foundry/Factory/ProductOptionValueFactory.php +++ b/src/Foundry/Factory/ProductOptionValueFactory.php @@ -17,8 +17,8 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; use Sylius\Component\Product\Model\ProductOptionValue; use Sylius\Component\Product\Model\ProductOptionValueInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -31,7 +31,7 @@ * @method static ProductOptionValueInterface|Proxy last(string $sortedField = 'id') * @method static ProductOptionValueInterface|Proxy random(array $attributes = []) * @method static ProductOptionValueInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static ProductOptionValueInterface[]|Proxy[] all() * @method static ProductOptionValueInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static ProductOptionValueInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -44,7 +44,7 @@ final class ProductOptionValueFactory extends AbstractModelFactory implements Fa use WithModelClassTrait; use WithCodeTrait; - protected static function getClass(): string + public static function class(): string { return ProductOptionValue::class; } diff --git a/src/Foundry/Factory/ProductReviewFactory.php b/src/Foundry/Factory/ProductReviewFactory.php index 1dee102..a2e4aa3 100644 --- a/src/Foundry/Factory/ProductReviewFactory.php +++ b/src/Foundry/Factory/ProductReviewFactory.php @@ -21,8 +21,8 @@ use Sylius\Component\Core\Model\ProductReview; use Sylius\Component\Review\Model\ReviewerInterface; use Sylius\Component\Review\Model\ReviewInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -35,7 +35,7 @@ * @method static ReviewInterface|Proxy last(string $sortedField = 'id') * @method static ReviewInterface|Proxy random(array $attributes = []) * @method static ReviewInterface|Proxy randomOrCreate(array $attributes = []) - * @method static ProductReviewRepository|RepositoryProxy repository() + * @method static ProductReviewRepository|ProxyRepositoryDecorator repository() * @method static ReviewInterface[]|Proxy[] all() * @method static ReviewInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static ReviewInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -52,20 +52,20 @@ final class ProductReviewFactory extends AbstractModelFactory implements Factory public function withRating(int $rating): self { - return $this->addState(['rating' => $rating]); + return $this->with(['rating' => $rating]); } public function withAuthor(Proxy|ReviewerInterface|string $author): self { - return $this->addState(['author' => $author]); + return $this->with(['author' => $author]); } public function withReviewSubject(Proxy|ProductInterface|string $reviewSubject): self { - return $this->addState(['reviewSubject' => $reviewSubject]); + return $this->with(['reviewSubject' => $reviewSubject]); } - protected static function getClass(): string + public static function class(): string { return ProductReview::class; } diff --git a/src/Foundry/Factory/PromotionActionFactory.php b/src/Foundry/Factory/PromotionActionFactory.php index 2107ada..3e60598 100644 --- a/src/Foundry/Factory/PromotionActionFactory.php +++ b/src/Foundry/Factory/PromotionActionFactory.php @@ -16,8 +16,8 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; use Sylius\Component\Promotion\Model\PromotionAction; use Sylius\Component\Promotion\Model\PromotionActionInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -30,7 +30,7 @@ * @method static PromotionActionInterface|Proxy last(string $sortedField = 'id') * @method static PromotionActionInterface|Proxy random(array $attributes = []) * @method static PromotionActionInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static PromotionActionInterface[]|Proxy[] all() * @method static PromotionActionInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static PromotionActionInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -44,15 +44,15 @@ final class PromotionActionFactory extends AbstractModelFactory implements Facto public function withType(string $type): self { - return $this->addState(['type' => $type]); + return $this->with(['type' => $type]); } public function withConfiguration(array $configuration): self { - return $this->addState(['configuration' => $configuration]); + return $this->with(['configuration' => $configuration]); } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? PromotionAction::class; } diff --git a/src/Foundry/Factory/PromotionCouponFactory.php b/src/Foundry/Factory/PromotionCouponFactory.php index 6688fba..4df71de 100644 --- a/src/Foundry/Factory/PromotionCouponFactory.php +++ b/src/Foundry/Factory/PromotionCouponFactory.php @@ -16,8 +16,8 @@ use Sylius\Bundle\PromotionBundle\Doctrine\ORM\PromotionCouponRepository; use Sylius\Component\Core\Model\PromotionCoupon; use Sylius\Component\Core\Model\PromotionCouponInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -30,7 +30,7 @@ * @method static PromotionCouponInterface|Proxy last(string $sortedField = 'id') * @method static PromotionCouponInterface|Proxy random(array $attributes = []) * @method static PromotionCouponInterface|Proxy randomOrCreate(array $attributes = []) - * @method static PromotionCouponRepository|RepositoryProxy repository() + * @method static PromotionCouponRepository|ProxyRepositoryDecorator repository() * @method static PromotionCouponInterface[]|Proxy[] all() * @method static PromotionCouponInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static PromotionCouponInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -42,7 +42,7 @@ final class PromotionCouponFactory extends AbstractModelFactory implements Facto { use WithModelClassTrait; - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? PromotionCoupon::class; } diff --git a/src/Foundry/Factory/PromotionFactory.php b/src/Foundry/Factory/PromotionFactory.php index d346f93..411bdf3 100644 --- a/src/Foundry/Factory/PromotionFactory.php +++ b/src/Foundry/Factory/PromotionFactory.php @@ -20,8 +20,8 @@ use Akawakaweb\SyliusFixturesPlugin\Foundry\Factory\State\WithPriorityTrait; use Doctrine\ORM\EntityRepository; use Sylius\Component\Core\Model\Promotion; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -34,7 +34,7 @@ * @method static Promotion|Proxy last(string $sortedField = 'id') * @method static Promotion|Proxy random(array $attributes = []) * @method static Promotion|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static Promotion[]|Proxy[] all() * @method static Promotion[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static Promotion[]|Proxy[] createSequence(iterable|callable $sequence) @@ -53,52 +53,52 @@ final class PromotionFactory extends AbstractModelFactory implements FactoryWith public function withUsageLimit(int $usageLimit): self { - return $this->addState(['usageLimit' => $usageLimit]); + return $this->with(['usageLimit' => $usageLimit]); } public function couponBased(): self { - return $this->addState(['couponBased' => true]); + return $this->with(['couponBased' => true]); } public function notCouponBased(): self { - return $this->addState(['couponBased' => false]); + return $this->with(['couponBased' => false]); } public function exclusive(): self { - return $this->addState(['exclusive' => true]); + return $this->with(['exclusive' => true]); } public function notExclusive(): self { - return $this->addState(['exclusive' => false]); + return $this->with(['exclusive' => false]); } public function withStartDate(\DateTimeInterface|string $startAt): self { - return $this->addState(['startsAt' => $startAt]); + return $this->with(['startsAt' => $startAt]); } public function withEndDate(\DateTimeInterface|string $endAt): self { - return $this->addState(['endsAt' => $endAt]); + return $this->with(['endsAt' => $endAt]); } public function withRules(array $rules): self { - return $this->addState(['rules' => $rules]); + return $this->with(['rules' => $rules]); } public function withActions(array $actions): self { - return $this->addState(['actions' => $actions]); + return $this->with(['actions' => $actions]); } public function withCoupons(array $coupons): self { - return $this->addState(['coupons' => $coupons]); + return $this->with(['coupons' => $coupons]); } protected function getDefaults(): array @@ -115,7 +115,7 @@ protected function getDefaults(): array ]; } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? Promotion::class; } diff --git a/src/Foundry/Factory/PromotionRuleFactory.php b/src/Foundry/Factory/PromotionRuleFactory.php index 2c72be9..8ebe1bb 100644 --- a/src/Foundry/Factory/PromotionRuleFactory.php +++ b/src/Foundry/Factory/PromotionRuleFactory.php @@ -16,8 +16,8 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; use Sylius\Component\Promotion\Model\PromotionRule; use Sylius\Component\Promotion\Model\PromotionRuleInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -30,7 +30,7 @@ * @method static PromotionRuleInterface|Proxy last(string $sortedField = 'id') * @method static PromotionRuleInterface|Proxy random(array $attributes = []) * @method static PromotionRuleInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static PromotionRuleInterface[]|Proxy[] all() * @method static PromotionRuleInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static PromotionRuleInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -44,15 +44,15 @@ final class PromotionRuleFactory extends AbstractModelFactory implements Factory public function withType(string $type): self { - return $this->addState(['type' => $type]); + return $this->with(['type' => $type]); } public function withConfiguration(array $configuration): self { - return $this->addState(['configuration' => $configuration]); + return $this->with(['configuration' => $configuration]); } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? PromotionRule::class; } diff --git a/src/Foundry/Factory/ShippingCategoryFactory.php b/src/Foundry/Factory/ShippingCategoryFactory.php index 1677f4b..8a8233a 100644 --- a/src/Foundry/Factory/ShippingCategoryFactory.php +++ b/src/Foundry/Factory/ShippingCategoryFactory.php @@ -19,8 +19,8 @@ use Sylius\Bundle\CoreBundle\Doctrine\ORM\ShippingCategoryRepository; use Sylius\Component\Shipping\Model\ShippingCategory; use Sylius\Component\Shipping\Model\ShippingCategoryInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -33,7 +33,7 @@ * @method static ShippingCategoryInterface|Proxy last(string $sortedField = 'id') * @method static ShippingCategoryInterface|Proxy random(array $attributes = []) * @method static ShippingCategoryInterface|Proxy randomOrCreate(array $attributes = []) - * @method static ShippingCategoryRepository|RepositoryProxy repository() + * @method static ShippingCategoryRepository|ProxyRepositoryDecorator repository() * @method static ShippingCategoryInterface[]|Proxy[] all() * @method static ShippingCategoryInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static ShippingCategoryInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -48,7 +48,7 @@ final class ShippingCategoryFactory extends AbstractModelFactory implements Fact use WithNameTrait; use WithDescriptionTrait; - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? ShippingCategory::class; } diff --git a/src/Foundry/Factory/ShippingMethodFactory.php b/src/Foundry/Factory/ShippingMethodFactory.php index f828cac..3fe2d98 100644 --- a/src/Foundry/Factory/ShippingMethodFactory.php +++ b/src/Foundry/Factory/ShippingMethodFactory.php @@ -24,8 +24,8 @@ use Sylius\Component\Core\Model\ShippingMethod; use Sylius\Component\Core\Model\ShippingMethodInterface; use Sylius\Component\Shipping\Model\ShippingCategoryInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -38,7 +38,7 @@ * @method static ShippingMethodInterface|Proxy last(string $sortedField = 'id') * @method static ShippingMethodInterface|Proxy random(array $attributes = []) * @method static ShippingMethodInterface|Proxy randomOrCreate(array $attributes = []) - * @method static ShippingMethodRepository|RepositoryProxy repository() + * @method static ShippingMethodRepository|ProxyRepositoryDecorator repository() * @method static ShippingMethodInterface[]|Proxy[] all() * @method static ShippingMethodInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static ShippingMethodInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -59,15 +59,15 @@ final class ShippingMethodFactory extends AbstractModelFactory implements Factor public function withCategory(Proxy|ShippingCategoryInterface|string $category): self { - return $this->addState(['category' => $category]); + return $this->with(['category' => $category]); } public function withArchiveDate(\DateTimeInterface $archivedAt): self { - return $this->addState(['archivedAt' => $archivedAt]); + return $this->with(['archivedAt' => $archivedAt]); } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? ShippingMethod::class; } diff --git a/src/Foundry/Factory/ShopBillingDataFactory.php b/src/Foundry/Factory/ShopBillingDataFactory.php index c23daaf..8a767d7 100644 --- a/src/Foundry/Factory/ShopBillingDataFactory.php +++ b/src/Foundry/Factory/ShopBillingDataFactory.php @@ -16,8 +16,8 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; use Sylius\Component\Core\Model\ShopBillingData; use Sylius\Component\Core\Model\ShopBillingDataInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -30,7 +30,7 @@ * @method static ShopBillingDataInterface|Proxy last(string $sortedField = 'id') * @method static ShopBillingDataInterface|Proxy random(array $attributes = []) * @method static ShopBillingDataInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static ShopBillingDataInterface[]|Proxy[] all() * @method static ShopBillingDataInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static ShopBillingDataInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -44,32 +44,32 @@ final class ShopBillingDataFactory extends AbstractModelFactory implements Facto public function withCompany(string $company): self { - return $this->addState(['company' => $company]); + return $this->with(['company' => $company]); } public function withTaxId(string $taxId): self { - return $this->addState(['taxId' => $taxId]); + return $this->with(['taxId' => $taxId]); } public function withCountryCode(string $countryCode): self { - return $this->addState(['countryCode' => $countryCode]); + return $this->with(['countryCode' => $countryCode]); } public function withStreet(string $street): self { - return $this->addState(['street' => $street]); + return $this->with(['street' => $street]); } public function withCity(string $city): self { - return $this->addState(['city' => $city]); + return $this->with(['city' => $city]); } public function withPostcode(string $postcode): self { - return $this->addState(['postcode' => $postcode]); + return $this->with(['postcode' => $postcode]); } protected function getDefaults(): array @@ -77,7 +77,7 @@ protected function getDefaults(): array return []; } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? ShopBillingData::class; } diff --git a/src/Foundry/Factory/ShopUserFactory.php b/src/Foundry/Factory/ShopUserFactory.php index dbdb09c..fd1c5c2 100644 --- a/src/Foundry/Factory/ShopUserFactory.php +++ b/src/Foundry/Factory/ShopUserFactory.php @@ -24,8 +24,8 @@ use Sylius\Bundle\CoreBundle\Doctrine\ORM\UserRepository; use Sylius\Component\Core\Model\ShopUser; use Sylius\Component\Core\Model\ShopUserInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -38,7 +38,7 @@ * @method static ShopUserInterface|Proxy last(string $sortedField = 'id') * @method static ShopUserInterface|Proxy random(array $attributes = []) * @method static ShopUserInterface|Proxy randomOrCreate(array $attributes = []) - * @method static UserRepository|RepositoryProxy repository() + * @method static UserRepository|ProxyRepositoryDecorator repository() * @method static ShopUserInterface[]|Proxy[] all() * @method static ShopUserInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static ShopUserInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -58,7 +58,7 @@ final class ShopUserFactory extends AbstractModelFactory implements FactoryWithM use WithPhoneNumberTrait; use WithBirthdayTrait; - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? ShopUser::class; } diff --git a/src/Foundry/Factory/State/FemaleTrait.php b/src/Foundry/Factory/State/FemaleTrait.php index d141de7..83b61cc 100644 --- a/src/Foundry/Factory/State/FemaleTrait.php +++ b/src/Foundry/Factory/State/FemaleTrait.php @@ -23,6 +23,6 @@ trait FemaleTrait { public function female(): self { - return $this->addState(['gender' => CustomerInterface::FEMALE_GENDER]); + return $this->with(['gender' => CustomerInterface::FEMALE_GENDER]); } } diff --git a/src/Foundry/Factory/State/MaleTrait.php b/src/Foundry/Factory/State/MaleTrait.php index 8c9fd92..46c54fc 100644 --- a/src/Foundry/Factory/State/MaleTrait.php +++ b/src/Foundry/Factory/State/MaleTrait.php @@ -23,6 +23,6 @@ trait MaleTrait { public function male(): self { - return $this->addState(['gender' => CustomerInterface::MALE_GENDER]); + return $this->with(['gender' => CustomerInterface::MALE_GENDER]); } } diff --git a/src/Foundry/Factory/State/ToggableTrait.php b/src/Foundry/Factory/State/ToggableTrait.php index 79ed008..bc54f53 100644 --- a/src/Foundry/Factory/State/ToggableTrait.php +++ b/src/Foundry/Factory/State/ToggableTrait.php @@ -22,11 +22,11 @@ trait ToggableTrait { public function enabled(): self { - return $this->addState(['enabled' => true]); + return $this->with(['enabled' => true]); } public function disabled(): self { - return $this->addState(['enabled' => false]); + return $this->with(['enabled' => false]); } } diff --git a/src/Foundry/Factory/State/TranslatableTrait.php b/src/Foundry/Factory/State/TranslatableTrait.php index 182c3c6..557d71d 100644 --- a/src/Foundry/Factory/State/TranslatableTrait.php +++ b/src/Foundry/Factory/State/TranslatableTrait.php @@ -22,11 +22,11 @@ trait TranslatableTrait { public function translatable(): self { - return $this->addState(['translatable' => true]); + return $this->with(['translatable' => true]); } public function untranslatable(): self { - return $this->addState(['translatable' => false]); + return $this->with(['translatable' => false]); } } diff --git a/src/Foundry/Factory/State/WithAvatarTrait.php b/src/Foundry/Factory/State/WithAvatarTrait.php index a8da35a..7e694b2 100644 --- a/src/Foundry/Factory/State/WithAvatarTrait.php +++ b/src/Foundry/Factory/State/WithAvatarTrait.php @@ -22,6 +22,6 @@ trait WithAvatarTrait { public function withAvatar(string $avatar): self { - return $this->addState(['avatar' => $avatar]); + return $this->with(['avatar' => $avatar]); } } diff --git a/src/Foundry/Factory/State/WithBirthdayTrait.php b/src/Foundry/Factory/State/WithBirthdayTrait.php index ba5ae45..69da529 100644 --- a/src/Foundry/Factory/State/WithBirthdayTrait.php +++ b/src/Foundry/Factory/State/WithBirthdayTrait.php @@ -22,6 +22,6 @@ trait WithBirthdayTrait { public function withBirthday(\DateTimeInterface|string $birthday): self { - return $this->addState(['birthday' => $birthday]); + return $this->with(['birthday' => $birthday]); } } diff --git a/src/Foundry/Factory/State/WithChannelTrait.php b/src/Foundry/Factory/State/WithChannelTrait.php index e85c744..0c08489 100644 --- a/src/Foundry/Factory/State/WithChannelTrait.php +++ b/src/Foundry/Factory/State/WithChannelTrait.php @@ -15,7 +15,7 @@ use Sylius\Component\Core\Model\ChannelInterface; use Zenstruck\Foundry\ModelFactory; -use Zenstruck\Foundry\Proxy; +use Zenstruck\Foundry\Persistence\Proxy; /** * @mixin ModelFactory @@ -24,6 +24,6 @@ trait WithChannelTrait { public function withChannel(Proxy|ChannelInterface|string $channel): self { - return $this->addState(['channel' => $channel]); + return $this->with(['channel' => $channel]); } } diff --git a/src/Foundry/Factory/State/WithChannelsTrait.php b/src/Foundry/Factory/State/WithChannelsTrait.php index e857374..093383f 100644 --- a/src/Foundry/Factory/State/WithChannelsTrait.php +++ b/src/Foundry/Factory/State/WithChannelsTrait.php @@ -22,6 +22,6 @@ trait WithChannelsTrait { public function withChannels(array $channels): self { - return $this->addState(['channels' => $channels]); + return $this->with(['channels' => $channels]); } } diff --git a/src/Foundry/Factory/State/WithCodeTrait.php b/src/Foundry/Factory/State/WithCodeTrait.php index da458b7..2bd54ce 100644 --- a/src/Foundry/Factory/State/WithCodeTrait.php +++ b/src/Foundry/Factory/State/WithCodeTrait.php @@ -22,11 +22,11 @@ trait WithCodeTrait { public function withCode(string $code): self { - return $this->addState(['code' => $code]); + return $this->with(['code' => $code]); } public function withValue(string $value): self { - return $this->addState(['value' => $value]); + return $this->with(['value' => $value]); } } diff --git a/src/Foundry/Factory/State/WithCommentTrait.php b/src/Foundry/Factory/State/WithCommentTrait.php index 6db3241..f67cda7 100644 --- a/src/Foundry/Factory/State/WithCommentTrait.php +++ b/src/Foundry/Factory/State/WithCommentTrait.php @@ -22,6 +22,6 @@ trait WithCommentTrait { public function withComment(string $comment): self { - return $this->addState(['comment' => $comment]); + return $this->with(['comment' => $comment]); } } diff --git a/src/Foundry/Factory/State/WithConfigurationTrait.php b/src/Foundry/Factory/State/WithConfigurationTrait.php index 475be8e..8bada2f 100644 --- a/src/Foundry/Factory/State/WithConfigurationTrait.php +++ b/src/Foundry/Factory/State/WithConfigurationTrait.php @@ -22,6 +22,6 @@ trait WithConfigurationTrait { public function withConfiguration(array $configuration): self { - return $this->addState(['configuration' => $configuration]); + return $this->with(['configuration' => $configuration]); } } diff --git a/src/Foundry/Factory/State/WithCountryTrait.php b/src/Foundry/Factory/State/WithCountryTrait.php index f040836..28b086c 100644 --- a/src/Foundry/Factory/State/WithCountryTrait.php +++ b/src/Foundry/Factory/State/WithCountryTrait.php @@ -15,7 +15,7 @@ use Sylius\Component\Addressing\Model\CountryInterface; use Zenstruck\Foundry\ModelFactory; -use Zenstruck\Foundry\Proxy; +use Zenstruck\Foundry\Persistence\Proxy; /** * @mixin ModelFactory @@ -24,6 +24,6 @@ trait WithCountryTrait { public function withCountry(Proxy|CountryInterface|string $country): self { - return $this->addState(['country' => $country]); + return $this->with(['country' => $country]); } } diff --git a/src/Foundry/Factory/State/WithCurrenciesTrait.php b/src/Foundry/Factory/State/WithCurrenciesTrait.php index 7c8bf24..aaf5d02 100644 --- a/src/Foundry/Factory/State/WithCurrenciesTrait.php +++ b/src/Foundry/Factory/State/WithCurrenciesTrait.php @@ -22,6 +22,6 @@ trait WithCurrenciesTrait { public function withCurrencies(array $currencies): self { - return $this->addState(['currencies' => $currencies]); + return $this->with(['currencies' => $currencies]); } } diff --git a/src/Foundry/Factory/State/WithCustomerTrait.php b/src/Foundry/Factory/State/WithCustomerTrait.php index 6e729bf..d5fdf2b 100644 --- a/src/Foundry/Factory/State/WithCustomerTrait.php +++ b/src/Foundry/Factory/State/WithCustomerTrait.php @@ -15,7 +15,7 @@ use Sylius\Component\Core\Model\CustomerInterface; use Zenstruck\Foundry\ModelFactory; -use Zenstruck\Foundry\Proxy; +use Zenstruck\Foundry\Persistence\Proxy; /** * @mixin ModelFactory @@ -24,6 +24,6 @@ trait WithCustomerTrait { public function withCustomer(Proxy|CustomerInterface|string $customer): self { - return $this->addState(['customer' => $customer]); + return $this->with(['customer' => $customer]); } } diff --git a/src/Foundry/Factory/State/WithDescriptionTrait.php b/src/Foundry/Factory/State/WithDescriptionTrait.php index f2c401a..6bfced2 100644 --- a/src/Foundry/Factory/State/WithDescriptionTrait.php +++ b/src/Foundry/Factory/State/WithDescriptionTrait.php @@ -22,6 +22,6 @@ trait WithDescriptionTrait { public function withDescription(string $description): self { - return $this->addState(['description' => $description]); + return $this->with(['description' => $description]); } } diff --git a/src/Foundry/Factory/State/WithEmailTrait.php b/src/Foundry/Factory/State/WithEmailTrait.php index ab8524a..fd7e36e 100644 --- a/src/Foundry/Factory/State/WithEmailTrait.php +++ b/src/Foundry/Factory/State/WithEmailTrait.php @@ -22,6 +22,6 @@ trait WithEmailTrait { public function withEmail(string $email): self { - return $this->addState(['email' => $email]); + return $this->with(['email' => $email]); } } diff --git a/src/Foundry/Factory/State/WithFirstNameTrait.php b/src/Foundry/Factory/State/WithFirstNameTrait.php index 4d7479a..0f5aee4 100644 --- a/src/Foundry/Factory/State/WithFirstNameTrait.php +++ b/src/Foundry/Factory/State/WithFirstNameTrait.php @@ -22,6 +22,6 @@ trait WithFirstNameTrait { public function withFirstName(string $firstName): self { - return $this->addState(['firstName' => $firstName]); + return $this->with(['firstName' => $firstName]); } } diff --git a/src/Foundry/Factory/State/WithImagesTrait.php b/src/Foundry/Factory/State/WithImagesTrait.php index 5bc4fe1..4dc5ee8 100644 --- a/src/Foundry/Factory/State/WithImagesTrait.php +++ b/src/Foundry/Factory/State/WithImagesTrait.php @@ -22,6 +22,6 @@ trait WithImagesTrait { public function withImages(array $images): self { - return $this->addState(['images' => $images]); + return $this->with(['images' => $images]); } } diff --git a/src/Foundry/Factory/State/WithLastNameTrait.php b/src/Foundry/Factory/State/WithLastNameTrait.php index c5ed54b..6817658 100644 --- a/src/Foundry/Factory/State/WithLastNameTrait.php +++ b/src/Foundry/Factory/State/WithLastNameTrait.php @@ -22,6 +22,6 @@ trait WithLastNameTrait { public function withLastName(string $lastName): self { - return $this->addState(['lastName' => $lastName]); + return $this->with(['lastName' => $lastName]); } } diff --git a/src/Foundry/Factory/State/WithLocaleCodeTrait.php b/src/Foundry/Factory/State/WithLocaleCodeTrait.php index 6bdc3b4..ac1bc7f 100644 --- a/src/Foundry/Factory/State/WithLocaleCodeTrait.php +++ b/src/Foundry/Factory/State/WithLocaleCodeTrait.php @@ -22,6 +22,6 @@ trait WithLocaleCodeTrait { public function withLocaleCode(string $localeCode): self { - return $this->addState(['localeCode' => $localeCode]); + return $this->with(['localeCode' => $localeCode]); } } diff --git a/src/Foundry/Factory/State/WithLocalesTrait.php b/src/Foundry/Factory/State/WithLocalesTrait.php index 8e0b5da..f54d7e1 100644 --- a/src/Foundry/Factory/State/WithLocalesTrait.php +++ b/src/Foundry/Factory/State/WithLocalesTrait.php @@ -22,6 +22,6 @@ trait WithLocalesTrait { public function withLocales(array $locales): self { - return $this->addState(['locales' => $locales]); + return $this->with(['locales' => $locales]); } } diff --git a/src/Foundry/Factory/State/WithNameTrait.php b/src/Foundry/Factory/State/WithNameTrait.php index c0f56f0..de78b99 100644 --- a/src/Foundry/Factory/State/WithNameTrait.php +++ b/src/Foundry/Factory/State/WithNameTrait.php @@ -22,6 +22,6 @@ trait WithNameTrait { public function withName(string $name): self { - return $this->addState(['name' => $name]); + return $this->with(['name' => $name]); } } diff --git a/src/Foundry/Factory/State/WithPasswordTrait.php b/src/Foundry/Factory/State/WithPasswordTrait.php index 480d13f..a3383af 100644 --- a/src/Foundry/Factory/State/WithPasswordTrait.php +++ b/src/Foundry/Factory/State/WithPasswordTrait.php @@ -22,6 +22,6 @@ trait WithPasswordTrait { public function withPassword(string $password): self { - return $this->addState(['password' => $password]); + return $this->with(['password' => $password]); } } diff --git a/src/Foundry/Factory/State/WithPhoneNumberTrait.php b/src/Foundry/Factory/State/WithPhoneNumberTrait.php index b25cfeb..5eaa3dc 100644 --- a/src/Foundry/Factory/State/WithPhoneNumberTrait.php +++ b/src/Foundry/Factory/State/WithPhoneNumberTrait.php @@ -22,6 +22,6 @@ trait WithPhoneNumberTrait { public function withPhoneNumber(?string $phoneNumber = null): self { - return $this->addState(['phoneNumber' => $phoneNumber ?? self::faker()->phoneNumber()]); + return $this->with(['phoneNumber' => $phoneNumber ?? self::faker()->phoneNumber()]); } } diff --git a/src/Foundry/Factory/State/WithPriorityTrait.php b/src/Foundry/Factory/State/WithPriorityTrait.php index d535d34..7f8c9bc 100644 --- a/src/Foundry/Factory/State/WithPriorityTrait.php +++ b/src/Foundry/Factory/State/WithPriorityTrait.php @@ -22,6 +22,6 @@ trait WithPriorityTrait { public function withPriority(int $priority): self { - return $this->addState(['priority' => $priority]); + return $this->with(['priority' => $priority]); } } diff --git a/src/Foundry/Factory/State/WithProductAttributesTrait.php b/src/Foundry/Factory/State/WithProductAttributesTrait.php index fc0efd0..44352d0 100644 --- a/src/Foundry/Factory/State/WithProductAttributesTrait.php +++ b/src/Foundry/Factory/State/WithProductAttributesTrait.php @@ -22,6 +22,6 @@ trait WithProductAttributesTrait { public function withProductAttributes(array $productAttributes): self { - return $this->addState(['productAttributes' => $productAttributes]); + return $this->with(['productAttributes' => $productAttributes]); } } diff --git a/src/Foundry/Factory/State/WithShortDescriptionTrait.php b/src/Foundry/Factory/State/WithShortDescriptionTrait.php index da92c33..a420b06 100644 --- a/src/Foundry/Factory/State/WithShortDescriptionTrait.php +++ b/src/Foundry/Factory/State/WithShortDescriptionTrait.php @@ -22,6 +22,6 @@ trait WithShortDescriptionTrait { public function withShortDescription(string $shortDescription): self { - return $this->addState(['shortDescription' => $shortDescription]); + return $this->with(['shortDescription' => $shortDescription]); } } diff --git a/src/Foundry/Factory/State/WithSlugTrait.php b/src/Foundry/Factory/State/WithSlugTrait.php index 67a6d3d..d4e5064 100644 --- a/src/Foundry/Factory/State/WithSlugTrait.php +++ b/src/Foundry/Factory/State/WithSlugTrait.php @@ -22,6 +22,6 @@ trait WithSlugTrait { public function withSlug(string $slug): self { - return $this->addState(['slug' => $slug]); + return $this->with(['slug' => $slug]); } } diff --git a/src/Foundry/Factory/State/WithStatusTrait.php b/src/Foundry/Factory/State/WithStatusTrait.php index 2e8e24c..ffc1f71 100644 --- a/src/Foundry/Factory/State/WithStatusTrait.php +++ b/src/Foundry/Factory/State/WithStatusTrait.php @@ -22,6 +22,6 @@ trait WithStatusTrait { public function withStatus(string $status): self { - return $this->addState(['status' => $status]); + return $this->with(['status' => $status]); } } diff --git a/src/Foundry/Factory/State/WithTaxCategoryTrait.php b/src/Foundry/Factory/State/WithTaxCategoryTrait.php index 3a93bf0..910fdae 100644 --- a/src/Foundry/Factory/State/WithTaxCategoryTrait.php +++ b/src/Foundry/Factory/State/WithTaxCategoryTrait.php @@ -15,7 +15,7 @@ use Sylius\Component\Taxation\Model\TaxCategoryInterface; use Zenstruck\Foundry\ModelFactory; -use Zenstruck\Foundry\Proxy; +use Zenstruck\Foundry\Persistence\Proxy; /** * @mixin ModelFactory @@ -24,6 +24,6 @@ trait WithTaxCategoryTrait { public function withTaxCategory(Proxy|TaxCategoryInterface|string $taxCategory): self { - return $this->addState(['taxCategory' => $taxCategory]); + return $this->with(['taxCategory' => $taxCategory]); } } diff --git a/src/Foundry/Factory/State/WithTaxaTrait.php b/src/Foundry/Factory/State/WithTaxaTrait.php index e6b5604..7025c2e 100644 --- a/src/Foundry/Factory/State/WithTaxaTrait.php +++ b/src/Foundry/Factory/State/WithTaxaTrait.php @@ -22,6 +22,6 @@ trait WithTaxaTrait { public function withTaxa(array $taxa): self { - return $this->addState(['taxa' => $taxa]); + return $this->with(['taxa' => $taxa]); } } diff --git a/src/Foundry/Factory/State/WithTitleTrait.php b/src/Foundry/Factory/State/WithTitleTrait.php index 28cfc36..eac25c4 100644 --- a/src/Foundry/Factory/State/WithTitleTrait.php +++ b/src/Foundry/Factory/State/WithTitleTrait.php @@ -22,6 +22,6 @@ trait WithTitleTrait { public function withTitle(string $title): self { - return $this->addState(['title' => $title]); + return $this->with(['title' => $title]); } } diff --git a/src/Foundry/Factory/State/WithTypeTrait.php b/src/Foundry/Factory/State/WithTypeTrait.php index d48b8eb..0d3671a 100644 --- a/src/Foundry/Factory/State/WithTypeTrait.php +++ b/src/Foundry/Factory/State/WithTypeTrait.php @@ -22,6 +22,6 @@ trait WithTypeTrait { public function withType(string $type): self { - return $this->addState(['type' => $type]); + return $this->with(['type' => $type]); } } diff --git a/src/Foundry/Factory/State/WithUsernameTrait.php b/src/Foundry/Factory/State/WithUsernameTrait.php index 3242431..cd7358a 100644 --- a/src/Foundry/Factory/State/WithUsernameTrait.php +++ b/src/Foundry/Factory/State/WithUsernameTrait.php @@ -22,6 +22,6 @@ trait WithUsernameTrait { public function withUsername(string $username): self { - return $this->addState(['username' => $username]); + return $this->with(['username' => $username]); } } diff --git a/src/Foundry/Factory/State/WithZoneTrait.php b/src/Foundry/Factory/State/WithZoneTrait.php index fb15ade..c51a192 100644 --- a/src/Foundry/Factory/State/WithZoneTrait.php +++ b/src/Foundry/Factory/State/WithZoneTrait.php @@ -15,7 +15,7 @@ use Sylius\Component\Addressing\Model\ZoneInterface; use Zenstruck\Foundry\ModelFactory; -use Zenstruck\Foundry\Proxy; +use Zenstruck\Foundry\Persistence\Proxy; /** * @mixin ModelFactory @@ -24,6 +24,6 @@ trait WithZoneTrait { public function withZone(Proxy|ZoneInterface|string $zone): self { - return $this->addState(['zone' => $zone]); + return $this->with(['zone' => $zone]); } } diff --git a/src/Foundry/Factory/TaxCategoryFactory.php b/src/Foundry/Factory/TaxCategoryFactory.php index f8ddeb8..1981054 100644 --- a/src/Foundry/Factory/TaxCategoryFactory.php +++ b/src/Foundry/Factory/TaxCategoryFactory.php @@ -19,8 +19,8 @@ use Doctrine\ORM\EntityRepository; use Sylius\Component\Taxation\Model\TaxCategory; use Sylius\Component\Taxation\Model\TaxCategoryInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -33,7 +33,7 @@ * @method static TaxCategoryInterface|Proxy last(string $sortedField = 'id') * @method static TaxCategoryInterface|Proxy random(array $attributes = []) * @method static TaxCategoryInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static TaxCategoryInterface[]|Proxy[] all() * @method static TaxCategoryInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static TaxCategoryInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -48,7 +48,7 @@ final class TaxCategoryFactory extends AbstractModelFactory implements FactoryWi use WithNameTrait; use WithDescriptionTrait; - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? TaxCategory::class; } diff --git a/src/Foundry/Factory/TaxRateFactory.php b/src/Foundry/Factory/TaxRateFactory.php index 11913b9..5fa961b 100644 --- a/src/Foundry/Factory/TaxRateFactory.php +++ b/src/Foundry/Factory/TaxRateFactory.php @@ -20,8 +20,8 @@ use Sylius\Component\Core\Model\TaxRate; use Sylius\Component\Core\Model\TaxRateInterface; use Sylius\Component\Taxation\Model\TaxCategoryInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -34,7 +34,7 @@ * @method static TaxRateInterface|Proxy last(string $sortedField = 'id') * @method static TaxRateInterface|Proxy random(array $attributes = []) * @method static TaxRateInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static TaxRateInterface[]|Proxy[] all() * @method static TaxRateInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static TaxRateInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -51,30 +51,30 @@ final class TaxRateFactory extends AbstractModelFactory implements FactoryWithMo public function withAmount(float $amount): self { - return $this->addState(['amount' => $amount]); + return $this->with(['amount' => $amount]); } public function includedInPrice(): self { - return $this->addState(['included_in_price' => true]); + return $this->with(['included_in_price' => true]); } public function notIncludedInPrice(): self { - return $this->addState(['included_in_price' => false]); + return $this->with(['included_in_price' => false]); } public function withCalculator(string $calculator): self { - return $this->addState(['calculator' => $calculator]); + return $this->with(['calculator' => $calculator]); } public function withCategory(Proxy|TaxCategoryInterface|string $category): self { - return $this->addState(['category' => $category]); + return $this->with(['category' => $category]); } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? TaxRate::class; } diff --git a/src/Foundry/Factory/TaxonFactory.php b/src/Foundry/Factory/TaxonFactory.php index 62b07ed..f724f91 100644 --- a/src/Foundry/Factory/TaxonFactory.php +++ b/src/Foundry/Factory/TaxonFactory.php @@ -20,8 +20,8 @@ use Sylius\Bundle\TaxonomyBundle\Doctrine\ORM\TaxonRepository; use Sylius\Component\Core\Model\Taxon; use Sylius\Component\Core\Model\TaxonInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -34,7 +34,7 @@ * @method static TaxonInterface|Proxy last(string $sortedField = 'id') * @method static TaxonInterface|Proxy random(array $attributes = []) * @method static TaxonInterface|Proxy randomOrCreate(array $attributes = []) - * @method static TaxonRepository|RepositoryProxy repository() + * @method static TaxonRepository|ProxyRepositoryDecorator repository() * @method static TaxonInterface[]|Proxy[] all() * @method static TaxonInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static TaxonInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -52,15 +52,15 @@ final class TaxonFactory extends AbstractModelFactory implements FactoryWithMode public function withTranslations(array $translations): self { - return $this->addState(['translations' => $translations]); + return $this->with(['translations' => $translations]); } public function withChildren(array $children): self { - return $this->addState(['children' => $children]); + return $this->with(['children' => $children]); } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? Taxon::class; } diff --git a/src/Foundry/Factory/ZoneFactory.php b/src/Foundry/Factory/ZoneFactory.php index 4e67b3e..fdbcd5a 100644 --- a/src/Foundry/Factory/ZoneFactory.php +++ b/src/Foundry/Factory/ZoneFactory.php @@ -18,8 +18,8 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; use Sylius\Component\Addressing\Model\Zone; use Sylius\Component\Addressing\Model\ZoneInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -32,7 +32,7 @@ * @method static ZoneInterface|Proxy last(string $sortedField = 'id') * @method static ZoneInterface|Proxy random(array $attributes = []) * @method static ZoneInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static ZoneInterface[]|Proxy[] all() * @method static ZoneInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static ZoneInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -48,7 +48,7 @@ final class ZoneFactory extends AbstractModelFactory implements FactoryWithModel public function withMembers(array $members, string $type = ZoneInterface::TYPE_ZONE): self { - return $this->addState([ + return $this->with([ 'type' => $type, 'members' => $members, ]); @@ -66,10 +66,10 @@ public function withProvinces(array $countries): self public function withScope(string $scope): self { - return $this->addState(['scope' => $scope]); + return $this->with(['scope' => $scope]); } - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? Zone::class; } diff --git a/src/Foundry/Factory/ZoneMemberFactory.php b/src/Foundry/Factory/ZoneMemberFactory.php index b79be9b..cd7d841 100644 --- a/src/Foundry/Factory/ZoneMemberFactory.php +++ b/src/Foundry/Factory/ZoneMemberFactory.php @@ -17,8 +17,8 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; use Sylius\Component\Addressing\Model\ZoneMember; use Sylius\Component\Addressing\Model\ZoneMemberInterface; -use Zenstruck\Foundry\Proxy; -use Zenstruck\Foundry\RepositoryProxy; +use Zenstruck\Foundry\Persistence\Proxy; +use Zenstruck\Foundry\Persistence\ProxyRepositoryDecorator; /** * @extends AbstractModelFactory @@ -31,7 +31,7 @@ * @method static ZoneMemberInterface|Proxy last(string $sortedField = 'id') * @method static ZoneMemberInterface|Proxy random(array $attributes = []) * @method static ZoneMemberInterface|Proxy randomOrCreate(array $attributes = []) - * @method static EntityRepository|RepositoryProxy repository() + * @method static EntityRepository|ProxyRepositoryDecorator repository() * @method static ZoneMemberInterface[]|Proxy[] all() * @method static ZoneMemberInterface[]|Proxy[] createMany(int $number, array|callable $attributes = []) * @method static ZoneMemberInterface[]|Proxy[] createSequence(iterable|callable $sequence) @@ -44,7 +44,7 @@ final class ZoneMemberFactory extends AbstractModelFactory implements FactoryWit use WithModelClassTrait; use WithCodeTrait; - protected static function getClass(): string + public static function class(): string { return self::$modelClass ?? ZoneMember::class; } diff --git a/src/Foundry/Transformer/CatalogPromotionTransformer.php b/src/Foundry/Transformer/CatalogPromotionTransformer.php index fa6db3e..a503666 100644 --- a/src/Foundry/Transformer/CatalogPromotionTransformer.php +++ b/src/Foundry/Transformer/CatalogPromotionTransformer.php @@ -17,7 +17,7 @@ use Akawakaweb\SyliusFixturesPlugin\Foundry\Factory\CatalogPromotionScopeFactory; use Sylius\Component\Core\Model\CatalogPromotionScopeInterface; use Sylius\Component\Promotion\Model\CatalogPromotionActionInterface; -use Zenstruck\Foundry\Proxy; +use Zenstruck\Foundry\Persistence\Proxy; final class CatalogPromotionTransformer implements TransformerInterface { diff --git a/src/Foundry/Transformer/ProductTransformer.php b/src/Foundry/Transformer/ProductTransformer.php index 3e8963a..ed9abc0 100644 --- a/src/Foundry/Transformer/ProductTransformer.php +++ b/src/Foundry/Transformer/ProductTransformer.php @@ -25,7 +25,7 @@ use Sylius\Component\Product\Model\ProductAttributeValueInterface; use Sylius\Component\Resource\Factory\FactoryInterface; use Webmozart\Assert\Assert; -use Zenstruck\Foundry\Proxy; +use Zenstruck\Foundry\Persistence\Proxy; final class ProductTransformer implements TransformerInterface { diff --git a/src/Foundry/Transformer/ZoneTransformer.php b/src/Foundry/Transformer/ZoneTransformer.php index c757677..ac49d88 100644 --- a/src/Foundry/Transformer/ZoneTransformer.php +++ b/src/Foundry/Transformer/ZoneTransformer.php @@ -15,7 +15,7 @@ use Akawakaweb\SyliusFixturesPlugin\Foundry\Factory\ZoneMemberFactory; use Sylius\Component\Addressing\Model\ZoneMemberInterface; -use Zenstruck\Foundry\Proxy; +use Zenstruck\Foundry\Persistence\Proxy; final class ZoneTransformer implements TransformerInterface { diff --git a/src/Foundry/Updater/OrderUpdater.php b/src/Foundry/Updater/OrderUpdater.php index 8cb2a0a..d741938 100644 --- a/src/Foundry/Updater/OrderUpdater.php +++ b/src/Foundry/Updater/OrderUpdater.php @@ -32,7 +32,7 @@ use Sylius\Component\Payment\PaymentTransitions; use Sylius\Component\Shipping\ShipmentTransitions; use Webmozart\Assert\Assert; -use Zenstruck\Foundry\Proxy; +use Zenstruck\Foundry\Persistence\Proxy; final class OrderUpdater implements UpdaterInterface { diff --git a/src/Foundry/Updater/ProductAssociationTypeUpdater.php b/src/Foundry/Updater/ProductAssociationTypeUpdater.php index 664e87b..e0553d2 100644 --- a/src/Foundry/Updater/ProductAssociationTypeUpdater.php +++ b/src/Foundry/Updater/ProductAssociationTypeUpdater.php @@ -17,7 +17,7 @@ use Sylius\Component\Locale\Model\LocaleInterface; use Sylius\Component\Product\Model\ProductAssociationTypeInterface; use Webmozart\Assert\Assert; -use Zenstruck\Foundry\Proxy; +use Zenstruck\Foundry\Persistence\Proxy; final class ProductAssociationTypeUpdater implements UpdaterInterface { diff --git a/src/Foundry/Updater/ProductAttributeUpdater.php b/src/Foundry/Updater/ProductAttributeUpdater.php index 17d8cd1..755af12 100644 --- a/src/Foundry/Updater/ProductAttributeUpdater.php +++ b/src/Foundry/Updater/ProductAttributeUpdater.php @@ -17,7 +17,7 @@ use Sylius\Component\Locale\Model\LocaleInterface; use Sylius\Component\Product\Model\ProductAttributeInterface; use Webmozart\Assert\Assert; -use Zenstruck\Foundry\Proxy; +use Zenstruck\Foundry\Persistence\Proxy; final class ProductAttributeUpdater implements UpdaterInterface { diff --git a/src/Foundry/Updater/ProductOptionUpdater.php b/src/Foundry/Updater/ProductOptionUpdater.php index 00737d7..3d2d195 100644 --- a/src/Foundry/Updater/ProductOptionUpdater.php +++ b/src/Foundry/Updater/ProductOptionUpdater.php @@ -17,7 +17,7 @@ use Sylius\Component\Locale\Model\LocaleInterface; use Sylius\Component\Product\Model\ProductOptionInterface; use Webmozart\Assert\Assert; -use Zenstruck\Foundry\Proxy; +use Zenstruck\Foundry\Persistence\Proxy; final class ProductOptionUpdater implements UpdaterInterface { diff --git a/src/Foundry/Updater/ProductOptionValueUpdater.php b/src/Foundry/Updater/ProductOptionValueUpdater.php index add0bbe..e055fde 100644 --- a/src/Foundry/Updater/ProductOptionValueUpdater.php +++ b/src/Foundry/Updater/ProductOptionValueUpdater.php @@ -17,7 +17,7 @@ use Sylius\Component\Locale\Model\LocaleInterface; use Sylius\Component\Product\Model\ProductOptionValueInterface; use Webmozart\Assert\Assert; -use Zenstruck\Foundry\Proxy; +use Zenstruck\Foundry\Persistence\Proxy; final class ProductOptionValueUpdater implements UpdaterInterface { diff --git a/src/Foundry/Updater/ShippingMethodUpdater.php b/src/Foundry/Updater/ShippingMethodUpdater.php index 9b7f28a..b7f2d51 100644 --- a/src/Foundry/Updater/ShippingMethodUpdater.php +++ b/src/Foundry/Updater/ShippingMethodUpdater.php @@ -21,7 +21,7 @@ use Sylius\Component\Locale\Model\LocaleInterface; use Sylius\Component\Shipping\Calculator\DefaultCalculators; use Webmozart\Assert\Assert; -use Zenstruck\Foundry\Proxy; +use Zenstruck\Foundry\Persistence\Proxy; final class ShippingMethodUpdater implements UpdaterInterface { diff --git a/symfony.lock b/symfony.lock index aafa04a..69b3ec3 100644 --- a/symfony.lock +++ b/symfony.lock @@ -152,6 +152,18 @@ "ref": "518ac22defa04a8a1d82479ed362e2921487adf0" } }, + "phpstan/phpstan": { + "version": "1.11", + "recipe": { + "repo": "github.com/symfony/recipes-contrib", + "branch": "main", + "version": "1.0", + "ref": "5e490cc197fb6bb1ae22e5abbc531ddc633b6767" + }, + "files": [ + "phpstan.dist.neon" + ] + }, "phpunit/phpunit": { "version": "9.6", "recipe": {