Skip to content

Commit

Permalink
Deprecates class and services
Browse files Browse the repository at this point in the history
  • Loading branch information
lruozzi9 committed Oct 8, 2024
1 parent 803d3fd commit 763ae6d
Show file tree
Hide file tree
Showing 34 changed files with 105 additions and 4 deletions.
1 change: 1 addition & 0 deletions config/services/checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
service('webgriffe_sylius_clerk.provider.public_api_key'),
service('webgriffe_sylius_clerk.provider.private_api_key'),
])
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'The "%service_id%" service is deprecated and will be removed in 4.0.')
;
};
1 change: 1 addition & 0 deletions config/services/command.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
'$router' => service('router'),
'$logger' => service('monolog.logger'),
])
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'The "%service_id%" service is deprecated and will be removed in 4.0.')
->tag('console.command')
;

Expand Down
1 change: 1 addition & 0 deletions config/services/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
service('webgriffe_sylius_clerk.provider.private_api_key'),
service('webgriffe_sylius_clerk.checker.channel_enabled'),
])
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'The "%service_id%" service is deprecated and will be removed in 4.0.')
->tag('controller.service_arguments')
->call('setContainer', [service('service_container')])
;
Expand Down
1 change: 1 addition & 0 deletions config/services/generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
service(PageResolver::class),
service('serializer'),
])
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'The "%service_id%" service is deprecated and will be removed in 4.0.')
;

$services->set('webgriffe_sylius_clerk_plugin.feed_generator.products', ResourceFeedGenerator::class)
Expand Down
8 changes: 6 additions & 2 deletions config/services/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@
return static function (ContainerConfigurator $containerConfigurator) {
$services = $containerConfigurator->services();

$services->set('webgriffe_sylius_clerk.provider.private_api_key', PrivateApiKeyProvider::class);
$services->set('webgriffe_sylius_clerk.provider.private_api_key', PrivateApiKeyProvider::class)
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'The "%service_id%" service is deprecated and will be removed in 4.0.')
;

$services->set('webgriffe_sylius_clerk.provider.public_api_key', PublicApiKeyProvider::class);
$services->set('webgriffe_sylius_clerk.provider.public_api_key', PublicApiKeyProvider::class)
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'The "%service_id%" service is deprecated and will be removed in 4.0.')
;

$services->set('webgriffe_sylius_clerk_plugin.provider.products', QueryBuilderResourceProvider::class)
->args([
Expand Down
4 changes: 4 additions & 0 deletions config/services/query_builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,28 @@
->args([
service('sylius.repository.product'),
])
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'The "%service_id%" service is deprecated and will be removed in 4.0.')
;

$services->set(TaxonsQueryBuilderFactory::class)
->args([
service('sylius.repository.taxon'),
])
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'The "%service_id%" service is deprecated and will be removed in 4.0.')
;

$services->set(OrdersQueryBuilderFactory::class)
->args([
service('sylius.repository.order'),
])
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'The "%service_id%" service is deprecated and will be removed in 4.0.')
;

$services->set(CustomersQueryBuilderFactory::class)
->args([
service('sylius.repository.customer'),
])
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'The "%service_id%" service is deprecated and will be removed in 4.0.')
;

$services->set('webgriffe_sylius_clerk_plugin.query_builder.products', ProductsQueryBuilder::class)
Expand Down
5 changes: 4 additions & 1 deletion config/services/resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
return static function (ContainerConfigurator $containerConfigurator) {
$services = $containerConfigurator->services();

$services->set(PageResolver::class);
$services->set(PageResolver::class)
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'The "%service_id%" service is deprecated and will be removed in 4.0.')
;

$services->set(OrderResolver::class)
->args([
service(OrdersQueryBuilderFactory::class),
])
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'The "%service_id%" service is deprecated and will be removed in 4.0.')
;
};
4 changes: 4 additions & 0 deletions config/services/serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
service('router'),
service('liip_imagine.service.filter'),
])
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'The "%service_id%" service is deprecated and will be removed in 4.0.')
->tag('serializer.normalizer', ['priority' => 120])
;

