Passed
Push — develop ( c0109d...e3ce06 )
by Mathieu
03:00
created
src/DependencyInjection/SonataAnnotationExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
             $config['directory'] ?? $container->getParameter('kernel.project_dir') . '/src/'
25 25
         );
26 26
 
27
-        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
27
+        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
28 28
         $loader->load('reader.xml');
29 29
     }
30 30
 }
Please login to merge, or discard this patch.
src/DependencyInjection/Compiler/AutoRegisterCompilerPass.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $this->annotationReader = $container->get('annotation_reader');
47 47
         $files = $this->findFiles(
48
-          $container->getParameter('sonata_annotation.directory')
48
+            $container->getParameter('sonata_annotation.directory')
49 49
         );
50 50
 
51 51
         foreach ($files as $file) {
@@ -58,14 +58,14 @@  discard block
 block discarded – undo
58 58
             }
59 59
 
60 60
             if (!($annotation = $this->getClassAnnotation(
61
-              new ReflectionClass($className)
61
+                new ReflectionClass($className)
62 62
             ))) {
63 63
                 continue;
64 64
             }
65 65
 
66 66
             $definition = new Definition(
67
-              $annotation->admin,
68
-              [
67
+                $annotation->admin,
68
+                [
69 69
                 new Reference('sonata.annotation.reader.action_button'),
70 70
                 new Reference('sonata.annotation.reader.datagrid'),
71 71
                 new Reference('sonata.annotation.reader.datagrid_values'),
@@ -75,20 +75,20 @@  discard block
 block discarded – undo
75 75
                 new Reference('sonata.annotation.reader.list'),
76 76
                 new Reference('sonata.annotation.reader.route'),
77 77
                 new Reference('sonata.annotation.reader.show'),
78
-              ]
78
+                ]
79 79
             );
80 80
 
81 81
             $definition->addTag(
82
-              'sonata.admin',
83
-              array_merge(
82
+                'sonata.admin',
83
+                array_merge(
84 84
                 $annotation->getTagOptions(),
85 85
                 ['model_class' => $className],
86
-              )
86
+                )
87 87
             );
88 88
 
89 89
             $container->setDefinition(
90
-              $annotation->serviceId ?? $this->getServiceId($file),
91
-              $definition
90
+                $annotation->serviceId ?? $this->getServiceId($file),
91
+                $definition
92 92
             );
93 93
         }
94 94
     }
@@ -103,9 +103,9 @@  discard block
 block discarded – undo
103 103
     private function findFiles(string $directory): IteratorAggregate
104 104
     {
105 105
         return Finder::create()
106
-          ->in($directory)
107
-          ->files()
108
-          ->name('*.php');
106
+            ->in($directory)
107
+            ->files()
108
+            ->name('*.php');
109 109
     }
110 110
 
