Skip to content

Commit

Permalink
refactor #760 Remove Component namespace on context (loic425)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.11 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | 
| License         | MIT


Commits
-------

e409f8e Remove Component namespace on context
  • Loading branch information
lchrusciel authored Oct 24, 2023
2 parents 0de9728 + e409f8e commit f0ff413
Show file tree
Hide file tree
Showing 102 changed files with 148 additions and 141 deletions.
5 changes: 5 additions & 0 deletions phpspec.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ suites:
psr4_prefix: Sylius\Component\Resource
src_path: src/Component
spec_path: src/Component
Package:
namespace: Sylius\Resource
psr4_prefix: Sylius\Resource
src_path: src/Component/src
spec_path: src/Component/tests

extensions:
Akeneo\SkipExampleExtension: ~
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ parameters:
- %currentWorkingDirectory%/src/Component/Annotation/*
- %currentWorkingDirectory%/src/Component/Reflection/ClassReflection.php
- %currentWorkingDirectory%/src/Component/spec/*
- %currentWorkingDirectory%/src/Component/tests/spec/*
- %currentWorkingDirectory%/src/Component/vendor/*

ignoreErrors:
Expand Down
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<directory name="src/Bundle/Doctrine/ODM" />
<directory name="src/Bundle/spec" />
<directory name="src/Component/spec" />
<directory name="src/Component/tests/spec" />
<directory name="src/Component/vendor" />
<file name="src/Bundle/Controller/ControllerTrait.php" />
<file name="src/Bundle/DependencyInjection/Driver/Doctrine/DoctrineODMDriver.php" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

use Sylius\Bundle\ResourceBundle\Context\Option\RequestConfigurationOption;
use Sylius\Bundle\ResourceBundle\Controller\RequestConfigurationFactoryInterface;
use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Context\Initiator\RequestContextInitiatorInterface;
use Sylius\Component\Resource\Context\Option\MetadataOption;
use Sylius\Component\Resource\Metadata\RegistryInterface;
use Sylius\Resource\Context\Context;
use Sylius\Resource\Context\Initiator\RequestContextInitiatorInterface;
use Sylius\Resource\Context\Option\MetadataOption;
use Symfony\Component\HttpFoundation\Request;

final class LegacyRequestContextInitiator implements RequestContextInitiatorInterface
Expand Down
4 changes: 2 additions & 2 deletions src/Bundle/Grid/View/LegacyGridViewFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
use Sylius\Component\Grid\Definition\Grid;
use Sylius\Component\Grid\Parameters;
use Sylius\Component\Grid\View\GridView;
use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Context\Option\MetadataOption;
use Sylius\Component\Resource\Grid\View\Factory\GridViewFactoryInterface;
use Sylius\Resource\Context\Context;
use Sylius\Resource\Context\Option\MetadataOption;

final class LegacyGridViewFactory implements GridViewFactoryInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/Bundle/Resources/config/services/context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="sylius.context.initiator.request_context" class="Sylius\Component\Resource\Context\Initiator\RequestContextInitiator" />
<service id="Sylius\Component\Resource\Context\Initiator\RequestContextInitiatorInterface" alias="sylius.context.initiator.request_context" />
<service id="sylius.context.initiator.request_context" class="Sylius\Resource\Context\Initiator\RequestContextInitiator" />
<service id="Sylius\Resource\Context\Initiator\RequestContextInitiatorInterface" alias="sylius.context.initiator.request_context" />

<service id="sylius.context.initiator.legacy_request_context"
class="Sylius\Bundle\ResourceBundle\Context\Initiator\LegacyRequestContextInitiator"
Expand Down
4 changes: 2 additions & 2 deletions src/Bundle/Twig/Context/LegacyContextFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
namespace Sylius\Bundle\ResourceBundle\Twig\Context;

use Sylius\Bundle\ResourceBundle\Context\Option\RequestConfigurationOption;
use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Context\Option\MetadataOption;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Component\Resource\Twig\Context\Factory\ContextFactoryInterface;
use Sylius\Resource\Context\Context;
use Sylius\Resource\Context\Option\MetadataOption;

final class LegacyContextFactory implements ContextFactoryInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
use Sylius\Bundle\ResourceBundle\Context\Option\RequestConfigurationOption;
use Sylius\Bundle\ResourceBundle\Controller\RequestConfiguration;
use Sylius\Bundle\ResourceBundle\Controller\RequestConfigurationFactoryInterface;
use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Context\Initiator\RequestContextInitiatorInterface;
use Sylius\Component\Resource\Context\Option\MetadataOption;
use Sylius\Component\Resource\Metadata\MetadataInterface;
use Sylius\Component\Resource\Metadata\RegistryInterface;
use Sylius\Resource\Context\Context;
use Sylius\Resource\Context\Initiator\RequestContextInitiatorInterface;
use Sylius\Resource\Context\Option\MetadataOption;
use Symfony\Component\HttpFoundation\ParameterBag;
use Symfony\Component\HttpFoundation\Request;

Expand Down
4 changes: 2 additions & 2 deletions src/Bundle/spec/Grid/View/LegacyGridViewFactorySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
use Sylius\Component\Grid\Definition\Grid;
use Sylius\Component\Grid\Parameters;
use Sylius\Component\Grid\View\GridView;
use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Context\Option\MetadataOption;
use Sylius\Component\Resource\Grid\View\Factory\GridViewFactoryInterface;
use Sylius\Component\Resource\Metadata\MetadataInterface;
use Sylius\Resource\Context\Context;
use Sylius\Resource\Context\Option\MetadataOption;

final class LegacyGridViewFactorySpec extends ObjectBehavior
{
Expand Down
4 changes: 2 additions & 2 deletions src/Bundle/spec/Twig/Context/LegacyContextFactorySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
use Sylius\Bundle\ResourceBundle\Context\Option\RequestConfigurationOption;
use Sylius\Bundle\ResourceBundle\Controller\RequestConfiguration;
use Sylius\Bundle\ResourceBundle\Twig\Context\LegacyContextFactory;
use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Context\Option\MetadataOption;
use Sylius\Component\Resource\Metadata\MetadataInterface;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Component\Resource\Twig\Context\Factory\ContextFactoryInterface;
use Sylius\Resource\Context\Context;
use Sylius\Resource\Context\Option\MetadataOption;

final class LegacyContextFactorySpec extends ObjectBehavior
{
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Doctrine/Common/State/PersistProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\Persistence\ManagerRegistry;
use Doctrine\Persistence\ObjectManager as DoctrineObjectManager;
use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Component\Resource\Reflection\ClassInfoTrait;
use Sylius\Component\Resource\State\ProcessorInterface;
use Sylius\Resource\Context\Context;

final class PersistProcessor implements ProcessorInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Doctrine/Common/State/RemoveProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

use Doctrine\Persistence\ManagerRegistry;
use Doctrine\Persistence\ObjectManager as DoctrineObjectManager;
use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Component\Resource\Reflection\ClassInfoTrait;
use Sylius\Component\Resource\State\ProcessorInterface;
use Sylius\Resource\Context\Context;

final class RemoveProcessor implements ProcessorInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Grid/State/RequestGridProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
use Pagerfanta\Pagerfanta;
use Sylius\Component\Grid\Parameters;
use Sylius\Component\Grid\Provider\GridProviderInterface;
use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Context\Option\RequestOption;
use Sylius\Component\Resource\Grid\View\Factory\GridViewFactoryInterface;
use Sylius\Component\Resource\Metadata\GridAwareOperationInterface;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Component\Resource\State\ProviderInterface;
use Sylius\Resource\Context\Context;
use Sylius\Resource\Context\Option\RequestOption;

final class RequestGridProvider implements ProviderInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Grid/View/Factory/GridViewFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Sylius\Component\Grid\Definition\Grid;
use Sylius\Component\Grid\Parameters;
use Sylius\Component\Grid\View\GridView;
use Sylius\Component\Resource\Context\Context;
use Sylius\Resource\Context\Context;

final class GridViewFactory implements GridViewFactoryInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Sylius\Component\Grid\Definition\Grid;
use Sylius\Component\Grid\Parameters;
use Sylius\Component\Grid\View\GridView;
use Sylius\Component\Resource\Context\Context;
use Sylius\Resource\Context\Context;

interface GridViewFactoryInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Component/State/BulkAwareProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace Sylius\Component\Resource\State;

use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\BulkOperationInterface;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Resource\Context\Context;

/**
* @experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Component/State/EventDispatcherBulkAwareProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

namespace Sylius\Component\Resource\State;

use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\BulkOperationInterface;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Component\Resource\Symfony\EventDispatcher\OperationEventDispatcherInterface;
use Sylius\Resource\Context\Context;

/**
* @experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Component/State/EventDispatcherProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

namespace Sylius\Component\Resource\State;

use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\CreateOperationInterface;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Component\Resource\ResourceActions;
use Sylius\Component\Resource\Symfony\EventDispatcher\OperationEventDispatcherInterface;
use Sylius\Component\Resource\Symfony\EventDispatcher\OperationEventHandlerInterface;
use Sylius\Resource\Context\Context;

/**
* @experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Component/State/EventDispatcherProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

namespace Sylius\Component\Resource\State;

use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\CollectionOperationInterface;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Component\Resource\Metadata\ShowOperationInterface;
use Sylius\Component\Resource\Symfony\EventDispatcher\OperationEventDispatcherInterface;
use Sylius\Resource\Context\Context;

/**
* @experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Component/State/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
namespace Sylius\Component\Resource\State;

use Psr\Container\ContainerInterface;
use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Factory\FactoryInterface as ResourceFactoryInterface;
use Sylius\Component\Resource\Metadata\FactoryAwareOperationInterface;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Component\Resource\Symfony\ExpressionLanguage\ArgumentParserInterface;
use Sylius\Resource\Context\Context;
use Webmozart\Assert\Assert;

final class Factory implements FactoryInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Component/State/FactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

namespace Sylius\Component\Resource\State;

use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Resource\Context\Context;

/**
* @experimental
Expand Down
2 changes: 1 addition & 1 deletion src/Component/State/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
namespace Sylius\Component\Resource\State;

use Psr\Container\ContainerInterface;
use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Resource\Context\Context;
use Webmozart\Assert\Assert;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Component/State/ProcessorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

namespace Sylius\Component\Resource\State;

use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Resource\Context\Context;

/**
* Process data: send an email, persist to storage, add to queue etc.
Expand Down
2 changes: 1 addition & 1 deletion src/Component/State/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
namespace Sylius\Component\Resource\State;

use Psr\Container\ContainerInterface;
use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Resource\Context\Context;
use Webmozart\Assert\Assert;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Component/State/ProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

namespace Sylius\Component\Resource\State;

use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Resource\Context\Context;

/**
* Retrieves data from a persistence layer.
Expand Down
2 changes: 1 addition & 1 deletion src/Component/State/Responder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
namespace Sylius\Component\Resource\State;

use Psr\Container\ContainerInterface;
use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Resource\Context\Context;
use Webmozart\Assert\Assert;

final class Responder implements ResponderInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Component/State/ResponderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

namespace Sylius\Component\Resource\State;

use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Resource\Context\Context;

interface ResponderInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Component/StateMachine/OperationStateMachine.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
namespace Sylius\Component\Resource\StateMachine;

use Psr\Container\ContainerInterface;
use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Component\Resource\Metadata\StateMachineAwareOperationInterface;
use Sylius\Resource\Context\Context;
use Webmozart\Assert\Assert;

final class OperationStateMachine implements OperationStateMachineInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

namespace Sylius\Component\Resource\StateMachine;

use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Resource\Context\Context;

interface OperationStateMachineInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

namespace Sylius\Component\Resource\StateMachine\State;

use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Component\Resource\State\ProcessorInterface;
use Sylius\Component\Resource\StateMachine\OperationStateMachineInterface;
use Sylius\Resource\Context\Context;

final class ApplyStateMachineTransitionProcessor implements ProcessorInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Symfony/EventDispatcher/OperationEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

namespace Sylius\Component\Resource\Symfony\EventDispatcher;

use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Resource\Context\Context;

final class OperationEvent extends GenericEvent
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

namespace Sylius\Component\Resource\Symfony\EventDispatcher;

use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Resource\Context\Context;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

final class OperationEventDispatcher implements OperationEventDispatcherInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

namespace Sylius\Component\Resource\Symfony\EventDispatcher;

use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Metadata\Operation;
use Sylius\Resource\Context\Context;

interface OperationEventDispatcherInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

namespace Sylius\Component\Resource\Symfony\EventDispatcher;

use Sylius\Component\Resource\Context\Context;
use Sylius\Component\Resource\Context\Option\RequestOption;
use Sylius\Component\Resource\Metadata\HttpOperation;
use Sylius\Component\Resource\Symfony\Routing\RedirectHandlerInterface;
use Sylius\Component\Resource\Symfony\Session\Flash\FlashHelperInterface;
use Sylius\Resource\Context\Context;
use Sylius\Resource\Context\Option\RequestOption;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Sylius\Component\Resource\Symfony\EventDispatcher;

use Sylius\Component\Resource\Context\Context;
use Sylius\Resource\Context\Context;
use Symfony\Component\HttpFoundation\Response;

/**
Expand Down
Loading

0 comments on commit f0ff413

Please sign in to comment.