Expand All @@ -32,17 +33,20 @@
service('router'),
service('sylius.repository.taxon'),
])
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'The "%service_id%" service is deprecated and will be removed in 4.0.')
->tag('serializer.normalizer', ['priority' => 120])
;

$services->set(OrderNormalizer::class)
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'Service "%service_id%" is deprecated and will be removed in the next major version.')
->tag('serializer.normalizer', ['priority' => 120])
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'The "%service_id%" service is deprecated and will be removed in 4.0.')
;

$services->set(CustomerNormalizer::class)
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'Service "%service_id%" is deprecated and will be removed in the next major version.')
->tag('serializer.normalizer', ['priority' => 120])
->deprecate('webgriffe/sylius-clerk-plugin', '3.0', 'The "%service_id%" service is deprecated and will be removed in 4.0.')
;

$services->set('webgriffe_sylius_clerk_plugin.normalizer.product', V2ProductNormalizer::class)
Expand Down
10 changes: 10 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
</ignoreFiles>
</projectFiles>
<issueHandlers>
<DeprecatedInterface>
<errorLevel type="suppress">
<directory name="src/"/>
</errorLevel>
</DeprecatedInterface>
<DeprecatedClass>
<errorLevel type="suppress">
<directory name="src/"/>
</errorLevel>
</DeprecatedClass>
<PropertyNotSetInConstructor>
<errorLevel type="suppress">
<referencedProperty name="Symfony\Bundle\FrameworkBundle\Controller\AbstractController::$container"/>
Expand Down
2 changes: 1 addition & 1 deletion src/Command/FeedGeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Webmozart\Assert\Assert;

