Bump Psalm to v5

This commit is contained in:
Jakub Tobiasz 2023-04-21 13:40:18 +02:00
parent 3ad89dc776
commit d0ed1e1cd6
No known key found for this signature in database
GPG key ID: 6434250CB3525233
130 changed files with 586 additions and 40 deletions

View file

@ -230,7 +230,7 @@
"symfony/runtime": "^5.4.21 || ^6.0",
"symfony/web-profiler-bundle": "^5.4.21 || ^6.0",
"symplify/monorepo-builder": "^11.0",
"vimeo/psalm": "^4.19"
"vimeo/psalm": "5.9.*"
},
"suggest": {
"ext-iconv": "For better performance than using Symfony Polyfill Component",

View file

@ -37,3 +37,4 @@ parameters:
- '/Access to an undefined property Doctrine\\Common\\Collections\\ArrayCollection/'
- '/Class Symfony\\Component\\Security\\Core\\Authentication\\Token\\UsernamePasswordToken constructor invoked with 4 parameters\, 2\-3 required./'
- '/Method Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface\:\:supportsNormalization\(\) invoked with 3 parameters\, 1\-2 required\./'
- '/(Interface|Class) [a-zA-Z\\]+ specifies template type (\w+) of interface [a-zA-Z\\]+ as [a-zA-Z\\]+ (of [a-zA-Z\\]+ )?but it''s already specified as/' # turns off a weird generics check behavior, we are basing on Psalm for generics checks

View file

@ -1,6 +1,8 @@
<?xml version="1.0"?>
<psalm
errorLevel="2"
findUnusedBaselineEntry="false"
findUnusedCode="false"
reportMixedIssues="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
@ -54,6 +56,7 @@
<referencedClass name="Http\Message\MessageFactory" /> <!-- deprecated in HttpMessage 1.1 -->
</errorLevel>
</DeprecatedClass>
<DeprecatedInterface>
<errorLevel type="info">
<referencedClass name="Sylius\Component\Core\Calculator\ProductVariantPriceCalculatorInterface" />
@ -62,11 +65,16 @@
<referencedClass name="Symfony\Component\Security\Core\Encoder\EncoderAwareInterface" /> <!-- deprecated in Symfony 5.3 -->
<referencedClass name="Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface" /> <!-- deprecated in Symfony 5.1 -->
<referencedClass name="Symfony\Component\Security\Core\Encoder\EncoderAwareInterface" /> <!-- deprecated in Symfony 5.3 -->
<referencedClass name="Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface" /> <!-- deprecated in Symfony 5.3 -->
<referencedClass name="Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface" /> <!-- deprecated in Symfony 5.3 -->
<referencedClass name="Symfony\Component\Serializer\Normalizer\ContextAwareDenormalizerInterface" /> <!-- deprecated in Symfony 6.1 -->
<referencedClass name="Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface" /> <!-- deprecated in Symfony 6.1 -->
<referencedClass name="Symfony\Component\Messenger\Handler\MessageHandlerInterface" /> <!-- deprecated in Symfony 6.2 -->
<referencedClass name="Http\Message\MessageFactory" /> <!-- Deprecated in Http\Message 1.1 -->
<referencedClass name="Payum\Core\Security\GenericTokenFactoryInterface" /> <!-- deprecated in Payum 1.3.7 -->
</errorLevel>
</DeprecatedInterface>
<DeprecatedMethod>
<errorLevel type="info">
<referencedMethod name="Faker\Generator::__get"/>
@ -99,12 +107,36 @@
</errorLevel>
</InternalClass>
<InvalidCast>
<errorLevel type="info">
<file name="src/Sylius/Bundle/ApiBundle/Converter/IriToIdentifierConverter.php" />
</errorLevel>
</InvalidCast>
<InvalidDocblock>
<errorLevel type="info">
<file name="vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php" />
</errorLevel>
</InvalidDocblock>
<InvalidOperand>
<errorLevel type="info">
<file name="src/Sylius/Bundle/AdminBundle/MessageHandler/CreateAdminUserHandler.php" />
</errorLevel>
</InvalidOperand>
<InvalidPropertyAssignmentValue>
<errorLevel type="info">
<file name="src/Sylius/Bundle/UiBundle/DataCollector/TemplateBlockRenderingHistory.php" />
</errorLevel>
</InvalidPropertyAssignmentValue>
<RedundantCast>
<errorLevel type="info">
<file name="src/Sylius/Bundle/ApiBundle/Converter/IriToIdentifierConverter.php" />
</errorLevel>
</RedundantCast>
<UndefinedMethod>
<errorLevel type="suppress">
<referencedMethod name="Symfony\Component\HttpFoundation\RequestStack::getSession" />
@ -116,6 +148,12 @@
<UndefinedInterfaceMethod>
<errorLevel type="suppress">
<referencedMethod name="Symfony\Component\Config\Definition\Builder\NodeParentInterface::arrayNode" />
<referencedMethod name="Symfony\Component\Config\Definition\Builder\NodeParentInterface::booleanNode" />
<referencedMethod name="Symfony\Component\Config\Definition\Builder\NodeParentInterface::end" />
<referencedMethod name="Symfony\Component\Config\Definition\Builder\NodeParentInterface::integerNode" />
<referencedMethod name="Symfony\Component\Config\Definition\Builder\NodeParentInterface::scalarNode" />
<referencedMethod name="Symfony\Component\Config\Definition\Builder\NodeParentInterface::variableNode" />
<referencedMethod name="Symfony\Component\Security\Core\User\UserInterface::getPassword" />
<referencedMethod name="Symfony\Component\Security\Core\User\UserInterface::getUsername" />
<referencedMethod name="Sylius\Component\User\Model\UserInterface::getUsername" />
@ -125,6 +163,19 @@
<MissingReturnType errorLevel="info" />
<MissingTemplateParam>
<errorLevel type="suppress">
<file name="src/Sylius/Bundle/CoreBundle/Form/DataTransformer/ProductTaxonToTaxonTransformer.php" />
<file name="src/Sylius/Bundle/CoreBundle/Form/DataTransformer/ProductVariantsToCodesTransformer.php" />
<file name="src/Sylius/Bundle/CoreBundle/Form/DataTransformer/ProductsToCodesTransformer.php" />
<file name="src/Sylius/Bundle/CoreBundle/Form/DataTransformer/TaxonsToCodesTransformer.php" />
<file name="src/Sylius/Bundle/ProductBundle/Form/DataTransformer/ProductVariantToProductOptionsTransformer.php" />
<file name="src/Sylius/Bundle/ProductBundle/Form/DataTransformer/ProductsToProductAssociationsTransformer.php" />
<file name="src/Sylius/Bundle/PromotionBundle/Form/Type/PromotionCouponToCodeType.php" />
<file name="src/Sylius/Bundle/UserBundle/Form/UserVerifiedAtToBooleanTransformer.php" />
</errorLevel>
</MissingTemplateParam>
<PropertyNotSetInConstructor errorLevel="info" />
<MissingConstructor>
<errorLevel type="info">

View file

@ -26,6 +26,7 @@ final class FlattenExceptionNormalizer implements ContextAwareNormalizerInterfac
) {
}
/** @psalm-suppress TooManyArguments */
public function supportsNormalization($data, $format = null, array $context = []): bool
{
$request = $this->requestStack->getMainRequest();

View file

@ -18,6 +18,10 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Channel\Model\ChannelInterface;
use Sylius\Component\Channel\Repository\ChannelRepositoryInterface;
/**
* @template T of ChannelInterface
* @implements ChannelRepositoryInterface<T>
*/
class ChannelRepository extends EntityRepository implements ChannelRepositoryInterface
{
private const ORDER_BY = ['id' => 'ASC'];

View file

@ -18,6 +18,10 @@ use Sylius\Component\Core\Model\AddressInterface;
use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Repository\AddressRepositoryInterface;
/**
* @template T of AddressInterface
* @implements AddressRepositoryInterface<T>
*/
class AddressRepository extends EntityRepository implements AddressRepositoryInterface
{
public function findByCustomer(CustomerInterface $customer): array

View file

@ -16,12 +16,15 @@ namespace Sylius\Bundle\CoreBundle\Doctrine\ORM;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\ClassMetadata;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Attribute\Model\AttributeInterface;
use SyliusLabs\AssociationHydrator\AssociationHydrator;
/**
* @template T of AttributeInterface
*/
class AttributeRepository extends EntityRepository
{
/** @var AssociationHydrator */
protected $associationHydrator;
protected AssociationHydrator $associationHydrator;
public function __construct(EntityManager $entityManager, ClassMetadata $class)
{

View file

@ -14,9 +14,14 @@ declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\Doctrine\ORM;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Core\Model\AvatarImageInterface;
use Sylius\Component\Core\Model\ImageInterface;
use Sylius\Component\Core\Repository\AvatarImageRepositoryInterface;
/**
* @template T of AvatarImageInterface
* @implements AvatarImageRepositoryInterface<T>
*/
final class AvatarImageRepository extends EntityRepository implements AvatarImageRepositoryInterface
{
public function findOneByOwnerId(string $id): ?ImageInterface

View file

@ -20,6 +20,10 @@ use Sylius\Component\Core\Model\ChannelPricingLogEntryInterface;
use Sylius\Component\Core\Repository\ChannelPricingLogEntryRepositoryInterface;
use Webmozart\Assert\Assert;
/**
* @template T of ChannelPricingLogEntryInterface
* @implements ChannelPricingLogEntryRepositoryInterface<T>
*/
class ChannelPricingLogEntryRepository extends EntityRepository implements ChannelPricingLogEntryRepositoryInterface
{
public function createByChannelPricingIdListQueryBuilder(mixed $channelPricingId): QueryBuilder

View file

@ -14,8 +14,13 @@ declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\Doctrine\ORM;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Repository\CustomerRepositoryInterface;
/**
* @template T of CustomerInterface
* @implements CustomerRepositoryInterface<T>
*/
class CustomerRepository extends EntityRepository implements CustomerRepositoryInterface
{
public function countCustomers(): int

View file

@ -18,6 +18,11 @@ use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\OrderItemInterface;
use Sylius\Component\Core\Repository\OrderItemRepositoryInterface;
/**
* @template T of OrderItemInterface
* @extends BaseOrderItemRepository<T>
* @implements OrderItemRepositoryInterface<T>
*/
class OrderItemRepository extends BaseOrderItemRepository implements OrderItemRepositoryInterface
{
public function findOneByIdAndCustomer($id, CustomerInterface $customer): ?OrderItemInterface

View file

@ -18,6 +18,10 @@ use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\OrderItemUnitInterface;
use Sylius\Component\Core\Repository\OrderItemUnitRepositoryInterface;
/**
* @template T of OrderItemUnitInterface
* @implements OrderItemUnitRepositoryInterface<T>
*/
class OrderItemUnitRepository extends EntityRepository implements OrderItemUnitRepositoryInterface
{
public function findOneByCustomer($id, CustomerInterface $customer): ?OrderItemUnitInterface

View file

@ -28,10 +28,14 @@ use Sylius\Component\Order\Model\OrderInterface as BaseOrderInterface;
use SyliusLabs\AssociationHydrator\AssociationHydrator;
use Webmozart\Assert\Assert;
/**
* @template T of OrderInterface
* @extends BaseOrderRepository<T>
* @implements OrderRepositoryInterface<T>
*/
class OrderRepository extends BaseOrderRepository implements OrderRepositoryInterface
{
/** @var AssociationHydrator */
protected $associationHydrator;
protected AssociationHydrator $associationHydrator;
public function __construct(EntityManager $entityManager, ClassMetadata $class)
{

View file

@ -16,8 +16,14 @@ namespace Sylius\Bundle\CoreBundle\Doctrine\ORM;
use Doctrine\ORM\QueryBuilder;
use Sylius\Bundle\PaymentBundle\Doctrine\ORM\PaymentMethodRepository as BasePaymentMethodRepository;
use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Core\Model\PaymentMethodInterface;
use Sylius\Component\Core\Repository\PaymentMethodRepositoryInterface;
/**
* @template T of PaymentMethodInterface
* @extends BasePaymentMethodRepository<T>
* @implements PaymentMethodRepositoryInterface<T>
*/
class PaymentMethodRepository extends BasePaymentMethodRepository implements PaymentMethodRepositoryInterface
{
public function createListQueryBuilder(string $locale): QueryBuilder

View file

@ -19,6 +19,10 @@ use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\PaymentInterface;
use Sylius\Component\Core\Repository\PaymentRepositoryInterface;
/**
* @template T of PaymentInterface
* @implements PaymentRepositoryInterface<T>
*/
class PaymentRepository extends EntityRepository implements PaymentRepositoryInterface
{
public function createListQueryBuilder(): QueryBuilder

View file

@ -18,6 +18,10 @@ use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Core\Repository\ProductAssociationRepositoryInterface;
use Sylius\Component\Product\Model\ProductAssociationInterface;
/**
* @template T of ProductAssociationInterface
* @implements ProductAssociationRepositoryInterface<T>
*/
class ProductAssociationRepository extends EntityRepository implements ProductAssociationRepositoryInterface
{
public function findWithProductsWithinChannel($associationId, ChannelInterface $channel): ProductAssociationInterface

View file

@ -16,12 +16,16 @@ namespace Sylius\Bundle\CoreBundle\Doctrine\ORM;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\ClassMetadata;
use Sylius\Bundle\ProductBundle\Doctrine\ORM\ProductOptionRepository as BaseProductOptionRepository;
use Sylius\Component\Product\Model\ProductOptionInterface;
use SyliusLabs\AssociationHydrator\AssociationHydrator;
/**
* @template T of ProductOptionInterface
* @extends BaseProductOptionRepository<T>
*/
class ProductOptionRepository extends BaseProductOptionRepository
{
/** @var AssociationHydrator */
protected $associationHydrator;
protected AssociationHydrator $associationHydrator;
public function __construct(EntityManager $entityManager, ClassMetadata $class)
{

View file

@ -23,6 +23,11 @@ use Sylius\Component\Core\Model\TaxonInterface;
use Sylius\Component\Core\Repository\ProductRepositoryInterface;
use SyliusLabs\AssociationHydrator\AssociationHydrator;
/**
* @template T of ProductInterface
* @extends BaseProductRepository<T>
* @implements ProductRepositoryInterface<T>
*/
class ProductRepository extends BaseProductRepository implements ProductRepositoryInterface
{
protected AssociationHydrator $associationHydrator;

View file

@ -19,6 +19,10 @@ use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Core\Repository\ProductReviewRepositoryInterface;
use Sylius\Component\Review\Model\ReviewInterface;
/**
* @template T of ReviewInterface
* @implements ProductReviewRepositoryInterface<T>
*/
class ProductReviewRepository extends EntityRepository implements ProductReviewRepositoryInterface
{
public function findLatestByProductId($productId, int $count): array

View file

@ -17,6 +17,10 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Core\Model\ProductTaxonInterface;
use Sylius\Component\Core\Repository\ProductTaxonRepositoryInterface;
/**
* @template T of ProductTaxonInterface
* @implements ProductTaxonRepositoryInterface<T>
*/
class ProductTaxonRepository extends EntityRepository implements ProductTaxonRepositoryInterface
{
public function findOneByProductCodeAndTaxonCode(string $productCode, string $taxonCode): ?ProductTaxonInterface

View file

@ -16,9 +16,15 @@ namespace Sylius\Bundle\CoreBundle\Doctrine\ORM;
use Doctrine\ORM\QueryBuilder;
use Sylius\Bundle\ProductBundle\Doctrine\ORM\ProductVariantRepository as BaseProductVariantRepository;
use Sylius\Component\Core\Model\CatalogPromotionInterface;
use Sylius\Component\Core\Model\ProductVariantInterface;
use Sylius\Component\Core\Model\TaxonInterface;
use Sylius\Component\Core\Repository\ProductVariantRepositoryInterface;
/**
* @template T of ProductVariantInterface
* @extends BaseProductVariantRepository<T>
* @implements ProductVariantRepositoryInterface<T>
*/
class ProductVariantRepository extends BaseProductVariantRepository implements ProductVariantRepositoryInterface
{
public function createInventoryListQueryBuilder(string $locale): QueryBuilder

View file

@ -17,9 +17,15 @@ use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Mapping\ClassMetadata;
use Sylius\Bundle\PromotionBundle\Doctrine\ORM\PromotionRepository as BasePromotionRepository;
use Sylius\Component\Channel\Model\ChannelInterface;
use Sylius\Component\Core\Model\PromotionInterface;
use Sylius\Component\Core\Repository\PromotionRepositoryInterface;
use SyliusLabs\AssociationHydrator\AssociationHydrator;
/**
* @template T of PromotionInterface
* @extends BasePromotionRepository<T>
* @implements PromotionRepositoryInterface<T>
*/
class PromotionRepository extends BasePromotionRepository implements PromotionRepositoryInterface
{
private AssociationHydrator $associationHydrator;

View file

@ -20,6 +20,10 @@ use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\ShipmentInterface;
use Sylius\Component\Core\Repository\ShipmentRepositoryInterface;
/**
* @template T of ShipmentInterface
* @implements ShipmentRepositoryInterface<T>
*/
class ShipmentRepository extends EntityRepository implements ShipmentRepositoryInterface
{
public function createListQueryBuilder(): QueryBuilder

View file

@ -16,7 +16,12 @@ namespace Sylius\Bundle\CoreBundle\Doctrine\ORM;
use Doctrine\ORM\QueryBuilder;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Core\Repository\ShippingCategoryRepositoryInterface;
use Sylius\Component\Shipping\Model\ShippingCategoryInterface;
/**
* @template T of ShippingCategoryInterface
* @implements ShippingCategoryRepositoryInterface<T>
*/
class ShippingCategoryRepository extends EntityRepository implements ShippingCategoryRepositoryInterface
{
public function createListQueryBuilder(): QueryBuilder

View file

@ -16,8 +16,14 @@ namespace Sylius\Bundle\CoreBundle\Doctrine\ORM;
use Doctrine\ORM\QueryBuilder;
use Sylius\Bundle\ShippingBundle\Doctrine\ORM\ShippingMethodRepository as BaseShippingMethodRepository;
use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Core\Model\ShippingMethodInterface;
use Sylius\Component\Core\Repository\ShippingMethodRepositoryInterface;
/**
* @template T of ShippingMethodInterface
* @extends BaseShippingMethodRepository<T>
* @implements ShippingMethodRepositoryInterface<T>
*/
class ShippingMethodRepository extends BaseShippingMethodRepository implements ShippingMethodRepositoryInterface
{
public function createListQueryBuilder(string $locale): QueryBuilder

View file

@ -17,6 +17,11 @@ use Sylius\Bundle\UserBundle\Doctrine\ORM\UserRepository as BaseUserRepository;
use Sylius\Component\User\Model\UserInterface;
use Sylius\Component\User\Repository\UserRepositoryInterface;
/**
* @template T of UserInterface
* @extends BaseUserRepository<T>
* @implements UserRepositoryInterface<T>
*/
class UserRepository extends BaseUserRepository implements UserRepositoryInterface
{
public function findOneByEmail(string $email): ?UserInterface

View file

@ -19,6 +19,9 @@ use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @implements OrderFactoryInterface<OrderInterface>
*/
final class OrderFactory implements OrderFactoryInterface
{
public function __construct(
@ -28,7 +31,10 @@ final class OrderFactory implements OrderFactoryInterface
public function createNew(): OrderInterface
{
return $this->decoratedFactory->createNew();
/** @var OrderInterface $order */
$order = $this->decoratedFactory->createNew();
return $order;
}
public function createNewCart(

View file

@ -17,7 +17,12 @@ use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
use Sylius\Component\Resource\Model\ResourceInterface;
/**
* @template T of ResourceInterface
* @extends FactoryInterface<T>
*/
interface OrderFactoryInterface extends FactoryInterface
{
public function createNewCart(

View file

@ -139,6 +139,7 @@ class AddressExampleFactory extends AbstractExampleFactory
}
/**
* @param Collection<array-key, ProvinceInterface> $provinces
* @throws \InvalidArgumentException
*/
private function getProvinceCode(Collection $provinces, string $provinceName): string

View file

@ -13,6 +13,9 @@ declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\Installer\Requirement;
/**
* @implements \IteratorAggregate<Requirement>
*/
abstract class RequirementCollection implements \IteratorAggregate
{
/** @var array|Requirement[] */

View file

@ -13,6 +13,9 @@ declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\Installer\Requirement;
/**
* @implements \IteratorAggregate<RequirementCollection>
*/
final class SyliusRequirements implements \IteratorAggregate
{
/** @var array|RequirementCollection[] */

View file

@ -89,7 +89,9 @@ final class LocaleSetup implements LocaleSetupInterface
$region = null;
if (count(explode('_', $code, 2)) === 2) {
[$language, $region] = explode('_', $code, 2);
$codeParts = explode('_', $code, 2);
$language = $codeParts[0];
$region = $codeParts[1] ?? null;
}
try {

View file

@ -18,6 +18,10 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Currency\Model\ExchangeRateInterface;
use Sylius\Component\Currency\Repository\ExchangeRateRepositoryInterface;
/**
* @template T of ExchangeRateInterface
* @implements ExchangeRateRepositoryInterface<T>
*/
class ExchangeRateRepository extends EntityRepository implements ExchangeRateRepositoryInterface
{
/**

View file

@ -14,8 +14,13 @@ declare(strict_types=1);
namespace Sylius\Bundle\CustomerBundle\Doctrine\ORM;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Customer\Model\CustomerGroupInterface;
use Sylius\Component\Customer\Repository\CustomerGroupRepositoryInterface;
/**
* @template T of CustomerGroupInterface
* @implements CustomerGroupRepositoryInterface<T>
*/
class CustomerGroupRepository extends EntityRepository implements CustomerGroupRepositoryInterface
{
public function findByPhrase(string $phrase, ?int $limit = null): iterable

View file

@ -18,6 +18,10 @@ use Sylius\Component\Order\Model\OrderInterface;
use Sylius\Component\Order\Model\OrderItemInterface;
use Sylius\Component\Order\Repository\OrderItemRepositoryInterface;
/**
* @template T of OrderItemInterface
* @implements OrderItemRepositoryInterface<T>
*/
class OrderItemRepository extends EntityRepository implements OrderItemRepositoryInterface
{
public function findOneByIdAndCartId($id, $cartId): ?OrderItemInterface

View file

@ -19,6 +19,10 @@ use Sylius\Component\Order\Model\OrderInterface;
use Sylius\Component\Order\Repository\OrderRepositoryInterface;
use Webmozart\Assert\Assert;
/**
* @template T of OrderInterface
* @implements OrderRepositoryInterface<T>
*/
class OrderRepository extends EntityRepository implements OrderRepositoryInterface
{
public function countPlacedOrders(): int

View file

@ -14,8 +14,13 @@ declare(strict_types=1);
namespace Sylius\Bundle\PaymentBundle\Doctrine\ORM;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Payment\Model\PaymentMethodInterface;
use Sylius\Component\Payment\Repository\PaymentMethodRepositoryInterface;
/**
* @template T of PaymentMethodInterface
* @implements PaymentMethodRepositoryInterface<T>
*/
class PaymentMethodRepository extends EntityRepository implements PaymentMethodRepositoryInterface
{
public function findByName(string $name, string $locale): array

View file

@ -47,6 +47,7 @@ final class SyliusPayumExtension extends AbstractResourceExtension implements Pr
continue;
}
/** @var string $gatewayKey */
foreach (array_keys($config['gateways']) as $gatewayKey) {
$gateways[$gatewayKey] = 'sylius.payum_gateway.' . $gatewayKey;
}

View file

@ -15,8 +15,13 @@ namespace Sylius\Bundle\ProductBundle\Doctrine\ORM;
use Doctrine\ORM\QueryBuilder;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Product\Model\ProductAssociationTypeInterface;
use Sylius\Component\Product\Repository\ProductAssociationTypeRepositoryInterface;
/**
* @template T of ProductAssociationTypeInterface
* @implements ProductAssociationTypeRepositoryInterface<T>
*/
class ProductAssociationTypeRepository extends EntityRepository implements ProductAssociationTypeRepositoryInterface
{
public function createListQueryBuilder(string $locale): QueryBuilder

View file

@ -15,8 +15,13 @@ namespace Sylius\Bundle\ProductBundle\Doctrine\ORM;
use Doctrine\ORM\QueryBuilder;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Product\Model\ProductAttributeValueInterface;
use Sylius\Component\Product\Repository\ProductAttributeValueRepositoryInterface;
/**
* @template T of ProductAttributeValueInterface
* @implements ProductAttributeValueRepositoryInterface<T>
*/
class ProductAttributeValueRepository extends EntityRepository implements ProductAttributeValueRepositoryInterface
{
public function findByJsonChoiceKey(string $choiceKey): array

View file

@ -15,8 +15,13 @@ namespace Sylius\Bundle\ProductBundle\Doctrine\ORM;
use Doctrine\ORM\QueryBuilder;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Product\Model\ProductOptionInterface;
use Sylius\Component\Product\Repository\ProductOptionRepositoryInterface;
/**
* @template T of ProductOptionInterface
* @implements ProductOptionRepositoryInterface<T>
*/
class ProductOptionRepository extends EntityRepository implements ProductOptionRepositoryInterface
{
public function createListQueryBuilder(string $locale): QueryBuilder

View file

@ -14,8 +14,13 @@ declare(strict_types=1);
namespace Sylius\Bundle\ProductBundle\Doctrine\ORM;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Product\Model\ProductInterface;
use Sylius\Component\Product\Repository\ProductRepositoryInterface;
/**
* @template T of ProductInterface
* @implements ProductRepositoryInterface<T>
*/
class ProductRepository extends EntityRepository implements ProductRepositoryInterface
{
public function findByName(string $name, string $locale): array

View file

@ -19,6 +19,10 @@ use Sylius\Component\Product\Model\ProductInterface;
use Sylius\Component\Product\Model\ProductVariantInterface;
use Sylius\Component\Product\Repository\ProductVariantRepositoryInterface;
/**
* @template T of ProductVariantInterface
* @implements ProductVariantRepositoryInterface<T>
*/
class ProductVariantRepository extends EntityRepository implements ProductVariantRepositoryInterface
{
public function createQueryBuilderByProductId(string $locale, $productId): QueryBuilder

View file

@ -85,6 +85,9 @@ final class ProductsToProductAssociationsTransformer implements DataTransformerI
return $productAssociations;
}
/**
* @param Collection<array-key, ProductInterface> $products
*/
private function getCodesAsStringFromProducts(Collection $products): ?string
{
if ($products->isEmpty()) {

View file

@ -15,8 +15,13 @@ namespace Sylius\Bundle\PromotionBundle\Doctrine\ORM;
use Sylius\Bundle\PromotionBundle\Criteria\CriteriaInterface;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Promotion\Model\CatalogPromotionInterface;
use Sylius\Component\Promotion\Repository\CatalogPromotionRepositoryInterface;
/**
* @template T of CatalogPromotionInterface
* @implements CatalogPromotionRepositoryInterface<T>
*/
class CatalogPromotionRepository extends EntityRepository implements CatalogPromotionRepositoryInterface
{
public function findByCriteria(iterable $criteria): array

View file

@ -18,6 +18,10 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Promotion\Model\PromotionCouponInterface;
use Sylius\Component\Promotion\Repository\PromotionCouponRepositoryInterface;
/**
* @template T of PromotionCouponInterface
* @implements PromotionCouponRepositoryInterface<T>
*/
class PromotionCouponRepository extends EntityRepository implements PromotionCouponRepositoryInterface
{
public function createQueryBuilderByPromotionId($promotionId): QueryBuilder

View file

@ -15,8 +15,13 @@ namespace Sylius\Bundle\PromotionBundle\Doctrine\ORM;
use Doctrine\ORM\QueryBuilder;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Promotion\Model\PromotionInterface;
use Sylius\Component\Promotion\Repository\PromotionRepositoryInterface;
/**
* @template T of PromotionInterface
* @implements PromotionRepositoryInterface<T>
*/
class PromotionRepository extends EntityRepository implements PromotionRepositoryInterface
{
public function findActive(): array

View file

@ -14,8 +14,13 @@ declare(strict_types=1);
namespace Sylius\Bundle\ShippingBundle\Doctrine\ORM;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Shipping\Model\ShippingMethodInterface;
use Sylius\Component\Shipping\Repository\ShippingMethodRepositoryInterface;
/**
* @template T of ShippingMethodInterface
* @implements ShippingMethodRepositoryInterface<T>
*/
class ShippingMethodRepository extends EntityRepository implements ShippingMethodRepositoryInterface
{
public function findByName(string $name, string $locale): array

View file

@ -14,8 +14,13 @@ declare(strict_types=1);
namespace Sylius\Bundle\TaxationBundle\Doctrine\ORM;
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Taxation\Model\TaxCategoryInterface;
use Sylius\Component\Taxation\Repository\TaxCategoryRepositoryInterface;
/**
* @template T of TaxCategoryInterface
* @implements TaxCategoryRepositoryInterface<T>
*/
class TaxCategoryRepository extends EntityRepository implements TaxCategoryRepositoryInterface
{
public function findByName(string $name): array

View file

@ -18,6 +18,10 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\Taxonomy\Model\TaxonInterface;
use Sylius\Component\Taxonomy\Repository\TaxonRepositoryInterface;
/**
* @template T of TaxonInterface
* @implements TaxonRepositoryInterface<T>
*/
class TaxonRepository extends EntityRepository implements TaxonRepositoryInterface
{
public function findChildren(string $parentCode, ?string $locale = null): array

View file

@ -17,6 +17,10 @@ use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
use Sylius\Component\User\Model\UserInterface;
use Sylius\Component\User\Repository\UserRepositoryInterface;
/**
* @template T of UserInterface
* @implements UserRepositoryInterface<T>
*/
class UserRepository extends EntityRepository implements UserRepositoryInterface
{
public function findOneByEmail(string $email): ?UserInterface

View file

@ -17,6 +17,9 @@ use Sylius\Component\Resource\Factory\FactoryInterface;
use Sylius\Component\User\Model\UserInterface;
use Webmozart\Assert\Assert;
/**
* @implements FactoryInterface<UserInterface>
*/
final class UserWithEncoderFactory implements FactoryInterface
{
public function __construct(private FactoryInterface $decoratedUserFactory, private string $encoderName)

View file

@ -17,6 +17,10 @@ use Sylius\Component\Addressing\Model\ZoneInterface;
use Sylius\Component\Addressing\Model\ZoneMemberInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of ZoneInterface
* @implements ZoneFactoryInterface<T>
*/
final class ZoneFactory implements ZoneFactoryInterface
{
public function __construct(private FactoryInterface $factory, private FactoryInterface $zoneMemberFactory)

View file

@ -16,6 +16,10 @@ namespace Sylius\Component\Addressing\Factory;
use Sylius\Component\Addressing\Model\ZoneInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of ZoneInterface
* @extends FactoryInterface<T>
*/
interface ZoneFactoryInterface extends FactoryInterface
{
public function createTyped(string $type): ZoneInterface;

View file

@ -18,6 +18,10 @@ use Sylius\Component\Attribute\Model\AttributeInterface;
use Sylius\Component\Registry\ServiceRegistryInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of AttributeInterface
* @implements AttributeFactoryInterface<T>
*/
final class AttributeFactory implements AttributeFactoryInterface
{
public function __construct(private FactoryInterface $factory, private ServiceRegistryInterface $attributeTypesRegistry)

View file

@ -16,6 +16,10 @@ namespace Sylius\Component\Attribute\Factory;
use Sylius\Component\Attribute\Model\AttributeInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of AttributeInterface
* @extends FactoryInterface<T>
*/
interface AttributeFactoryInterface extends FactoryInterface
{
public function createTyped(string $type): AttributeInterface;

View file

@ -25,9 +25,7 @@ interface AttributeSubjectInterface
public function getAttributes(): Collection;
/**
* @return Collection|AttributeValueInterface[]
*
* @psalm-return Collection<array-key, AttributeValueInterface>
* @return Collection<array-key, AttributeValueInterface>
*/
public function getAttributesByLocale(
string $localeCode,

View file

@ -16,6 +16,10 @@ namespace Sylius\Component\Channel\Factory;
use Sylius\Component\Channel\Model\ChannelInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of ChannelInterface
* @implements ChannelFactoryInterface<T>
*/
final class ChannelFactory implements ChannelFactoryInterface
{
public function __construct(private FactoryInterface $defaultFactory)

View file

@ -16,6 +16,10 @@ namespace Sylius\Component\Channel\Factory;
use Sylius\Component\Channel\Model\ChannelInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of ChannelInterface
* @extends FactoryInterface<T>
*/
interface ChannelFactoryInterface extends FactoryInterface
{
public function createNamed(string $name): ChannelInterface;

View file

@ -16,6 +16,10 @@ namespace Sylius\Component\Channel\Repository;
use Sylius\Component\Channel\Model\ChannelInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @template T of ChannelInterface
* @extends RepositoryInterface<T>
*/
interface ChannelRepositoryInterface extends RepositoryInterface
{
/** @deprecated since Sylius 1.11, use the `findOneEnabledByHostname` method instead */

View file

@ -17,6 +17,10 @@ use Sylius\Component\Core\Model\AddressInterface;
use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of AddressInterface
* @implements AddressFactoryInterface<T>
*/
class AddressFactory implements AddressFactoryInterface
{
public function __construct(private FactoryInterface $decoratedFactory)

View file

@ -17,6 +17,10 @@ use Sylius\Component\Core\Model\AddressInterface;
use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of AddressInterface
* @extends FactoryInterface<T>
*/
interface AddressFactoryInterface extends FactoryInterface
{
public function createForCustomer(CustomerInterface $customer): AddressInterface;

View file

@ -19,6 +19,10 @@ use Sylius\Component\Core\Model\ProductInterface;
use Sylius\Component\Product\Resolver\ProductVariantResolverInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of OrderItemInterface
* @implements CartItemFactoryInterface<T>
*/
final class CartItemFactory implements CartItemFactoryInterface
{
public function __construct(private FactoryInterface $decoratedFactory, private ProductVariantResolverInterface $variantResolver)

View file

@ -18,6 +18,10 @@ use Sylius\Component\Core\Model\OrderItemInterface;
use Sylius\Component\Core\Model\ProductInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of OrderItemInterface
* @extends FactoryInterface<T>
*/
interface CartItemFactoryInterface extends FactoryInterface
{
public function createForProduct(ProductInterface $product): OrderItemInterface;

View file

@ -14,14 +14,21 @@ declare(strict_types=1);
namespace Sylius\Component\Core\Factory;
use Sylius\Component\Channel\Factory\ChannelFactoryInterface;
use Sylius\Component\Channel\Model\ChannelInterface;
use Sylius\Component\Core\Model\ChannelInterface as CoreChannelInterface;
use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Core\Model\ChannelPriceHistoryConfigInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
use Webmozart\Assert\Assert;
/**
* @template T of ChannelInterface
* @implements ChannelFactoryInterface<T>
*/
final class ChannelFactory implements ChannelFactoryInterface
{
/**
* @param FactoryInterface<T> $decoratedFactory
* @param FactoryInterface<ChannelPriceHistoryConfigInterface>|null $channelPriceHistoryConfigFactory
*/
public function __construct(
private FactoryInterface $decoratedFactory,
private string $defaultCalculationStrategy,
@ -32,12 +39,9 @@ final class ChannelFactory implements ChannelFactoryInterface
}
}
/**
* @inheritdoc
*/
/** @inheritdoc */
public function createNew(): ChannelInterface
{
/** @var CoreChannelInterface $channel */
$channel = $this->decoratedFactory->createNew();
$channel->setTaxCalculationStrategy($this->defaultCalculationStrategy);

View file

@ -17,6 +17,10 @@ use Sylius\Component\Core\Model\ChannelPricingInterface;
use Sylius\Component\Core\Model\ChannelPricingLogEntryInterface;
use Sylius\Component\Resource\Exception\UnsupportedMethodException;
/**
* @template T of ChannelPricingLogEntryInterface
* @implements ChannelPricingLogEntryFactoryInterface<T>
*/
final class ChannelPricingLogEntryFactory implements ChannelPricingLogEntryFactoryInterface
{
public function __construct(private string $className)

View file

@ -17,6 +17,10 @@ use Sylius\Component\Core\Model\ChannelPricingInterface;
use Sylius\Component\Core\Model\ChannelPricingLogEntryInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of ChannelPricingLogEntryInterface
* @extends FactoryInterface<T>
*/
interface ChannelPricingLogEntryFactoryInterface extends FactoryInterface
{
public function create(

View file

@ -17,18 +17,20 @@ use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of CustomerInterface
* @implements CustomerAfterCheckoutFactoryInterface<T>
*/
final class CustomerAfterCheckoutFactory implements CustomerAfterCheckoutFactoryInterface
{
public function __construct(private FactoryInterface $baseCustomerFactory)
{
}
/** @inheritdoc */
public function createNew(): CustomerInterface
{
/** @var CustomerInterface $customer */
$customer = $this->baseCustomerFactory->createNew();
return $customer;
return $this->baseCustomerFactory->createNew();
}
public function createAfterCheckout(OrderInterface $order): CustomerInterface

View file

@ -17,7 +17,14 @@ use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of CustomerInterface
* @extends FactoryInterface<T>
*/
interface CustomerAfterCheckoutFactoryInterface extends FactoryInterface
{
/**
* @return T
*/
public function createAfterCheckout(OrderInterface $order): CustomerInterface;
}

View file

@ -17,12 +17,21 @@ use Payum\Core\Model\GatewayConfigInterface;
use Sylius\Component\Core\Model\PaymentMethodInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of PaymentMethodInterface
* @implements PaymentMethodFactoryInterface<T>
*/
final class PaymentMethodFactory implements PaymentMethodFactoryInterface
{
/**
* @param FactoryInterface<T> $decoratedFactory
* @param FactoryInterface<GatewayConfigInterface> $gatewayConfigFactory
*/
public function __construct(private FactoryInterface $decoratedFactory, private FactoryInterface $gatewayConfigFactory)
{
}
/** @inheritdoc */
public function createNew(): PaymentMethodInterface
{
return $this->decoratedFactory->createNew();

View file

@ -16,6 +16,10 @@ namespace Sylius\Component\Core\Factory;
use Sylius\Component\Core\Model\PaymentMethodInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of PaymentMethodInterface
* @extends FactoryInterface<T>
*/
interface PaymentMethodFactoryInterface extends FactoryInterface
{
public function createWithGateway(string $gatewayFactory): PaymentMethodInterface;

View file

@ -21,8 +21,14 @@ use Sylius\Component\Core\Promotion\Action\UnitPercentageDiscountPromotionAction
use Sylius\Component\Promotion\Model\PromotionActionInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @implements PromotionActionFactoryInterface<PromotionActionInterface>
*/
final class PromotionActionFactory implements PromotionActionFactoryInterface
{
/**
* @param FactoryInterface<PromotionActionInterface> $decoratedFactory
*/
public function __construct(private FactoryInterface $decoratedFactory)
{
}

View file

@ -16,6 +16,10 @@ namespace Sylius\Component\Core\Factory;
use Sylius\Component\Promotion\Model\PromotionActionInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of PromotionActionInterface
* @extends FactoryInterface<T>
*/
interface PromotionActionFactoryInterface extends FactoryInterface
{
public function createFixedDiscount(int $amount, string $channelCode): PromotionActionInterface;

View file

@ -22,6 +22,9 @@ use Sylius\Component\Promotion\Checker\Rule\ItemTotalRuleChecker;
use Sylius\Component\Promotion\Model\PromotionRuleInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @implements PromotionRuleFactoryInterface<PromotionRuleInterface>
*/
final class PromotionRuleFactory implements PromotionRuleFactoryInterface
{
public function __construct(private FactoryInterface $decoratedFactory)

View file

@ -16,6 +16,10 @@ namespace Sylius\Component\Core\Factory;
use Sylius\Component\Promotion\Model\PromotionRuleInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of PromotionRuleInterface
* @extends FactoryInterface<T>
*/
interface PromotionRuleFactoryInterface extends FactoryInterface
{
public function createCartQuantity(int $count): PromotionRuleInterface;

View file

@ -183,7 +183,7 @@ class Order extends BaseOrder implements OrderInterface
public function getItemUnits(): Collection
{
/** @var ArrayCollection<int, OrderItemUnitInterface> $units */
/** @var ArrayCollection<array-key, OrderItemUnitInterface> $units */
$units = new ArrayCollection();
/** @var OrderItem $item */

View file

@ -52,16 +52,12 @@ interface OrderInterface extends
public function setPaymentState(?string $paymentState): void;
/**
* @return Collection|OrderItemUnitInterface[]
*
* @psalm-return Collection<array-key, OrderItemUnitInterface>
* @return Collection<array-key, OrderItemUnitInterface>
*/
public function getItemUnits(): Collection;
/**
* @return Collection|OrderItemUnitInterface[]
*
* @psalm-return Collection<array-key, OrderItemUnitInterface>
* @return Collection<array-key, OrderItemUnitInterface>
*/
public function getItemUnitsByVariant(ProductVariantInterface $variant): Collection;

View file

@ -17,6 +17,10 @@ use Sylius\Component\Core\Model\AddressInterface;
use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @template T of AddressInterface
* @extends RepositoryInterface<T>
*/
interface AddressRepositoryInterface extends RepositoryInterface
{
/**

View file

@ -16,6 +16,10 @@ namespace Sylius\Component\Core\Repository;
use Sylius\Component\Core\Model\ImageInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @template T of ImageInterface
* @extends RepositoryInterface<T>
*/
interface AvatarImageRepositoryInterface extends RepositoryInterface
{
public function findOneByOwnerId(string $id): ?ImageInterface;

View file

@ -18,6 +18,10 @@ use Sylius\Component\Core\Model\ChannelPricingInterface;
use Sylius\Component\Core\Model\ChannelPricingLogEntryInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @template T of ChannelPricingLogEntryInterface
* @extends RepositoryInterface<T>
*/
interface ChannelPricingLogEntryRepositoryInterface extends RepositoryInterface
{
public function createByChannelPricingIdListQueryBuilder(mixed $channelPricingId): QueryBuilder;

View file

@ -16,6 +16,10 @@ namespace Sylius\Component\Core\Repository;
use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @template T of CustomerInterface
* @extends RepositoryInterface<T>
*/
interface CustomerRepositoryInterface extends RepositoryInterface
{
public function countCustomers(): int;

View file

@ -17,6 +17,10 @@ use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\OrderItemInterface;
use Sylius\Component\Order\Repository\OrderItemRepositoryInterface as BaseOrderItemRepositoryInterface;
/**
* @template T of OrderItemInterface
* @extends BaseOrderItemRepositoryInterface<T>
*/
interface OrderItemRepositoryInterface extends BaseOrderItemRepositoryInterface
{
public function findOneByIdAndCustomer($id, CustomerInterface $customer): ?OrderItemInterface;

View file

@ -17,6 +17,10 @@ use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\OrderItemUnitInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @template T of OrderItemUnitInterface
* @extends RepositoryInterface<T>
*/
interface OrderItemUnitRepositoryInterface extends RepositoryInterface
{
public function findOneByCustomer($id, CustomerInterface $customer): ?OrderItemUnitInterface;

View file

@ -21,6 +21,10 @@ use Sylius\Component\Core\Model\PromotionCouponInterface;
use Sylius\Component\Order\Model\OrderInterface as BaseOrderInterface;
use Sylius\Component\Order\Repository\OrderRepositoryInterface as BaseOrderRepositoryInterface;
/**
* @template T of OrderInterface
* @extends BaseOrderRepositoryInterface<T>
*/
interface OrderRepositoryInterface extends BaseOrderRepositoryInterface
{
public function createListQueryBuilder(): QueryBuilder;

View file

@ -15,8 +15,13 @@ namespace Sylius\Component\Core\Repository;
use Doctrine\ORM\QueryBuilder;
use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Core\Model\PaymentMethodInterface;
use Sylius\Component\Payment\Repository\PaymentMethodRepositoryInterface as BasePaymentMethodRepositoryInterface;
/**
* @template T of PaymentMethodInterface
* @extends BasePaymentMethodRepositoryInterface<T>
*/
interface PaymentMethodRepositoryInterface extends BasePaymentMethodRepositoryInterface
{
public function createListQueryBuilder(string $locale): QueryBuilder;

View file

@ -18,6 +18,10 @@ use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\PaymentInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @template T of PaymentInterface
* @extends RepositoryInterface<T>
*/
interface PaymentRepositoryInterface extends RepositoryInterface
{
public function createListQueryBuilder(): QueryBuilder;

View file

@ -17,6 +17,10 @@ use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Product\Model\ProductAssociationInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @template T of ProductAssociationInterface
* @extends RepositoryInterface<T>
*/
interface ProductAssociationRepositoryInterface extends RepositoryInterface
{
public function findWithProductsWithinChannel($associationId, ChannelInterface $channel): ProductAssociationInterface;

View file

@ -19,6 +19,10 @@ use Sylius\Component\Core\Model\ProductInterface;
use Sylius\Component\Core\Model\TaxonInterface;
use Sylius\Component\Product\Repository\ProductRepositoryInterface as BaseProductRepositoryInterface;
/**
* @template T of ProductInterface
* @extends BaseProductRepositoryInterface<T>
*/
interface ProductRepositoryInterface extends BaseProductRepositoryInterface
{
/** @param mixed|null $taxonId */

View file

@ -18,6 +18,10 @@ use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
use Sylius\Component\Review\Model\ReviewInterface;
/**
* @template T of ReviewInterface
* @extends RepositoryInterface<T>
*/
interface ProductReviewRepositoryInterface extends RepositoryInterface
{
/**

View file

@ -16,6 +16,10 @@ namespace Sylius\Component\Core\Repository;
use Sylius\Component\Core\Model\ProductTaxonInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @template T of ProductTaxonInterface
* @extends RepositoryInterface<T>
*/
interface ProductTaxonRepositoryInterface extends RepositoryInterface
{
public function findOneByProductCodeAndTaxonCode(string $productCode, string $taxonCode): ?ProductTaxonInterface;

View file

@ -15,9 +15,14 @@ namespace Sylius\Component\Core\Repository;
use Doctrine\ORM\QueryBuilder;
use Sylius\Component\Core\Model\CatalogPromotionInterface;
use Sylius\Component\Core\Model\ProductVariantInterface;
use Sylius\Component\Core\Model\TaxonInterface;
use Sylius\Component\Product\Repository\ProductVariantRepositoryInterface as BaseProductVariantRepositoryInterface;
/**
* @template T of ProductVariantInterface
* @extends BaseProductVariantRepositoryInterface<T>
*/
interface ProductVariantRepositoryInterface extends BaseProductVariantRepositoryInterface
{
public function createInventoryListQueryBuilder(string $locale): QueryBuilder;

View file

@ -17,6 +17,10 @@ use Sylius\Component\Channel\Model\ChannelInterface;
use Sylius\Component\Core\Model\PromotionInterface;
use Sylius\Component\Promotion\Repository\PromotionRepositoryInterface as BasePromotionRepositoryInterface;
/**
* @template T of PromotionInterface
* @extends BasePromotionRepositoryInterface<T>
*/
interface PromotionRepositoryInterface extends BasePromotionRepositoryInterface
{
/**

View file

@ -19,6 +19,10 @@ use Sylius\Component\Core\Model\CustomerInterface;
use Sylius\Component\Core\Model\ShipmentInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @template T of ShipmentInterface
* @extends RepositoryInterface<T>
*/
interface ShipmentRepositoryInterface extends RepositoryInterface
{
public function createListQueryBuilder(): QueryBuilder;

View file

@ -15,7 +15,12 @@ namespace Sylius\Component\Core\Repository;
use Doctrine\ORM\QueryBuilder;
use Sylius\Component\Resource\Repository\RepositoryInterface;
use Sylius\Component\Shipping\Model\ShippingCategoryInterface;
/**
* @template T of ShippingCategoryInterface
* @extends RepositoryInterface<T>
*/
interface ShippingCategoryRepositoryInterface extends RepositoryInterface
{
public function createListQueryBuilder(): QueryBuilder;

View file

@ -18,6 +18,10 @@ use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Core\Model\ShippingMethodInterface;
use Sylius\Component\Shipping\Repository\ShippingMethodRepositoryInterface as BaseShippingMethodRepositoryInterface;
/**
* @template T of ShippingMethodInterface
* @extends BaseShippingMethodRepositoryInterface<T>
*/
interface ShippingMethodRepositoryInterface extends BaseShippingMethodRepositoryInterface
{
public function createListQueryBuilder(string $locale): QueryBuilder;

View file

@ -16,6 +16,10 @@ namespace Sylius\Component\Currency\Repository;
use Sylius\Component\Currency\Model\ExchangeRateInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @template T of ExchangeRateInterface
* @extends RepositoryInterface<T>
*/
interface ExchangeRateRepositoryInterface extends RepositoryInterface
{
public function findOneWithCurrencyPair(string $firstCurrencyCode, string $secondCurrencyCode): ?ExchangeRateInterface;

View file

@ -13,8 +13,13 @@ declare(strict_types=1);
namespace Sylius\Component\Customer\Repository;
use Sylius\Component\Customer\Model\CustomerGroupInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
/**
* @template T of CustomerGroupInterface
* @extends RepositoryInterface<T>
*/
interface CustomerGroupRepositoryInterface extends RepositoryInterface
{
public function findByPhrase(string $phrase, ?int $limit = null): iterable;

View file

@ -16,6 +16,9 @@ namespace Sylius\Component\Order\Factory;
use Sylius\Component\Order\Model\AdjustmentInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @implements AdjustmentFactoryInterface<AdjustmentInterface>
*/
class AdjustmentFactory implements AdjustmentFactoryInterface
{
public function __construct(private FactoryInterface $adjustmentFactory)

View file

@ -16,6 +16,10 @@ namespace Sylius\Component\Order\Factory;
use Sylius\Component\Order\Model\AdjustmentInterface;
use Sylius\Component\Resource\Factory\FactoryInterface;
/**
* @template T of AdjustmentInterface
* @extends FactoryInterface<T>
*/
interface AdjustmentFactoryInterface extends FactoryInterface
{
public function createWithData(

View file

@ -17,6 +17,9 @@ use Sylius\Component\Order\Model\OrderItemInterface;
use Sylius\Component\Order\Model\OrderItemUnitInterface;
use Sylius\Component\Resource\Exception\UnsupportedMethodException;
/**
* @implements OrderItemUnitFactoryInterface<OrderItemUnitInterface>
*/
class OrderItemUnitFactory implements OrderItemUnitFactoryInterface
{
/**

Some files were not shown because too many files have changed in this diff Show more