@@ -433,7 +433,7 @@ |
||
433 | 433 | |
434 | 434 | /** |
435 | 435 | * @param Request $request |
436 | - * @param $enabled |
|
436 | + * @param boolean $enabled |
|
437 | 437 | * |
438 | 438 | * @return RedirectResponse |
439 | 439 | */ |
@@ -13,14 +13,12 @@ |
||
13 | 13 | |
14 | 14 | use Sylius\Bundle\ResourceBundle\DependencyInjection\Driver\DriverProvider; |
15 | 15 | use Sylius\Component\Resource\Metadata\Metadata; |
16 | -use Symfony\Component\Config\Definition\Processor; |
|
17 | 16 | use Symfony\Component\Config\FileLocator; |
17 | +use Symfony\Component\Config\Loader\LoaderInterface; |
|
18 | 18 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
19 | +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; |
|
19 | 20 | use Symfony\Component\DependencyInjection\Extension\Extension; |
20 | -use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; |
|
21 | 21 | use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; |
22 | -use Symfony\Component\Config\Loader\LoaderInterface; |
|
23 | -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; |
|
24 | 22 | |
25 | 23 | /** |
26 | 24 | * @author Paweł Jędrzejewski <[email protected]> |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | public function load(array $config, ContainerBuilder $container) |
35 | 35 | { |
36 | 36 | $config = $this->processConfiguration($this->getConfiguration($config, $container), $config); |
37 | - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
37 | + $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
38 | 38 | |
39 | 39 | $configFiles = [ |
40 | 40 | 'services.xml', |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | DriverProvider::get($metadata)->load($container, $metadata); |
98 | 98 | |
99 | 99 | if ($metadata->hasParameter('translation')) { |
100 | - $alias = $alias.'_translation'; |
|
100 | + $alias = $alias . '_translation'; |
|
101 | 101 | $resourceConfig = array_merge(['driver' => $resourceConfig['driver']], $resourceConfig['translation']); |
102 | 102 | |
103 | 103 | $resources = $container->hasParameter('sylius.resources') ? $container->getParameter('sylius.resources') : []; |
@@ -2,12 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Sylius\Bundle\ResourceBundle\Doctrine\ODM\PHPCR\EventListener; |
4 | 4 | |
5 | -use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
|
6 | -use Symfony\Component\Form\FormEvents; |
|
7 | -use Symfony\Component\Form\FormEvent; |
|
8 | 5 | use Doctrine\ODM\PHPCR\DocumentManagerInterface; |
9 | -use PHPCR\Util\NodeHelper; |
|
10 | 6 | use Doctrine\ODM\PHPCR\Mapping\ClassMetadata; |
7 | +use PHPCR\Util\NodeHelper; |
|
11 | 8 | use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent; |
12 | 9 | |
13 | 10 | /** |
@@ -62,8 +62,7 @@ discard block |
||
62 | 62 | function it_filters_data_containing_empty_strings( |
63 | 63 | DataSourceInterface $dataSource, |
64 | 64 | ExpressionBuilderInterface $expressionBuilder |
65 | - ) |
|
66 | - { |
|
65 | + ) { |
|
67 | 66 | $dataSource->getExpressionBuilder()->willReturn($expressionBuilder); |
68 | 67 | |
69 | 68 | $expressionBuilder->isNull('firstName')->willReturn('EXPR'); |
@@ -87,8 +86,7 @@ discard block |
||
87 | 86 | function it_filters_data_containing_a_string( |
88 | 87 | DataSourceInterface $dataSource, |
89 | 88 | ExpressionBuilderInterface $expressionBuilder |
90 | - ) |
|
91 | - { |
|
89 | + ) { |
|
92 | 90 | $dataSource->getExpressionBuilder()->willReturn($expressionBuilder); |
93 | 91 | |
94 | 92 | $expressionBuilder->like('firstName', '%John%')->willReturn('EXPR'); |
@@ -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 | /** |