Passed
Push — develop ( f294c2...963b7c )
by Mathieu
02:56
created
src/Reader/DatagridReader.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
      * @return void
36 36
      */
37 37
     public function configureFields(
38
-      ReflectionClass $class,
39
-      DatagridMapper $datagridMapper
38
+        ReflectionClass $class,
39
+        DatagridMapper $datagridMapper
40 40
     ): void {
41 41
         $propertiesWithPosition = [];
42 42
         $propertiesWithoutPosition = [];
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
                 if ($annotation instanceof DatagridAssociationField) {
53 53
                     if (!isset($annotation->field)) {
54 54
                         throw new MissingAnnotationArgumentException(
55
-                          $annotation,
56
-                          'field',
55
+                            $annotation,
56
+                            'field',
57 57
                         );
58 58
                     }
59 59
 
@@ -62,30 +62,30 @@  discard block
 block discarded – undo
62 62
 
63 63
                 if (!isset($annotation->position)) {
64 64
                     $propertiesWithoutPosition[] = [
65
-                      'name' => $name,
66
-                      'annotation' => $annotation,
65
+                        'name' => $name,
66
+                        'annotation' => $annotation,
67 67
                     ];
68 68
 
69 69
                     continue;
70 70
                 }
71 71
 
72 72
                 if (array_key_exists(
73
-                  $annotation->position,
74
-                  $propertiesWithPosition
73
+                    $annotation->position,
74
+                    $propertiesWithPosition
75 75
                 )) {
76 76
                     throw new InvalidArgumentException(
77
-                      sprintf(
77
+                        sprintf(
78 78
                         'Position "%s" is already in use by "%s", try setting a different position for "%s".',
79 79
                         $annotation->position,
80 80
                         $propertiesWithPosition[$annotation->position]['name'],
81 81
                         $property->getName()
82
-                      )
82
+                        )
83 83
                     );
84 84
                 }
85 85
 
86 86
                 $propertiesWithPosition[$annotation->position] = [
87
-                  'name' => $name,
88
-                  'annotation' => $annotation,
87
+                    'name' => $name,
88
+                    'annotation' => $annotation,
89 89
                 ];
90 90
             }
91 91
         }
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
         ksort($propertiesWithPosition);
94 94
 
95 95
         $properties = array_merge(
96
-          $propertiesWithPosition,
97
-          $propertiesWithoutPosition
96
+            $propertiesWithPosition,
97
+            $propertiesWithoutPosition
98 98
         );
99 99
 
100 100
         foreach ($properties as $property) {
101 101
             $datagridMapper->add(
102
-                 $property['name'],
103
-              ...$property['annotation']->getSettings()
102
+                    $property['name'],
103
+                ...$property['annotation']->getSettings()
104 104
             );
105 105
         }
106 106
     }
Please login to merge, or discard this patch.
src/Reader/ExportReader.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,14 +37,14 @@  discard block
 block discarded – undo
