@@ -11,12 +11,7 @@ |
||
11 | 11 | |
12 | 12 | namespace Sylius\Bundle\ResourceBundle\Doctrine\ODM\PHPCR\EventListener; |
13 | 13 | |
14 | -use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
|
15 | -use Symfony\Component\Form\FormEvents; |
|
16 | -use Symfony\Component\Form\FormEvent; |
|
17 | 14 | use Doctrine\ODM\PHPCR\DocumentManagerInterface; |
18 | -use PHPCR\Util\NodeHelper; |
|
19 | -use Doctrine\ODM\PHPCR\Mapping\ClassMetadata; |
|
20 | 15 | use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent; |
21 | 16 | |
22 | 17 | /** |
@@ -65,8 +65,7 @@ |
||
65 | 65 | |
66 | 66 | function is_configures_options( |
67 | 67 | OptionsResolver $resolver |
68 | - ) |
|
69 | - { |
|
68 | + ) { |
|
70 | 69 | $resolver->setDefaults([ |
71 | 70 | 'format' => 'Y:m:d H:i:s' |
72 | 71 | ])->shouldBeCalled(); |
@@ -11,11 +11,7 @@ |
||
11 | 11 | |
12 | 12 | namespace Sylius\Bundle\ResourceBundle\Doctrine\ODM\PHPCR\EventListener; |
13 | 13 | |
14 | -use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
|
15 | -use Symfony\Component\Form\FormEvents; |
|
16 | -use Symfony\Component\Form\FormEvent; |
|
17 | 14 | use Doctrine\ODM\PHPCR\DocumentManagerInterface; |
18 | -use PHPCR\Util\NodeHelper; |
|
19 | 15 | use Doctrine\ODM\PHPCR\Mapping\ClassMetadata; |
20 | 16 | use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent; |
21 | 17 |
@@ -65,8 +65,7 @@ |
||
65 | 65 | |
66 | 66 | function is_configures_options( |
67 | 67 | OptionsResolver $resolver |
68 | - ) |
|
69 | - { |
|
68 | + ) { |
|
70 | 69 | $resolver->setDefaults([ |
71 | 70 | 'format' => 'Y:m:d H:i:s' |
72 | 71 | ])->shouldBeCalled(); |
@@ -11,14 +11,10 @@ |
||
11 | 11 | |
12 | 12 | namespace Sylius\Bundle\ResourceBundle\Doctrine\ODM\PHPCR\Form\Builder; |
13 | 13 | |
14 | -use Doctrine\DBAL\Types\Type; |
|
14 | +use Doctrine\ODM\PHPCR\DocumentManagerInterface; |
|
15 | 15 | use Sylius\Bundle\ResourceBundle\Form\Builder\DefaultFormBuilderInterface; |
16 | 16 | use Sylius\Component\Resource\Metadata\MetadataInterface; |
17 | 17 | use Symfony\Component\Form\FormBuilderInterface; |
18 | -use Doctrine\ODM\PHPCR\DocumentManagerInterface; |
|
19 | -use Doctrine\ODM\PHPCR\Mapping\ClassMetadata; |
|
20 | -use Sylius\Bundle\ResourceBundle\Doctrine\ODM\PHPCR\Form\Subscriber\DefaultPathSubscriber; |
|
21 | -use Sylius\Bundle\ResourceBundle\Doctrine\ODM\PHPCR\Form\Subscriber\NameResolverSubscriber; |
|
22 | 18 | |
23 | 19 | /** |
24 | 20 | * @author Daniel Leech <[email protected]> |
@@ -65,8 +65,7 @@ |
||
65 | 65 | |
66 | 66 | function is_configures_options( |
67 | 67 | OptionsResolver $resolver |
68 | - ) |
|
69 | - { |
|
68 | + ) { |
|
70 | 69 | $resolver->setDefaults([ |
71 | 70 | 'format' => 'Y:m:d H:i:s' |
72 | 71 | ])->shouldBeCalled(); |
@@ -70,7 +70,7 @@ |
||
70 | 70 | |
71 | 71 | /** |
72 | 72 | * @param ClassMetadataInfo $metadata |
73 | - * @param $configuration |
|
73 | + * @param \Doctrine\ORM\Configuration $configuration |
|
74 | 74 | */ |
75 | 75 | private function setAssociationMappings(ClassMetadataInfo $metadata, $configuration) |
76 | 76 | { |
@@ -153,7 +153,7 @@ |
||
153 | 153 | * Check if a unique constraint has been defined. |
154 | 154 | * |
155 | 155 | * @param ClassMetadata $metadata |
156 | - * @param array $columns |
|
156 | + * @param string[] $columns |
|
157 | 157 | * |
158 | 158 | * @return bool |
159 | 159 | */ |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | return; |
81 | 81 | } |
82 | 82 | |
83 | - $translationResourceMetadata = $this->registry->get($resourceMetadata->getAlias().'_translation'); |
|
83 | + $translationResourceMetadata = $this->registry->get($resourceMetadata->getAlias() . '_translation'); |
|
84 | 84 | |
85 | 85 | $metadata->mapOneToMany([ |
86 | 86 | 'fieldName' => 'translations', |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | if (!$this->hasUniqueConstraint($metadata, $columns)) { |
140 | 140 | $constraints = isset($metadata->table['uniqueConstraints']) ? $metadata->table['uniqueConstraints'] : []; |
141 | 141 | |
142 | - $constraints[$metadata->getTableName().'_uniq_trans'] = [ |
|
142 | + $constraints[$metadata->getTableName() . '_uniq_trans'] = [ |
|
143 | 143 | 'columns' => $columns, |
144 | 144 | ]; |
145 | 145 |
@@ -12,8 +12,8 @@ |
||
12 | 12 | namespace spec\Sylius\Bundle\ResourceBundle\Controller; |
13 | 13 | |
14 | 14 | use PhpSpec\ObjectBehavior; |
15 | -use Sylius\Bundle\ResourceBundle\ExpressionLanguage\ExpressionLanguage; |
|
16 | 15 | use Sylius\Bundle\ResourceBundle\Controller\ParametersParserInterface; |
16 | +use Sylius\Bundle\ResourceBundle\ExpressionLanguage\ExpressionLanguage; |
|
17 | 17 | use Symfony\Component\HttpFoundation\Request; |
18 | 18 | |
19 | 19 | /** |
@@ -11,7 +11,6 @@ |
||
11 | 11 | |
12 | 12 | namespace spec\Sylius\Bundle\ResourceBundle\Form\Type; |
13 | 13 | |
14 | -use Doctrine\Common\Persistence\ManagerRegistry; |
|
15 | 14 | use PhpSpec\ObjectBehavior; |
16 | 15 | use Prophecy\Argument; |
17 | 16 | use Sylius\Bundle\ResourceBundle\Form\DataTransformer\ResourceToIdentifierTransformer; |
@@ -14,7 +14,6 @@ |
||
14 | 14 | use PhpSpec\ObjectBehavior; |
15 | 15 | use Prophecy\Argument; |
16 | 16 | use Sylius\Bundle\ResourceBundle\Form\EventSubscriber\ResourceTranslationsSubscriber; |
17 | -use Sylius\Component\Locale\Context\LocaleContextInterface; |
|
18 | 17 | use Sylius\Component\Resource\Provider\AvailableLocalesProviderInterface; |
19 | 18 | use Sylius\Component\Resource\Provider\LocaleProviderInterface; |
20 | 19 | use Symfony\Component\Form\FormBuilderInterface; |
@@ -12,10 +12,7 @@ |
||
12 | 12 | namespace spec\Sylius\Bundle\ResourceBundle\Provider; |
13 | 13 | |
14 | 14 | use PhpSpec\ObjectBehavior; |
15 | -use Sylius\Component\Locale\Model\LocaleInterface; |
|
16 | 15 | use Sylius\Component\Resource\Repository\RepositoryInterface; |
17 | -use Symfony\Component\HttpKernel\Event\GetResponseEvent; |
|
18 | -use Symfony\Component\HttpFoundation\Request; |
|
19 | 16 | use Symfony\Component\HttpKernel\KernelEvents; |
20 | 17 | |
21 | 18 | /** |