@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | * @return object|AnnotationInterface|null |
| 46 | 46 | */ |
| 47 | 47 | protected function getClassAnnotation( |
| 48 | - ReflectionClass $class, |
|
| 49 | - string $annotation |
|
| 48 | + ReflectionClass $class, |
|
| 49 | + string $annotation |
|
| 50 | 50 | ): ?object { |
| 51 | 51 | return $this->annotationReader->getClassAnnotation($class, $annotation); |
| 52 | 52 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * @return array<object|AnnotationInterface> |
| 72 | 72 | */ |
| 73 | 73 | protected function getPropertyAnnotations( |
| 74 | - ReflectionProperty $property |
|
| 74 | + ReflectionProperty $property |
|
| 75 | 75 | ): array { |
| 76 | 76 | return $this->annotationReader->getPropertyAnnotations($property); |
| 77 | 77 | } |
@@ -85,12 +85,12 @@ discard block |
||
| 85 | 85 | * @return object|AnnotationInterface|null |
| 86 | 86 | */ |
| 87 | 87 | protected function getMethodAnnotation( |
| 88 | - ReflectionMethod $method, |
|
| 89 | - string $annotation |
|
| 88 | + ReflectionMethod $method, |
|
| 89 | + string $annotation |
|
| 90 | 90 | ): ?object { |
| 91 | 91 | return $this->annotationReader->getMethodAnnotation( |
| 92 | - $method, |
|
| 93 | - $annotation |
|
| 92 | + $method, |
|
| 93 | + $annotation |
|
| 94 | 94 | ); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -35,8 +35,8 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -37,14 +37,14 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -36,8 +36,8 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -38,9 +38,9 @@ |
||
| 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 | |
@@ -37,17 +37,17 @@ |
||
| 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 | |