37 37
                 if ($annotation instanceof ExportAssociationField) {
38 38
                     if (!isset($annotation->field)) {
39 39
                         throw new MissingAnnotationArgumentException(
40
-                          $annotation,
41
-                          'field',
40
+                            $annotation,
41
+                            'field',
42 42
                         );
43 43
                     }
44 44
 
45 45
                     $fieldName = $property->getName()
46
-                      . '.'
47
-                      . $annotation->field;
46
+                        . '.'
47
+                        . $annotation->field;
48 48
 
49 49
                     $fields[$annotation->label ?? $fieldName] = $fieldName;
50 50
                     continue;
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
 
60 60
         foreach ($class->getMethods() as $method) {
61 61
             if ($annotation = $this->getMethodAnnotation(
62
-              $method,
63
-              ExportField::class
62
+                $method,
63
+                ExportField::class
64 64
             )) {
65 65
                 $label = $annotation->label ?? $method->getName();
66 66
                 $fields[$label] = $method->getName();
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
     {
82 82
         /** @var ExportFormats|null $annotation */
83 83
         if ($annotation = $this->getClassAnnotation(
84
-          $class,
85
-          ExportFormats::class
84
+            $class,
85
+            ExportFormats::class
86 86
         )) {
87 87
             return $annotation->formats;
88 88
         }
Please login to merge, or discard this patch.
src/Reader/ListReader.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
      * @return void
37 37
      */
38 38
     public function configureFields(
39
-      ReflectionClass $class,
40
-      ListMapper $listMapper
39
+        ReflectionClass $class,
40
+        ListMapper $listMapper
41 41
     ): void {
42 42
         $propertiesAndMethodsWithPosition = [];
43 43
         $propertiesAndMethodsWithoutPosition = [];
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
                 if ($annotation instanceof ListAssociationField) {
58 58
                     if (!isset($annotation->field)) {
59 59
                         throw new MissingAnnotationArgumentException(
60
-                          $annotation,
61
-                          'field',
60
+                            $annotation,
61
+                            'field',
62 62
                         );
63 63
                     }
64 64
 
@@ -67,30 +67,30 @@  discard block
 block discarded – undo
67 67
 
68 68
                 if (!isset($annotation->position)) {
69 69
                     $propertiesAndMethodsWithoutPosition[] = [
70
-                      'name' => $name,
71
-                      'annotation' => $annotation,
70
+                        'name' => $name,
71
+                        'annotation' => $annotation,
72 72
                     ];
73 73
 
74 74
                     continue;
75 75
                 }
76 76
 
77 77
                 if (array_key_exists(
78
-                  $annotation->position,
79
-                  $propertiesAndMethodsWithPosition
78
+                    $annotation->position,
79
+                    $propertiesAndMethodsWithPosition
80 80
                 )) {
81 81
                     throw new InvalidArgumentException(
82
-                      sprintf(
82
+                        sprintf(
83 83
                         'Position "%s" is already in use by "%s", try setting a different position for "%s".',
84 84
                         $annotation->position,
85 85
                         $propertiesAndMethodsWithPosition[$annotation->position]['name'],
86 86
                         $property->getName()
87
-                      )
87
+                        )
88 88
                     );
89 89
                 }
90 90
 
91 91
                 $propertiesAndMethodsWithPosition[$annotation->position] = [
92
-                  'name' => $name,
93
-                  'annotation' => $annotation,
92
+                    'name' => $name,
93
+                    'annotation' => $annotation,
94 94
                 ];
95 95
             }
96 96
         }
@@ -102,37 +102,37 @@  discard block
 block discarded – undo
102 102
         foreach ($class->getMethods() as $method) {
103 103
             /** @var ListField|null $annotation */
104 104
             if ($annotation = $this->getMethodAnnotation(
105
-              $method,
106
-              ListField::class
105
+                $method,
106
+                ListField::class
107 107
             )) {
108 108
                 $name = $method->getName();
109 109
 
110 110
                 if (!isset($annotation->position)) {
111 111
                     $propertiesAndMethodsWithoutPosition[] = [
112
-                      'name' => $name,
113
-                      'annotation' => $annotation,
112
+                        'name' => $name,
113
+                        'annotation' => $annotation,
114 114
                     ];
115 115
 
116 116
                     continue;
117 117
                 }
118 118
 
119 119
                 if (array_key_exists(
120
-                  $annotation->position,
121
-                  $propertiesAndMethodsWithPosition
120
+                    $annotation->position,
121
+                    $propertiesAndMethodsWithPosition
122 122
                 )) {
123 123
                     throw new InvalidArgumentException(
124
-                      sprintf(
124
+                        sprintf(
125 125
                         'Position "%s" is already in use by "%s", try setting a different position for "%s".',
126 126
                         $annotation->position,
127 127
                         $propertiesAndMethodsWithPosition[$annotation->position]['name'],
128 128
                         $name
129
-                      )
129
+                        )
130 130
                     );
131 131
                 }
132 132
 
133 133
                 $propertiesAndMethodsWithPosition[$annotation->position] = [
134
-                  'name' => $name,
135
-                  'annotation' => $annotation,
134
+                    'name' => $name,
135
+                    'annotation' => $annotation,
136 136
                 ];
137 137
             }
138 138
         }
@@ -144,15 +144,15 @@  discard block
 block discarded – undo
144 144
         ksort($propertiesAndMethodsWithPosition);
145 145
 
146 146
         $propertiesAndMethods = array_merge(
147
-          $propertiesAndMethodsWithPosition,
148
-          $propertiesAndMethodsWithoutPosition
147
+            $propertiesAndMethodsWithPosition,
148
+            $propertiesAndMethodsWithoutPosition
149 149
         );
150 150
 
151 151
         foreach ($propertiesAndMethods as $propertyAndMethod) {
152 152
             $this->addField(
153
-              $propertyAndMethod['name'],
154
-              $propertyAndMethod['annotation'],
155
-              $listMapper
153
+                $propertyAndMethod['name'],
154
+                $propertyAndMethod['annotation'],
155
+                $listMapper
156 156
             );
157 157
         }
158 158
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 
163 163
         if ($actions = $this->getListActions($class)) {
164 164
             $listMapper->add('_action', null, [
165
-              'actions' => $actions,
165
+                'actions' => $actions,
166 166
             ]);
167 167
         }
168 168
     }
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
      * @return void
178 178
      */
179 179
     private function addField(
180
-      string $name,
181
-      ListField $annotation,
182
-      ListMapper $listMapper
180
+        string $name,
181
+        ListField $annotation,
182
+        ListMapper $listMapper
183 183
     ): void {
184 184
         $listMapper->add($name, ...$annotation->getSettings());
185 185
     }
@@ -201,9 +201,9 @@  discard block
 block discarded – undo
201 201
             if ($annotation instanceof ListAction) {
202 202
                 if (!isset($annotation->name)) {
203 203
                     throw new MissingAnnotationArgumentException(
204
-                      $annotation,
205
-                      'name',
206
-                      $class
204
+                        $annotation,
205
+                        'name',
206
+                        $class
207 207
                     );
208 208
                 }
209 209
 
Please login to merge, or discard this patch.
src/Reader/RouteReader.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,9 +38,9 @@
 block discarded – undo
38 38
                 || $annotation instanceof RemoveRoute)
39 39
               && !isset($annotation->name)) {
40 40
                 throw new MissingAnnotationArgumentException(
41
-                  $annotation,
42
-                  'name',
43
-                  $class
41
+                    $annotation,
42
+                    'name',
43
+                    $class
44 44
                 );
45 45
             }
46 46
 
Please login to merge, or discard this patch.
src/Reader/AddChildReader.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,17 +37,17 @@
 block discarded – undo
37 37
 
38 38
             if (!isset($annotation->class)) {
39 39
                 throw new MissingAnnotationArgumentException(
40
-                  $annotation,
41
-                  'class',
42
-                  $class
40
+                    $annotation,
41
+                    'class',
42
+                    $class
43 43
                 );
44 44
             }
45 45
 
46 46
             if (!isset($annotation->field)) {
47 47
                 throw new MissingAnnotationArgumentException(
48
-                  $annotation,
49
-                  'field',
50
-                  $class
48
+                    $annotation,
49
+                    'field',
50
+                    $class
51 51
                 );
52 52
             }
53 53
 
Please login to merge, or discard this patch.
src/Admin/AnnotationAdmin.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -117,15 +117,15 @@  discard block
 block discarded – undo
117 117
      *                                                     reader.
118 118
      */
119 119
     public function __construct(
120
-      ActionButtonReader $actionButtonReader,
121
-      DatagridReader $datagridReader,
122
-      DatagridValuesReader $datagridValuesReader,
123
-      DashboardActionReader $dashboardActionReader,
124
-      ExportReader $exportReader,
125
-      FormReader $formReader,
126
-      ListReader $listReader,
127
-      RouteReader $routeReader,
128
-      ShowReader $showReader
120
+        ActionButtonReader $actionButtonReader,
121
+        DatagridReader $datagridReader,
122
+        DatagridValuesReader $datagridValuesReader,
123
+        DashboardActionReader $dashboardActionReader,
124
+        ExportReader $exportReader,
125
+        FormReader $formReader,
126
+        ListReader $listReader,
127
+        RouteReader $routeReader,
128
+        ShowReader $showReader
129 129
     ) {
130 130
         parent::__construct();
131 131
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     public function getExportFormats(): array
150 150
     {
151 151
         return $this->exportReader->getFormats(
152
-          $this->getReflectionClass()
152
+            $this->getReflectionClass()
153 153
         ) ?: parent::getExportFormats();
154 154
     }
155 155
 
@@ -164,19 +164,19 @@  discard block
 block discarded – undo
164 164
      * @throws ReflectionException
165 165
      */
166 166
     protected function configureActionButtons(
167
-      array $buttonList,
168
-      string $action,
167
+        array $buttonList,
168
+        string $action,
169 169
       ?object $object = null
170 170
     ): array {
171 171
         return $this->actionButtonReader
172
-          ->getActions(
172
+            ->getActions(
173 173
             $this->getReflectionClass(),
174 174
             parent::configureActionButtons(
175
-              $buttonList,
176
-              $action,
177
-              $object
175
+                $buttonList,
176
+                $action,
177
+                $object
178 178
             )
179
-          );
179
+            );
180 180
     }
181 181
 
182 182
     /**
@@ -190,10 +190,10 @@  discard block
 block discarded – undo
190 190
     protected function configureDashboardActions(array $actions): array
191 191
     {
192 192
         return $this->dashboardActionReader
193
-          ->getActions(
193
+            ->getActions(
194 194
             $this->getReflectionClass(),
195 195
             parent::configureDashboardActions($actions)
196
-          );
196
+            );
197 197
     }
198 198
 
199 199
     /**
@@ -207,8 +207,8 @@  discard block
 block discarded – undo
207 207
     protected function configureDatagridFilters(DatagridMapper $filter): void
208 208
     {
209 209
         $this->datagridReader->configureFields(
210
-          $this->getReflectionClass(),
211
-          $filter
210
+            $this->getReflectionClass(),
211
+            $filter
212 212
         );
213 213
     }
214 214
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
     protected function configureExportFields(): array
222 222
     {
223 223
         return $this->exportReader->getFields(
224
-          $this->getReflectionClass()
224
+            $this->getReflectionClass()
225 225
         ) ?: parent::getExportFields();
226 226
     }
227 227
 
@@ -237,15 +237,15 @@  discard block
 block discarded – undo
237 237
     {
238 238
         if ($this->getRequest()->get($this->getIdParameter())) {
239 239
             $this->formReader->configureEditFields(
240
-              $this->getReflectionClass(),
241
-              $form
240
+                $this->getReflectionClass(),
241
+                $form
242 242
             );
243 243
             return;
244 244
         }
245 245
 
246 246
         $this->formReader->configureCreateFields(
247
-          $this->getReflectionClass(),
248
-          $form
247
+            $this->getReflectionClass(),
248
+            $form
249 249
         );
250 250
     }
251 251
 
@@ -260,10 +260,10 @@  discard block
 block discarded – undo
260 260
     protected function configureListFields(ListMapper $list): void
261 261
     {
262 262
         $this->listReader
263
-          ->configureFields(
263
+            ->configureFields(
264 264
             $this->getReflectionClass(),
265 265
             $list
266
-          );
266
+            );
267 267
     }
268 268
 
269 269
     /**
@@ -277,16 +277,16 @@  discard block
 block discarded – undo
277 277
     protected function configureRoutes(RouteCollectionInterface $collection
278 278
     ): void {
279 279
         [$addRoutes, $removeRoutes] = $this->routeReader->getRoutes(
280
-          $this->getReflectionClass()
280
+            $this->getReflectionClass()
281 281
         );
282 282
 
283 283
         /** @var AddRoute $route */
284 284
         foreach ($addRoutes as $route) {
285 285
             $collection->add(
286
-              $route->name,
287
-              $route->path ? $this->replaceIdParameterInRoutePath(
286
+                $route->name,
287
+                $route->path ? $this->replaceIdParameterInRoutePath(
288 288
                 $route->path
289
-              ) : $route->getName()
289
+                ) : $route->getName()
290 290
             );
291 291
         }
292 292
 
@@ -307,8 +307,8 @@  discard block
 block discarded – undo
307 307
     protected function configureShowFields(ShowMapper $show): void
308 308
     {
309 309
         $this->showReader->configureFields(
310
-          $this->getReflectionClass(),
311
-          $show
310
+            $this->getReflectionClass(),
311
+            $show
312 312
         );
313 313
     }
314 314
 
@@ -323,9 +323,9 @@  discard block
 block discarded – undo
323 323
     private function replaceIdParameterInRoutePath(string $path): string
324 324
     {
325 325
         return str_replace(
326
-          AddRoute::ID_PARAMETER,
327
-          $this->getRouterIdParameter(),
328
-          $path
326
+            AddRoute::ID_PARAMETER,
327
+            $this->getRouterIdParameter(),
328
+            $path
329 329
         );
330 330
     }
331 331
 
Please login to merge, or discard this patch.
src/Reader/FormReader.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
      * @return void
35 35
      */
36 36
     public function configureCreateFields(
37
-      ReflectionClass $class,
38
-      FormMapper $formMapper
37
+        ReflectionClass $class,
38
+        FormMapper $formMapper
39 39
     ): void {
40 40
         $this->configureFields(
41
-          $class,
42
-          $formMapper,
43
-          FormField::ACTION_CREATE
41
+            $class,
42
+            $formMapper,
43
+            FormField::ACTION_CREATE
44 44
         );
45 45
     }
46 46
 
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
      * @return void
54 54
      */
55 55
     public function configureEditFields(
56
-      ReflectionClass $class,
57
-      FormMapper $formMapper
56
+        ReflectionClass $class,
57
+        FormMapper $formMapper
58 58
     ): void {
59 59
         $this->configureFields(
60
-          $class,
61
-          $formMapper,
62
-          FormField::ACTION_EDIT
60
+            $class,
61
+            $formMapper,
62
+            FormField::ACTION_EDIT
63 63
         );
64 64
     }
65 65
 
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
      * @return void
74 74
      */
75 75
     private function configureFields(
76
-      ReflectionClass $class,
77
-      FormMapper $formMapper,
78
-      string $action
76
+        ReflectionClass $class,
77
+        FormMapper $formMapper,
78
+        string $action
79 79
     ): void {
80 80
         $propertiesWithPosition = [];
81 81
         $propertiesWithoutPosition = [];
@@ -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.