@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | 'actions' => [], |
| 49 | 49 | ] |
| 50 | 50 | ], |
| 51 | - 'drivers' => [ 'doctrine/orm' ] |
|
| 51 | + 'drivers' => ['doctrine/orm'] |
|
| 52 | 52 | ] |
| 53 | 53 | ); |
| 54 | 54 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $this->assertConfigurationIsInvalid( |
| 100 | 100 | [ |
| 101 | 101 | [ |
| 102 | - 'drivers' => [ 'doctrine/orm', 'foo/invalid' ], |
|
| 102 | + 'drivers' => ['doctrine/orm', 'foo/invalid'], |
|
| 103 | 103 | ], |
| 104 | 104 | ], |
| 105 | 105 | 'Invalid driver specified in ["doctrine\/orm","foo\/invalid"], valid drivers:' |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | $this->couponRepository->remove($coupon); |
| 64 | 64 | |
| 65 | 65 | throw new \Exception(sprintf('Coupon "%s" has been removed, but it should not.', $coupon->getCode())); |
| 66 | - } catch(ForeignKeyConstraintViolationException $exception) { |
|
| 66 | + } catch (ForeignKeyConstraintViolationException $exception) { |
|
| 67 | 67 | $this->sharedStorage->set('last_exception', $exception); |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -151,7 +151,7 @@ |
||
| 151 | 151 | */ |
| 152 | 152 | public function theTypeFieldShouldBeDisabled() |
| 153 | 153 | { |
| 154 | - $currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]); |
|
| 154 | + $currentPage = $this->currentPageResolver->getCurrentPageWithForm([$this->createPage, $this->updatePage]); |
|
| 155 | 155 | |
| 156 | 156 | Assert::true( |
| 157 | 157 | $currentPage->isTypeDisabled(), |
@@ -51,13 +51,13 @@ |
||
| 51 | 51 | |
| 52 | 52 | foreach ($securityRoles as $securityRole) { |
| 53 | 53 | if ($user->hasRole($securityRole)) { |
| 54 | - $output->writeln(sprintf('<error>User "%s" did already have "%s" security role.</error>', (string)$user, $securityRole)); |
|
| 54 | + $output->writeln(sprintf('<error>User "%s" did already have "%s" security role.</error>', (string) $user, $securityRole)); |
|
| 55 | 55 | $error = true; |
| 56 | 56 | continue; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | $user->addRole($securityRole); |
| 60 | - $output->writeln(sprintf('Security role <comment>%s</comment> has been added to user <comment>%s</comment>', $securityRole, (string)$user)); |
|
| 60 | + $output->writeln(sprintf('Security role <comment>%s</comment> has been added to user <comment>%s</comment>', $securityRole, (string) $user)); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | if (!$error) { |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | ->setDescription('Initialize default permissions & roles in the application.') |
| 31 | 31 | ->setHelp(<<<EOT |
| 32 | 32 | The <info>%command.name%</info> command initializes default RBAC setup. |
| 33 | -EOT |
|
| 33 | +eot |
|
| 34 | 34 | ) |
| 35 | 35 | ; |
| 36 | 36 | } |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | $this->summaryPage->open(); |
| 83 | 83 | |
| 84 | 84 | Assert::true( |
| 85 | - $this->summaryPage->isEmpty(), |
|
| 85 | + $this->summaryPage->isEmpty(), |
|
| 86 | 86 | 'There should appear information about empty cart, but it does not.' |
| 87 | 87 | ); |
| 88 | 88 | } |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | 'label' => false, |
| 49 | 49 | 'button_add_label' => 'sylius.form.menu.add_menu_node', |
| 50 | 50 | 'cascade_validation' => true, |
| 51 | - ]) |
|
| 51 | + ]) |
|
| 52 | 52 | ->add('uri', null, [ |
| 53 | 53 | 'required' => false, |
| 54 | 54 | 'label' => 'sylius.form.menu.uri', |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | protected function getDefinedElements() |
| 41 | 41 | { |
| 42 | - return array_merge(parent::getDefinedElements(),[ |
|
| 42 | + return array_merge(parent::getDefinedElements(), [ |
|
| 43 | 43 | 'right_menu' => '.right.item', |
| 44 | 44 | ]); |
| 45 | 45 | } |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $documentManager->getClassMetadata('stdClass')->willReturn($metadata); |
| 50 | 50 | $metadata->nodename = null; |
| 51 | 51 | |
| 52 | - $this->shouldThrow(new \RuntimeException('In order to use the node name filter on "stdClass" it is necessary to map a field as the "nodename"'))->during('onEvent', [ $event ]); |
|
| 52 | + $this->shouldThrow(new \RuntimeException('In order to use the node name filter on "stdClass" it is necessary to map a field as the "nodename"'))->during('onEvent', [$event]); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | function it_should_clean_the_name( |
@@ -26,8 +26,7 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | function let( |
| 28 | 28 | DocumentManagerInterface $documentManager |
| 29 | - ) |
|
| 30 | - { |
|
| 29 | + ) { |
|
| 31 | 30 | $this->beConstructedWith( |
| 32 | 31 | $documentManager |
| 33 | 32 | ); |
@@ -42,8 +41,7 @@ discard block |
||
| 42 | 41 | DocumentManagerInterface $documentManager, |
| 43 | 42 | ResourceControllerEvent $event, |
| 44 | 43 | ClassMetadata $metadata |
| 45 | - ) |
|
| 46 | - { |
|
| 44 | + ) { |
|
| 47 | 45 | $document = new \stdClass(); |
| 48 | 46 | $event->getSubject()->willReturn($document); |
| 49 | 47 | $documentManager->getClassMetadata('stdClass')->willReturn($metadata); |
@@ -59,8 +57,7 @@ discard block |
||
| 59 | 57 | ResourceControllerEvent $event, |
| 60 | 58 | ClassMetadata $metadata, |
| 61 | 59 | NodeInterface $node |
| 62 | - ) |
|
| 63 | - { |
|
| 60 | + ) { |
|
| 64 | 61 | $document = new \stdClass(); |
| 65 | 62 | $parentDocument = new \stdClass(); |
| 66 | 63 | $event->getSubject()->willReturn($document); |
@@ -85,8 +82,7 @@ discard block |
||
| 85 | 82 | ResourceControllerEvent $event, |
| 86 | 83 | ClassMetadata $metadata, |
| 87 | 84 | NodeInterface $node |
| 88 | - ) |
|
| 89 | - { |
|
| 85 | + ) { |
|
| 90 | 86 | $document = new \stdClass(); |
| 91 | 87 | $parentDocument = new \stdClass(); |
| 92 | 88 | $existingDocument = new \stdClass(); |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | $metadata->idGenerator = 'foo'; |
| 51 | 51 | |
| 52 | 52 | $this->shouldThrow(new \RuntimeException('Document of class "stdClass" must be using the GENERATOR_TYPE_PARENT identificatio strategy (value 3), it is current using "foo" (this may be an automatic configuration: be sure to map both the `nodename` and the `parentDocument`).'))->during( |
| 53 | - 'onEvent', [ $event ] |
|
| 53 | + 'onEvent', [$event] |
|
| 54 | 54 | ); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -11,13 +11,12 @@ |
||
| 11 | 11 | |
| 12 | 12 | namespace spec\Sylius\Bundle\ResourceBundle\Doctrine\ODM\PHPCR\EventListener; |
| 13 | 13 | |
| 14 | +use Doctrine\ODM\PHPCR\DocumentManagerInterface; |
|
| 15 | +use Doctrine\ODM\PHPCR\Mapping\ClassMetadata; |
|
| 16 | +use PHPCR\NodeInterface; |
|
| 14 | 17 | use PhpSpec\ObjectBehavior; |
| 15 | -use Prophecy\Argument; |
|
| 16 | 18 | use Sylius\Bundle\ResourceBundle\Doctrine\ODM\PHPCR\EventListener\NameResolverListener; |
| 17 | -use Doctrine\ODM\PHPCR\Mapping\ClassMetadata; |
|
| 18 | 19 | use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent; |
| 19 | -use Doctrine\ODM\PHPCR\DocumentManagerInterface; |
|
| 20 | -use PHPCR\NodeInterface; |
|
| 21 | 20 | |
| 22 | 21 | /** |
| 23 | 22 | * @author Daniel Leech <[email protected]> |
@@ -26,8 +26,7 @@ discard block |
||
| 26 | 26 | { |
| 27 | 27 | function let( |
| 28 | 28 | DocumentManagerInterface $documentManager |
| 29 | - ) |
|
| 30 | - { |
|
| 29 | + ) { |
|
| 31 | 30 | $this->beConstructedWith( |
| 32 | 31 | $documentManager |
| 33 | 32 | ); |
@@ -42,8 +41,7 @@ discard block |
||
| 42 | 41 | DocumentManagerInterface $documentManager, |
| 43 | 42 | ResourceControllerEvent $event, |
| 44 | 43 | ClassMetadata $metadata |
| 45 | - ) |
|
| 46 | - { |
|
| 44 | + ) { |
|
| 47 | 45 | $document = new \stdClass(); |
| 48 | 46 | $event->getSubject()->willReturn($document); |
| 49 | 47 | $documentManager->getClassMetadata('stdClass')->willReturn($metadata); |
@@ -59,8 +57,7 @@ discard block |
||
| 59 | 57 | ResourceControllerEvent $event, |
| 60 | 58 | ClassMetadata $metadata, |
| 61 | 59 | NodeInterface $node |
| 62 | - ) |
|
| 63 | - { |
|
| 60 | + ) { |
|
| 64 | 61 | $document = new \stdClass(); |
| 65 | 62 | $parentDocument = new \stdClass(); |
| 66 | 63 | $event->getSubject()->willReturn($document); |
@@ -85,8 +82,7 @@ discard block |
||
| 85 | 82 | ResourceControllerEvent $event, |
| 86 | 83 | ClassMetadata $metadata, |
| 87 | 84 | NodeInterface $node |
| 88 | - ) |
|
| 89 | - { |
|
| 85 | + ) { |
|
| 90 | 86 | $document = new \stdClass(); |
| 91 | 87 | $parentDocument = new \stdClass(); |
| 92 | 88 | $existingDocument = new \stdClass(); |