Test Failed
Pull Request — develop (#2)
by Mathieu
03:32
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/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.
src/Admin/AnnotationAdmin.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -120,15 +120,15 @@  discard block
 block discarded – undo
120 120
      *                                                     reader.
121 121
      */
122 122
     public function __construct(
123
-      ActionButtonReader $actionButtonReader,
124
-      DatagridReader $datagridReader,
125
-      DatagridValuesReader $datagridValuesReader,
126
-      DashboardActionReader $dashboardActionReader,
127
-      ExportReader $exportReader,
128
-      FormReader $formReader,
129
-      ListReader $listReader,
130
-      RouteReader $routeReader,
131
-      ShowReader $showReader
123
+        ActionButtonReader $actionButtonReader,
124
+        DatagridReader $datagridReader,
125
+        DatagridValuesReader $datagridValuesReader,
126
+        DashboardActionReader $dashboardActionReader,
127
+        ExportReader $exportReader,
128
+        FormReader $formReader,
129
+        ListReader $listReader,
130
+        RouteReader $routeReader,
131
+        ShowReader $showReader
132 132
     ) {
133 133
         parent::__construct();
134 134
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
     public function getExportFormats(): array
153 153
     {
154 154
         return $this->exportReader->getFormats(
155
-          $this->getReflectionClass()
155
+            $this->getReflectionClass()
156 156
         ) ?: parent::getExportFormats();
157 157
     }
158 158
 
@@ -167,19 +167,19 @@  discard block
 block discarded – undo
167 167
      * @throws ReflectionException
168 168
      */
169 169
     protected function configureActionButtons(
170
-      array $buttonList,
171
-      string $action,
170
+        array $buttonList,
171
+        string $action,
172 172
       ?object $object = null
173 173
     ): array {
174 174
         return $this->actionButtonReader
175
-          ->getActions(
175
+            ->getActions(
176 176
             $this->getReflectionClass(),
177 177
             parent::configureActionButtons(
178
-              $buttonList,
179
-              $action,
180
-              $object
178
+                $buttonList,
179
+                $action,
180
+                $object
181 181
             )
182
-          );
182
+            );
183 183
     }
184 184
 
185 185
     /**
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
     protected function configureDashboardActions(array $actions): array
195 195
     {
196 196
         return $this->dashboardActionReader
197
-          ->getActions(
197
+            ->getActions(
198 198
             $this->getReflectionClass(),
199 199
             parent::configureDashboardActions($actions)
200
-          );
200
+            );
201 201
     }
202 202
 
203 203
     /**
@@ -211,8 +211,8 @@  discard block
 block discarded – undo
211 211
     protected function configureDatagridFilters(DatagridMapper $filter): void
212 212
     {
213 213
         $this->datagridReader->configureFields(
214
-          $this->getReflectionClass(),
215
-          $filter
214
+            $this->getReflectionClass(),
215
+            $filter
216 216
         );
217 217
     }
218 218
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
     protected function configureExportFields(): array
226 226
     {
227 227
         return $this->exportReader->getFields(
228
-          $this->getReflectionClass()
228
+            $this->getReflectionClass()
229 229
         ) ?: parent::getExportFields();
230 230
     }
231 231
 
@@ -241,15 +241,15 @@  discard block
 block discarded – undo
241 241
     {
242 242
         if ($this->getRequest()->get($this->getIdParameter())) {
243 243
             $this->formReader->configureEditFields(
244
-              $this->getReflectionClass(),
245
-              $form
244
+                $this->getReflectionClass(),
245
+                $form
246 246
             );
247 247
             return;
248 248
         }
249 249
 
250 250
         $this->formReader->configureCreateFields(
251
-          $this->getReflectionClass(),
252
-          $form
251
+            $this->getReflectionClass(),
252
+            $form
253 253
         );
254 254
     }
255 255
 
@@ -264,10 +264,10 @@  discard block
 block discarded – undo
264 264
     protected function configureListFields(ListMapper $list): void
265 265
     {
266 266
         $this->listReader
267
-          ->configureFields(
267
+            ->configureFields(
268 268
             $this->getReflectionClass(),
269 269
             $list
270
-          );
270
+            );
271 271
     }
272 272
 
273 273
     /**
@@ -279,19 +279,19 @@  discard block
 block discarded – undo
279 279
      * @throws ReflectionException
280 280
      */
281 281
     protected function configureRoutes(
282
-      RouteCollectionInterface $collection
282
+        RouteCollectionInterface $collection
283 283
     ): void {
284 284
         [$addRoutes, $removeRoutes] = $this->routeReader->getRoutes(
285
-          $this->getReflectionClass()
285
+            $this->getReflectionClass()
286 286
         );
287 287
 
288 288
         /** @var AddRoute $route */
289 289
         foreach ($addRoutes as $route) {
290 290
             $collection->add(
291
-              $route->name,
292
-              $route->path ? $this->replaceIdParameterInRoutePath(
291
+                $route->name,
292
+                $route->path ? $this->replaceIdParameterInRoutePath(
293 293
                 $route->path
294
-              ) : $route->getName()
294
+                ) : $route->getName()
295 295
             );
296 296
         }
297 297
 
@@ -312,8 +312,8 @@  discard block
 block discarded – undo
312 312
     protected function configureShowFields(ShowMapper $show): void
313 313
     {
314 314
         $this->showReader->configureFields(
315
-          $this->getReflectionClass(),
316
-          $show
315
+            $this->getReflectionClass(),
316
+            $show
317 317
         );
318 318
     }
319 319
 
@@ -328,9 +328,9 @@  discard block
 block discarded – undo
328 328
     private function replaceIdParameterInRoutePath(string $path): string
329 329
     {
330 330
         return str_replace(
331
-          AddRoute::ID_PARAMETER,
332
-          $this->getRouterIdParameter(),
333
-          $path
331
+            AddRoute::ID_PARAMETER,
332
+            $this->getRouterIdParameter(),
333
+            $path
334 334
         );
335 335
     }
336 336
 
Please login to merge, or discard this patch.