111 111
     /**
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
     private function getClassAnnotation(ReflectionClass $class): ?Admin
167 167
     {
168 168
         return $this->annotationReader->getClassAnnotation(
169
-          $class,
170
-          Admin::class
169
+            $class,
170
+            Admin::class
171 171
         );
172 172
     }
173 173
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
     {
183 183
         return self::DEFAULT_SERVICE_PREFIX . $this->getClassName(
184 184
             $file->getFilename()
185
-          );
185
+            );
186 186
     }
187 187
 
188 188
 }
Please login to merge, or discard this patch.
src/DependencyInjection/Compiler/AccessCompilerPass.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
             $class = $this->getClass($container, $id);
45 45
 
46 46
             if ($permissions = $this->getRoles(
47
-              new ReflectionClass($class),
48
-              $this->getRolePrefix($id)
47
+                new ReflectionClass($class),
48
+                $this->getRolePrefix($id)
49 49
             )) {
50 50
                 $roles = array_merge_recursive($roles, $permissions);
51 51
             }
@@ -87,17 +87,17 @@  discard block
 block discarded – undo
87 87
 
88 88
             if (!isset($annotation->role)) {
89 89
                 throw new MissingAnnotationArgumentException(
90
-                  $annotation,
91
-                  'role',
92
-                  $class
90
+                    $annotation,
91
+                    'role',
92
+                    $class
93 93
                 );
94 94
             }
95 95
 
96 96
             $roles[$annotation->role] = array_map(
97
-              function (string $permission) use ($prefix) {
98
-                  return $prefix . strtoupper($permission);
99
-              },
100
-              $annotation->permissions
97
+                function (string $permission) use ($prefix) {
98
+                    return $prefix . strtoupper($permission);
99
+                },
100
+                $annotation->permissions
101 101
             );
102 102
         }
103 103
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@
 block discarded – undo
94 94
             }
95 95
 
96 96
             $roles[$annotation->role] = array_map(
97
-              function (string $permission) use ($prefix) {
97
+              function(string $permission) use ($prefix) {
98 98
                   return $prefix . strtoupper($permission);
99 99
               },
100 100
               $annotation->permissions
Please login to merge, or discard this patch.
src/Annotation/FormField.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -57,9 +57,9 @@
 block discarded – undo
57 57
     public function getSettings(): array
58 58
     {
59 59
         return [
60
-          $this->type ?? null,
61
-          $this->options,
62
-          $this->fieldDescriptionOptions,
60
+            $this->type ?? null,
61
+            $this->options,
62
+            $this->fieldDescriptionOptions,
63 63
         ];
64 64
     }
65 65
 
Please login to merge, or discard this patch.
src/Annotation/DatagridField.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,10 +47,10 @@
 block discarded – undo
47 47
     public function getSettings(): array
48 48
     {
49 49
         return [
50
-          $this->type ?? null,
51
-          $this->filterOptions,
52
-          $this->fieldOptions,
53
-          $this->fieldDescriptionOptions,
50
+            $this->type ?? null,
51
+            $this->filterOptions,
52
+            $this->fieldOptions,
53
+            $this->fieldDescriptionOptions,
54 54
         ];
55 55
     }
56 56
 
Please login to merge, or discard this patch.
src/Annotation/Admin.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -129,18 +129,18 @@
 block discarded – undo
129 129
     public function getTagOptions(): array
130 130
     {
131 131
         return [
132
-          'code' => $this->code ?? null,
133
-          'controller' => $this->controller ?? null,
134
-          'manager_type' => $this->managerType,
135
-          'group' => $this->group ?? null,
136
-          'label' => $this->label ?? null,
137
-          'show_in_dashboard' => $this->showInDashboard,
138
-          'keep_open' => $this->keepOpen,
139
-          'on_top' => $this->onTop,
140
-          'icon' => $this->icon ?? null,
141
-          'label_translator_strategy' => $this->labelTranslatorStrategy ?? null,
142
-          'label_catalogue' => $this->labelCatalogue ?? null,
143
-          'pager_type' => $this->pagerType ?? null,
132
+            'code' => $this->code ?? null,
133
+            'controller' => $this->controller ?? null,
134
+            'manager_type' => $this->managerType,
135
+            'group' => $this->group ?? null,
136
+            'label' => $this->label ?? null,
137
+            'show_in_dashboard' => $this->showInDashboard,
138
+            'keep_open' => $this->keepOpen,
139
+            'on_top' => $this->onTop,
140
+            'icon' => $this->icon ?? null,
141
+            'label_translator_strategy' => $this->labelTranslatorStrategy ?? null,
142
+            'label_catalogue' => $this->labelCatalogue ?? null,
143
+            'pager_type' => $this->pagerType ?? null,
144 144
         ];
145 145
     }
146 146
 
Please login to merge, or discard this patch.
src/Exception/MissingAnnotationArgumentException.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
      *                                                  annotation.
21 21
      */
