@@ -27,6 +27,6 @@ |
||
27 | 27 | */ |
28 | 28 | public static function getExtendedTypes(): iterable |
29 | 29 | { |
30 | - return [ProductType::class]; |
|
30 | + return [ ProductType::class ]; |
|
31 | 31 | } |
32 | 32 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | 'label' => 'odiseo_sylius_vendor_plugin.form.vendor.email', |
41 | 41 | ]) |
42 | 42 | ->add('logoFile', FileType::class, [ |
43 | - 'label' => 'odiseo_sylius_vendor_plugin.form.vendor.logo', |
|
43 | + 'label' => 'odiseo_sylius_vendor_plugin.form.vendor.logo', |
|
44 | 44 | ]) |
45 | 45 | ->add('channels', ChannelChoiceType::class, [ |
46 | 46 | 'required' => false, |
@@ -71,12 +71,12 @@ |
||
71 | 71 | parent::configureOptions($resolver); |
72 | 72 | |
73 | 73 | $resolver->setDefaults([ |
74 | - 'validation_groups' => function (FormInterface $form): array { |
|
74 | + 'validation_groups' => function(FormInterface $form): array { |
|
75 | 75 | /** @var VendorInterface|null $vendor */ |
76 | 76 | $vendor = $form->getData(); |
77 | 77 | |
78 | 78 | if (!$vendor instanceof VendorInterface || null === $vendor->getId()) { |
79 | - return array_merge($this->validationGroups, ['odiseo_logo_create']); |
|
79 | + return array_merge($this->validationGroups, [ 'odiseo_logo_create' ]); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | return $this->validationGroups; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function buildForm(FormBuilderInterface $builder, array $options): void |
30 | 30 | { |
31 | - if ($options['multiple']) { |
|
31 | + if ($options[ 'multiple' ]) { |
|
32 | 32 | $builder->addModelTransformer(new CollectionToArrayTransformer()); |
33 | 33 | } |
34 | 34 | } |
@@ -38,17 +38,17 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function configureOptions(OptionsResolver $resolver): void |
40 | 40 | { |
41 | - $criteria = []; |
|
42 | - $orderBy = ['name' => 'ASC']; |
|
41 | + $criteria = [ ]; |
|
42 | + $orderBy = [ 'name' => 'ASC' ]; |
|
43 | 43 | |
44 | 44 | $resolver->setDefaults([ |
45 | - 'choices' => function (Options $options) use ($criteria, $orderBy): array { |
|
45 | + 'choices' => function(Options $options) use ($criteria, $orderBy): array { |
|
46 | 46 | $vendors = $this->vendorRepository->findBy($criteria, $orderBy); |
47 | 47 | |
48 | - $choices = []; |
|
48 | + $choices = [ ]; |
|
49 | 49 | /** @var VendorInterface $vendor */ |
50 | 50 | foreach ($vendors as $vendor) { |
51 | - $choices[$vendor->getName()] = $vendor; |
|
51 | + $choices[ $vendor->getName() ] = $vendor; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | return $choices; |
@@ -93,7 +93,7 @@ |
||
93 | 93 | $this->setEmail('[email protected]'); |
94 | 94 | $this->getEmail()->shouldReturn('[email protected]'); |
95 | 95 | |
96 | - $file = new File(__DIR__ . '/VendorSpec.php'); |
|
96 | + $file = new File(__DIR__.'/VendorSpec.php'); |
|
97 | 97 | $this->setLogoFile($file); |
98 | 98 | $this->getLogoFile()->shouldReturn($file); |
99 | 99 |
@@ -49,6 +49,6 @@ |
||
49 | 49 | function it_allows_access_via_properties(): void |
50 | 50 | { |
51 | 51 | $this->setDescription('Vendor description'); |
52 | - $this->getDescription()->shouldReturn('Vendor description');; |
|
52 | + $this->getDescription()->shouldReturn('Vendor description'); ; |
|
53 | 53 | } |
54 | 54 | } |
@@ -132,14 +132,14 @@ |
||
132 | 132 | 'inversedBy' => $inversedBy, |
133 | 133 | 'joinTable' => [ |
134 | 134 | 'name' => 'odiseo_vendor_'.$inversedBy, |
135 | - 'joinColumns' => [[ |
|
135 | + 'joinColumns' => [ [ |
|
136 | 136 | 'name' => $joinColumn, |
137 | 137 | 'referencedColumnName' => 'id' |
138 | - ]], |
|
139 | - 'inverseJoinColumns' => [[ |
|
138 | + ] ], |
|
139 | + 'inverseJoinColumns' => [ [ |
|
140 | 140 | 'name' => 'vendor_id', |
141 | 141 | 'referencedColumnName' => 'id' |
142 | - ]], |
|
142 | + ] ], |
|
143 | 143 | ] |
144 | 144 | ]); |
145 | 145 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | $item = $menu; |
23 | 23 | } |
24 | 24 | |
25 | - $item->addChild('vendors', ['route' => 'odiseo_sylius_vendor_plugin_admin_vendor_index']) |
|
25 | + $item->addChild('vendors', [ 'route' => 'odiseo_sylius_vendor_plugin_admin_vendor_index' ]) |
|
26 | 26 | ->setLabel('odiseo_sylius_vendor_plugin.menu.admin.vendors') |
27 | 27 | ->setLabelAttribute('icon', 'trademark') |
28 | 28 | ; |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | $this->eventDispatcher = $eventDispatcher; |
25 | 25 | } |
26 | 26 | |
27 | - public function createMenu(array $options = []): ItemInterface |
|
27 | + public function createMenu(array $options = [ ]): ItemInterface |
|
28 | 28 | { |
29 | 29 | $menu = $this->factory->createItem('root'); |
30 | 30 | |
31 | - if (!array_key_exists('vendor', $options) || !$options['vendor'] instanceof VendorInterface) { |
|
31 | + if (!array_key_exists('vendor', $options) || !$options[ 'vendor' ] instanceof VendorInterface) { |
|
32 | 32 | return $menu; |
33 | 33 | } |
34 | 34 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | ; |
53 | 53 | |
54 | 54 | $this->eventDispatcher->dispatch( |
55 | - new VendorFormMenuBuilderEvent($this->factory, $menu, $options['vendor']) |
|
55 | + new VendorFormMenuBuilderEvent($this->factory, $menu, $options[ 'vendor' ]) |
|
56 | 56 | ); |
57 | 57 | |
58 | 58 | return $menu; |
@@ -29,7 +29,7 @@ |
||
29 | 29 | exec(sprintf('mklink /J %s %s 2> NUL', NODE_MODULES_FOLDER_NAME, PATH_TO_NODE_MODULES), $output, $returnCode); |
30 | 30 | $success = $returnCode === 0; |
31 | 31 | if (!$success) { |
32 | - echo '> Failed o create the required symlink' . PHP_EOL; |
|
32 | + echo '> Failed o create the required symlink' . PHP_EOL; |
|
33 | 33 | exit(2); |
34 | 34 | } |
35 | 35 | } |
@@ -1,18 +1,18 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | const NODE_MODULES_FOLDER_NAME = 'node_modules'; |
4 | -const PATH_TO_NODE_MODULES = 'tests' . DIRECTORY_SEPARATOR . 'Application' . DIRECTORY_SEPARATOR . 'node_modules'; |
|
4 | +const PATH_TO_NODE_MODULES = 'tests'.DIRECTORY_SEPARATOR.'Application'.DIRECTORY_SEPARATOR.'node_modules'; |
|
5 | 5 | |
6 | 6 | /* cannot use `file_exists` or `stat` as gives false on symlinks if target path does not exist yet */ |
7 | 7 | if (@lstat(NODE_MODULES_FOLDER_NAME)) |
8 | 8 | { |
9 | 9 | if (is_link(NODE_MODULES_FOLDER_NAME) || is_dir(NODE_MODULES_FOLDER_NAME)) { |
10 | - echo '> `' . NODE_MODULES_FOLDER_NAME . '` already exists as a link or folder, keeping existing as may be intentional.' . PHP_EOL; |
|
10 | + echo '> `'.NODE_MODULES_FOLDER_NAME.'` already exists as a link or folder, keeping existing as may be intentional.'.PHP_EOL; |
|
11 | 11 | exit(0); |
12 | 12 | } else { |
13 | - echo '> Invalid symlink `' . NODE_MODULES_FOLDER_NAME . '` detected, recreating...' . PHP_EOL; |
|
13 | + echo '> Invalid symlink `'.NODE_MODULES_FOLDER_NAME.'` detected, recreating...'.PHP_EOL; |
|
14 | 14 | if (!@unlink(NODE_MODULES_FOLDER_NAME)) { |
15 | - echo '> Could not delete file `' . NODE_MODULES_FOLDER_NAME . '`.' . PHP_EOL; |
|
15 | + echo '> Could not delete file `'.NODE_MODULES_FOLDER_NAME.'`.'.PHP_EOL; |
|
16 | 16 | exit(1); |
17 | 17 | } |
18 | 18 | } |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | /* if case it has failed, but OS is Windows... */ |
25 | 25 | if (!$success && strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { |
26 | 26 | /* ...then try a different approach which does not require elevated permissions and folder to exist */ |
27 | - echo '> This system is running Windows, creation of links requires elevated privileges,' . PHP_EOL; |
|
28 | - echo '> and target path to exist. Fallback to NTFS Junction:' . PHP_EOL; |
|
27 | + echo '> This system is running Windows, creation of links requires elevated privileges,'.PHP_EOL; |
|
28 | + echo '> and target path to exist. Fallback to NTFS Junction:'.PHP_EOL; |
|
29 | 29 | exec(sprintf('mklink /J %s %s 2> NUL', NODE_MODULES_FOLDER_NAME, PATH_TO_NODE_MODULES), $output, $returnCode); |
30 | 30 | $success = $returnCode === 0; |
31 | 31 | if (!$success) { |
32 | - echo '> Failed o create the required symlink' . PHP_EOL; |
|
32 | + echo '> Failed o create the required symlink'.PHP_EOL; |
|
33 | 33 | exit(2); |
34 | 34 | } |
35 | 35 | } |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | $path = @readlink(NODE_MODULES_FOLDER_NAME); |
38 | 38 | /* check if link points to the intended directory */ |
39 | 39 | if ($path && realpath($path) === realpath(PATH_TO_NODE_MODULES)) { |
40 | - echo '> Successfully created the symlink.' . PHP_EOL; |
|
40 | + echo '> Successfully created the symlink.'.PHP_EOL; |
|
41 | 41 | exit(0); |
42 | 42 | } |
43 | 43 | |
44 | -echo '> Failed to create the symlink to `' . NODE_MODULES_FOLDER_NAME . '`.' . PHP_EOL; |
|
44 | +echo '> Failed to create the symlink to `'.NODE_MODULES_FOLDER_NAME.'`.'.PHP_EOL; |
|
45 | 45 | exit(3); |