/**
* @deprecated
* @deprecated This command is deprecated and will be removed in the next major version.
*/
final class FeedGeneratorCommand extends Command
{
Expand Down
3 changes: 3 additions & 0 deletions src/Controller/FeedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
use Webgriffe\SyliusClerkPlugin\Service\FeedGeneratorInterface;
use Webgriffe\SyliusClerkPlugin\Service\PrivateApiKeyProviderInterface;

/**
* @deprecated This controller is deprecated and will be removed in the next major version.
*/
final class FeedController extends AbstractController
{
private ?ChannelApiKeyCheckerInterface $channelApiKeyChecker;
Expand Down
3 changes: 3 additions & 0 deletions src/Exception/PrivateApiKeyNotFoundForChannelException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Sylius\Component\Core\Model\ChannelInterface;

/**
* @deprecated Use \Webgriffe\SyliusClerkPlugin\Provider\Exception\ChannelApiKeysNotProvidedException instead
*/
final class PrivateApiKeyNotFoundForChannelException extends \RuntimeException
{
public function __construct(ChannelInterface $channel)
Expand Down
3 changes: 3 additions & 0 deletions src/Exception/PublicApiKeyNotFoundForChannelException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Sylius\Component\Core\Model\ChannelInterface;

/**
* @deprecated Use \Webgriffe\SyliusClerkPlugin\Provider\Exception\ChannelApiKeysNotProvidedException instead
*/
final class PublicApiKeyNotFoundForChannelException extends \RuntimeException
{
public function __construct(ChannelInterface $channel)
Expand Down
3 changes: 3 additions & 0 deletions src/Normalizer/CustomerNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Webgriffe\SyliusClerkPlugin\Service\FeedGenerator;

/**
* @deprecated This class is deprecated and will be removed in the next major version. Use the new Clerk feed v2 normalizer instead.
*/
final class CustomerNormalizer implements NormalizerInterface
{
public function normalize($object, string $format = null, array $context = [])
Expand Down
3 changes: 3 additions & 0 deletions src/Normalizer/OrderNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Webgriffe\SyliusClerkPlugin\Service\FeedGenerator;

/**
* @deprecated This class is deprecated and will be removed in the next major version. Use the new Clerk feed v2 normalizer instead.
*/
final class OrderNormalizer implements NormalizerInterface
{
public function normalize($object, string $format = null, array $context = [])
Expand Down
3 changes: 3 additions & 0 deletions src/Normalizer/ProductNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
use Webgriffe\SyliusClerkPlugin\Service\FeedGenerator;
use Webmozart\Assert\Assert;

/**
* @deprecated This class is deprecated and will be removed in the next major version. Use the new Clerk feed v2 normalizer instead.
*/
final class ProductNormalizer implements NormalizerInterface
{
public function __construct(
Expand Down
3 changes: 3 additions & 0 deletions src/Normalizer/TaxonNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
use Webgriffe\SyliusClerkPlugin\Service\FeedGenerator;
use Webmozart\Assert\Assert;

/**
* @deprecated This class is deprecated and will be removed in the next major version. Use the new Clerk feed v2 normalizer instead.
*/
final class TaxonNormalizer implements NormalizerInterface
{
public function __construct(
Expand Down
3 changes: 3 additions & 0 deletions src/QueryBuilder/CustomersQueryBuilderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use Sylius\Component\Core\Repository\CustomerRepositoryInterface;
use Webmozart\Assert\Assert;

/**
* @deprecated This class is deprecated and will be removed in the next major version. Use query builder event on v2 feed generation instead.
*/
final class CustomersQueryBuilderFactory implements QueryBuilderFactoryInterface
{
public function __construct(
Expand Down
3 changes: 3 additions & 0 deletions src/QueryBuilder/OrdersQueryBuilderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use Sylius\Component\Core\Repository\OrderRepositoryInterface;
use Webmozart\Assert\Assert;

/**
* @deprecated This class is deprecated and will be removed in the next major version. Use query builder event on v2 feed generation instead.
*/
final class OrdersQueryBuilderFactory implements QueryBuilderFactoryInterface
{
public function __construct(private OrderRepositoryInterface $orderRepository)
Expand Down
3 changes: 3 additions & 0 deletions src/QueryBuilder/ProductsQueryBuilderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use Sylius\Component\Locale\Model\LocaleInterface;
use Webmozart\Assert\Assert;

/**
* @deprecated This class is deprecated and will be removed in the next major version. Use query builder event on v2 feed generation instead.
*/
final class ProductsQueryBuilderFactory implements QueryBuilderFactoryInterface
{
public function __construct(private ProductRepositoryInterface $productRepository)
Expand Down
3 changes: 3 additions & 0 deletions src/QueryBuilder/QueryBuilderFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
use Doctrine\ORM\QueryBuilder;
use Sylius\Component\Core\Model\ChannelInterface;

/**
* @deprecated This class is deprecated and will be removed in the next major version. Use query builder event on v2 feed generation instead.
*/
interface QueryBuilderFactoryInterface
{
public function createQueryBuilder(ChannelInterface $channel): QueryBuilder;
Expand Down
3 changes: 3 additions & 0 deletions src/QueryBuilder/TaxonsQueryBuilderFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use Sylius\Component\Core\Model\ChannelInterface;
use Sylius\Component\Taxonomy\Repository\TaxonRepositoryInterface;

/**
* @deprecated This class is deprecated and will be removed in the next major version. Use query builder event on v2 feed generation instead.
*/
final class TaxonsQueryBuilderFactory implements QueryBuilderFactoryInterface
{
public function __construct(private TaxonRepositoryInterface $taxonRepository)
Expand Down
3 changes: 3 additions & 0 deletions src/Resolver/OrderResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use Webgriffe\SyliusClerkPlugin\QueryBuilder\QueryBuilderFactoryInterface;
use Webmozart\Assert\Assert;

/**
* @deprecated This class is deprecated and will be removed in the next major version. Use resource provider on v2 feed generation instead.
*/
final class OrderResolver implements OrderResolverInterface
{
public function __construct(
Expand Down
3 changes: 3 additions & 0 deletions src/Resolver/OrderResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Sylius\Component\Core\Model\ChannelInterface;

/**
* @deprecated This class is deprecated and will be removed in the next major version. Use resource provider on v2 feed generation instead.
*/
interface OrderResolverInterface
{
public function createOrdersList(ChannelInterface $channel): array;
Expand Down
3 changes: 3 additions & 0 deletions src/Resolver/PageResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace Webgriffe\SyliusClerkPlugin\Resolver;

/**
* @deprecated This class is deprecated and will be removed in the next major version. Use resource provider on v2 feed generation instead.
*/
final class PageResolver implements PageResolverInterface
{
public function createPageList(): array
Expand Down
3 changes: 3 additions & 0 deletions src/Resolver/PageResolverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace Webgriffe\SyliusClerkPlugin\Resolver;

/**
* @deprecated This class is deprecated and will be removed in the next major version. Use resource provider on v2 feed generation instead.
*/
interface PageResolverInterface
{
public function createPageList(): array;
Expand Down
3 changes: 3 additions & 0 deletions src/Service/ChannelApiKeyChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use Webgriffe\SyliusClerkPlugin\Exception\PrivateApiKeyNotFoundForChannelException;
use Webgriffe\SyliusClerkPlugin\Exception\PublicApiKeyNotFoundForChannelException;

/**
* @deprecated This class is deprecated and will be removed in the next major version.
*/
final class ChannelApiKeyChecker implements ChannelApiKeyCheckerInterface
{
public function __construct(
Expand Down
3 changes: 3 additions & 0 deletions src/Service/ChannelApiKeyCheckerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Sylius\Component\Core\Model\ChannelInterface;

/**
* @deprecated This class is deprecated and will be removed in the next major version.
*/
interface ChannelApiKeyCheckerInterface
{
public function check(ChannelInterface $channel): bool;
Expand Down
3 changes: 3 additions & 0 deletions src/Service/FeedGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
use Webgriffe\SyliusClerkPlugin\Resolver\OrderResolverInterface;
use Webgriffe\SyliusClerkPlugin\Resolver\PageResolverInterface;

/**
* @deprecated This class is deprecated and will be removed in the next major version.
*/
final class FeedGenerator implements FeedGeneratorInterface
{
public const NORMALIZATION_FORMAT = 'clerk_array';
Expand Down
3 changes: 3 additions & 0 deletions src/Service/FeedGeneratorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Sylius\Component\Core\Model\ChannelInterface;

/**
* @deprecated This class is deprecated and will be removed in the next major version.
*/
interface FeedGeneratorInterface
{
public function generate(ChannelInterface $channel): string;
Expand Down
3 changes: 3 additions & 0 deletions src/Service/PrivateApiKeyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
use Sylius\Component\Core\Model\ChannelInterface;
use Webgriffe\SyliusClerkPlugin\Exception\PrivateApiKeyNotFoundForChannelException;

/**
* @deprecated This class is deprecated and will be removed in the next major version.
*/
final class PrivateApiKeyProvider implements PrivateApiKeyProviderInterface
{
public function __construct(private array $clerkStores)
Expand Down
3 changes: 3 additions & 0 deletions src/Service/PrivateApiKeyProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
use Sylius\Component\Core\Model\ChannelInterface;
use Webgriffe\SyliusClerkPlugin\Exception\PrivateApiKeyNotFoundForChannelException;

/**
* @deprecated This class is deprecated and will be removed in the next major version.
*/
interface PrivateApiKeyProviderInterface
{
/**
Expand Down
3 changes: 3 additions & 0 deletions src/Service/PublicApiKeyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
use Sylius\Component\Core\Model\ChannelInterface;
use Webgriffe\SyliusClerkPlugin\Exception\PublicApiKeyNotFoundForChannelException;

/**
* @deprecated This class is deprecated and will be removed in the next major version.
*/
final class PublicApiKeyProvider implements PublicApiKeyProviderInterface
{
public function __construct(private array $clerkStores)
Expand Down
3 changes: 3 additions & 0 deletions src/Service/PublicApiKeyProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
use Sylius\Component\Core\Model\ChannelInterface;
use Webgriffe\SyliusClerkPlugin\Exception\PublicApiKeyNotFoundForChannelException;

/**
* @deprecated This class is deprecated and will be removed in the next major version.
*/
interface PublicApiKeyProviderInterface
{
/**
Expand Down

0 comments on commit 763ae6d

Please sign in to comment.