22 22
     public function __construct(
23
-      $annotation,
24
-      string $argumentName,
25
-      $class = null
23
+        $annotation,
24
+        string $argumentName,
25
+        $class = null
26 26
     ) {
27 27
         if ($annotation instanceof AnnotationInterface) {
28 28
             $annotation = get_class($annotation);
@@ -34,31 +34,31 @@  discard block
 block discarded – undo
34 34
 
35 35
         if (!is_string($annotation)) {
36 36
             throw new InvalidArgumentException(
37
-              sprintf(
37
+                sprintf(
38 38
                 'Invalid annotation (string|%s) attribute.',
39 39
                 AnnotationInterface::class,
40
-              )
40
+                )
41 41
             );
42 42
         }
43 43
 
44 44
         if ($class !== null && !is_string($class)) {
45 45
             throw new InvalidArgumentException(
46
-              'Invalid class (string|ReflectionClass|null) attribute.',
46
+                'Invalid class (string|ReflectionClass|null) attribute.',
47 47
             );
48 48
         }
49 49
 
50 50
         if ($class) {
51 51
             $message = sprintf(
52
-              'Argument "%s" is mandatory for annotation %s on %s.',
53
-              $argumentName,
54
-              $annotation,
55
-              $class
52
+                'Argument "%s" is mandatory for annotation %s on %s.',
53
+                $argumentName,
54
+                $annotation,
55
+                $class
56 56
             );
57 57
         } else {
58 58
             $message = sprintf(
59
-              'Argument "%s" is mandatory for annotation %s.',
60
-              $argumentName,
61
-              $annotation,
59
+                'Argument "%s" is mandatory for annotation %s.',
60
+                $argumentName,
61
+                $annotation,
62 62
             );
63 63
         }
64 64
 
Please login to merge, or discard this patch.
src/Reader/AbstractActionReader.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,16 +38,16 @@
 block discarded – undo
38 38
             if ($this->isSupported($annotation)) {
39 39
                 if (!isset($annotation->template)) {
40 40
                     throw new MissingAnnotationArgumentException(
41
-                      $annotation,
42
-                      'template',
43
-                      $class
41
+                        $annotation,
42
+                        'template',
43
+                        $class
44 44
                     );
45 45
                 }
46 46
 
47 47
                 /** @var AbstractAction $annotation */
48 48
                 $actions[random_int(
49 49
                   -99999,
50
-                  99999
50
+                    99999
51 51
                 )]['template'] = $annotation->template;
52 52
             }
53 53
         }
Please login to merge, or discard this patch.
src/Reader/FormReader.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
      * @return void
34 34
      */
35 35
     public function configureCreateFields(
36
-      ReflectionClass $class,
37
-      FormMapper $formMapper
36
+        ReflectionClass $class,
37
+        FormMapper $formMapper
38 38
     ): void {
39 39
         $this->configureFields(
40
-          $class,
41
-          $formMapper,
42
-          FormField::ACTION_EDIT
40
+            $class,
41
+            $formMapper,
42
+            FormField::ACTION_EDIT
43 43
         );
44 44
     }
45 45
 
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
      * @return void
53 53
      */
54 54
     public function configureEditFields(
55
-      ReflectionClass $class,
56
-      FormMapper $formMapper
55
+        ReflectionClass $class,
56
+        FormMapper $formMapper
57 57
     ): void {
58 58
         $this->configureFields($class, $formMapper, FormField::ACTION_CREATE);
59 59
     }
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
      * @return void
69 69
      */
70 70
     private function configureFields(
71
-      ReflectionClass $class,
72
-      FormMapper $formMapper,
73
-      string $action
71
+        ReflectionClass $class,
72
+        FormMapper $formMapper,
73
+        string $action
74 74
     ): void {
75 75
         $propertiesWithPosition = [];
76 76
         $propertiesWithoutPosition = [];
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
 
84 84
                 if (!isset($annotation->action)) {
85 85
                     throw new MissingAnnotationArgumentException(
86
-                      $annotation,
87
-                      'action'
86
+                        $annotation,
87
+                        'action'
88 88
                     );
89 89
                 }
90 90
 
@@ -94,30 +94,30 @@  discard block
 block discarded – undo
94 94
 
95 95
                 if (!isset($annotation->position)) {
96 96
                     $propertiesWithoutPosition[] = [
97
-                      'name' => $property->getName(),
98
-                      'settings' => $annotation->getSettings(),
97
+                        'name' => $property->getName(),
98
+                        'settings' => $annotation->getSettings(),
99 99
                     ];
100 100
 
101 101
                     continue;
102 102
                 }
103 103
 
104 104
                 if (array_key_exists(
105
-                  $annotation->position,
106
-                  $propertiesWithPosition
105
+                    $annotation->position,
106
+                    $propertiesWithPosition
107 107
                 )) {
108 108
                     throw new \InvalidArgumentException(
109
-                      sprintf(
109
+                        sprintf(
110 110
                         'Position "%s" is already in use by "%s", try setting a different position for "%s".',
111 111
                         $annotation->position,
112 112
                         $propertiesWithPosition[$annotation->position]['name'],
113 113
                         $property->getName()
114
-                      )
114
+                        )
115 115
                     );
116 116
                 }
117 117
 
118 118
                 $propertiesWithPosition[$annotation->position] = [
119
-                  'name' => $property->getName(),
120
-                  'settings' => $annotation->getSettings(),
119
+                    'name' => $property->getName(),
120
+                    'settings' => $annotation->getSettings(),
121 121
                 ];
122 122
             }
123 123
         }
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
         ksort($propertiesWithPosition);
126 126
 
127 127
         $properties = array_merge(
128
-          $propertiesWithPosition,
129
-          $propertiesWithoutPosition
128
+            $propertiesWithPosition,
129
+            $propertiesWithoutPosition
130 130
         );
131 131
 
132 132
         foreach ($properties as $property) {
Please login to merge, or discard this patch.