@@ -76,7 +76,7 @@ |
||
| 76 | 76 | null, |
| 77 | 77 | 'pagerfanta', |
| 78 | 78 | ]) |
| 79 | - ->setNormalizer('actions', function (Options $options, $actions) { |
|
| 79 | + ->setNormalizer('actions', function(Options $options, $actions) { |
|
| 80 | 80 | $normalizedActions = []; |
| 81 | 81 | $addBatchAction = false; |
| 82 | 82 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | '_self', |
| 47 | 47 | '_blank', |
| 48 | 48 | ]) |
| 49 | - ->setNormalizer('route', function (Options $options, $value) use ($actionConfiguration) { |
|
| 49 | + ->setNormalizer('route', function(Options $options, $value) use ($actionConfiguration) { |
|
| 50 | 50 | // route or url should be defined |
| 51 | 51 | if (!$value && !$options->offsetGet('url') && !$options->offsetGet('admin')) { |
| 52 | 52 | throw new InvalidOptionsException( |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | return $value; |
| 66 | 66 | }) |
| 67 | - ->setNormalizer('admin', function (Options $options, $value) { |
|
| 67 | + ->setNormalizer('admin', function(Options $options, $value) { |
|
| 68 | 68 | // if a Admin is defined, an Action should be defined too |
| 69 | 69 | if ($value && !$options->offsetGet('action')) { |
| 70 | 70 | throw new InvalidOptionsException( |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | return $value; |
| 76 | 76 | }) |
| 77 | - ->setNormalizer('parameters', function (Options $options, $values) { |
|
| 77 | + ->setNormalizer('parameters', function(Options $options, $values) { |
|
| 78 | 78 | $cleanedValues = []; |
| 79 | 79 | |
| 80 | 80 | foreach ($values as $name => $method) { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | 'vertical', |
| 54 | 54 | null, |
| 55 | 55 | ]) |
| 56 | - ->setNormalizer('position', function (Options $options, $value) { |
|
| 56 | + ->setNormalizer('position', function(Options $options, $value) { |
|
| 57 | 57 | if ('top' === $this->menuName && null === $value) { |
| 58 | 58 | $value = 'horizontal'; |
| 59 | 59 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | return $value; |
| 66 | 66 | }) |
| 67 | - ->setNormalizer('template', function (Options $options, $value) { |
|
| 67 | + ->setNormalizer('template', function(Options $options, $value) { |
|
| 68 | 68 | // Define bootstrap navbar component template |
| 69 | 69 | if ('horizontal' === $options->offsetGet('position')) { |
| 70 | 70 | $value = '@LAGAdmin/Menu/menu.horizontal.html.twig'; |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | return $value; |
| 79 | 79 | }) |
| 80 | - ->setNormalizer('attr', function (Options $options, $value) { |
|
| 80 | + ->setNormalizer('attr', function(Options $options, $value) { |
|
| 81 | 81 | $position = $options->offsetGet('position'); |
| 82 | 82 | |
| 83 | 83 | if (!key_exists('class', $value)) { |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | return $value; |
| 102 | 102 | }) |
| 103 | - ->setNormalizer('item_css_class', function (Options $options, $value) { |
|
| 103 | + ->setNormalizer('item_css_class', function(Options $options, $value) { |
|
| 104 | 104 | $position = $options->offsetGet('position'); |
| 105 | 105 | |
| 106 | 106 | if (!$value) { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | return trim($value); |
| 119 | 119 | }) |
| 120 | - ->setNormalizer('brand', function (Options $options, $value) { |
|
| 120 | + ->setNormalizer('brand', function(Options $options, $value) { |
|
| 121 | 121 | if (null === $value && 'horizontal' === $options->offsetGet('position')) { |
| 122 | 122 | $value = $this->applicationName; |
| 123 | 123 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | ->setAllowedTypes('routing_name_pattern', 'string') |
| 87 | 87 | ->setAllowedTypes('routing_url_pattern', 'string') |
| 88 | 88 | ->setAllowedTypes('page_parameter', 'string') |
| 89 | - ->setNormalizer('routing_name_pattern', function (Options $options, $value) { |
|
| 89 | + ->setNormalizer('routing_name_pattern', function(Options $options, $value) { |
|
| 90 | 90 | if (false === strstr($value, '{admin}')) { |
| 91 | 91 | throw new InvalidOptionsException( |
| 92 | 92 | 'Admin routing configuration pattern name should contains the {admin} placeholder' |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | return $value; |
| 102 | 102 | }) |
| 103 | - ->setNormalizer('routing_url_pattern', function (Options $options, $value) { |
|
| 103 | + ->setNormalizer('routing_url_pattern', function(Options $options, $value) { |
|
| 104 | 104 | if (false === strstr($value, '{admin}')) { |
| 105 | 105 | throw new InvalidOptionsException('Admin routing configuration url pattern should contains {admin} placeholder'); |
| 106 | 106 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | 'pattern' => 'lag.admin.{key}', |
| 127 | 127 | ]); |
| 128 | 128 | $resolver->setAllowedTypes('translation', 'array'); |
| 129 | - $resolver->setNormalizer('translation', function (Options $options, $value) { |
|
| 129 | + $resolver->setNormalizer('translation', function(Options $options, $value) { |
|
| 130 | 130 | if (!array_key_exists('enabled', $value)) { |
| 131 | 131 | throw new InvalidOptionsException('Admin translation enabled parameter should be defined'); |
| 132 | 132 | } |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | $resolver->setDefault('fields_mapping', $defaultMapping); |
| 170 | 170 | $resolver->setAllowedTypes('fields_mapping', 'array'); |
| 171 | - $resolver->setNormalizer('fields_mapping', function (Options $options, $value) use ($defaultMapping) { |
|
| 171 | + $resolver->setNormalizer('fields_mapping', function(Options $options, $value) use ($defaultMapping) { |
|
| 172 | 172 | // Merge with default mapping to allow override |
| 173 | 173 | $value = array_merge($defaultMapping, $value); |
| 174 | 174 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | $resolver->setDefault('fields_template_mapping', $defaultMapping); |
| 184 | 184 | $resolver->setAllowedTypes('fields_template_mapping', 'array'); |
| 185 | - $resolver->setNormalizer('fields_template_mapping', function (Options $options, $value) use ($defaultMapping) { |
|
| 185 | + $resolver->setNormalizer('fields_template_mapping', function(Options $options, $value) use ($defaultMapping) { |
|
| 186 | 186 | // Merge with default mapping to allow override |
| 187 | 187 | $value = array_merge($defaultMapping, $value); |
| 188 | 188 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | ->setDefault('items', []) |
| 56 | 56 | ->setDefault('icon', null) |
| 57 | 57 | ->setDefault('link_css_class', 'nav-link') |
| 58 | - ->setNormalizer('admin', function (Options $options, $adminName) { |
|
| 58 | + ->setNormalizer('admin', function(Options $options, $adminName) { |
|
| 59 | 59 | // user has to defined either an admin name and an action name, or a route name with optional |
| 60 | 60 | // parameters, or an url |
| 61 | 61 | if (null === $adminName |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | return $adminName; |
| 71 | 71 | }) |
| 72 | 72 | // if an admin name is set, an action name can provided. This action will be the menu link |
| 73 | - ->setNormalizer('action', function (Options $options, $action) { |
|
| 73 | + ->setNormalizer('action', function(Options $options, $action) { |
|
| 74 | 74 | // if an action name is provided, an admin name should be defined too |
| 75 | 75 | if (null !== $action && null === $options->offsetGet('admin')) { |
| 76 | 76 | throw new InvalidOptionsException( |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | return $action; |
| 87 | 87 | }) |
| 88 | 88 | ->setAllowedTypes('parameters', 'array') |
| 89 | - ->setNormalizer('attr', function (Options $options, $attr) { |
|
| 89 | + ->setNormalizer('attr', function(Options $options, $attr) { |
|
| 90 | 90 | if (!is_array($attr)) { |
| 91 | 91 | $attr = []; |
| 92 | 92 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | return $attr; |
| 103 | 103 | }) |
| 104 | - ->setNormalizer('link_attr', function (Options $options, $value) { |
|
| 104 | + ->setNormalizer('link_attr', function(Options $options, $value) { |
|
| 105 | 105 | if (!is_array($value)) { |
| 106 | 106 | $value = []; |
| 107 | 107 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | return $value; |
| 114 | 114 | }) |
| 115 | - ->setNormalizer('items', function (Options $options, $items) { |
|
| 115 | + ->setNormalizer('items', function(Options $options, $items) { |
|
| 116 | 116 | if (!is_array($items)) { |
| 117 | 117 | $items = []; |
| 118 | 118 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | return $resolvedItems; |
| 131 | 131 | }) |
| 132 | - ->setNormalizer('text', function (Options $options, $text) { |
|
| 132 | + ->setNormalizer('text', function(Options $options, $text) { |
|
| 133 | 133 | if (!$text) { |
| 134 | 134 | // TODO use translation pattern key instead |
| 135 | 135 | $text = ucfirst($this->name); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | 'template' => '@LAGAdmin/Field/actionCollection.html.twig', |
| 26 | 26 | 'actions' => [], |
| 27 | 27 | ]) |
| 28 | - ->setNormalizer('actions', function (Options $options, $value) use ($actionConfiguration) { |
|
| 28 | + ->setNormalizer('actions', function(Options $options, $value) use ($actionConfiguration) { |
|
| 29 | 29 | if (!is_array($value) || 0 === count($value)) { |
| 30 | 30 | $value = [ |
| 31 | 31 | 'edit' => [], |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | '_self', |
| 125 | 125 | '_blank', |
| 126 | 126 | ]) |
| 127 | - ->setNormalizer('route', function (Options $options, $value) use ($actionConfiguration) { |
|
| 127 | + ->setNormalizer('route', function(Options $options, $value) use ($actionConfiguration) { |
|
| 128 | 128 | // route or url should be defined |
| 129 | 129 | if (!$value && !$options->offsetGet('url') && !$options->offsetGet('admin')) { |
| 130 | 130 | throw new InvalidOptionsException( |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | return $value; |
| 144 | 144 | }) |
| 145 | - ->setNormalizer('admin', function (Options $options, $value) { |
|
| 145 | + ->setNormalizer('admin', function(Options $options, $value) { |
|
| 146 | 146 | // if a Admin is defined, an Action should be defined too |
| 147 | 147 | if ($value && !$options->offsetGet('action')) { |
| 148 | 148 | throw new InvalidOptionsException( |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | return $value; |
| 154 | 154 | }) |
| 155 | - ->setNormalizer('parameters', function (Options $options, $values) { |
|
| 155 | + ->setNormalizer('parameters', function(Options $options, $values) { |
|
| 156 | 156 | $cleanedValues = []; |
| 157 | 157 | |
| 158 | 158 | foreach ($values as $name => $method) { |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | public function testCreateDeleteForm() |
| 28 | 28 | { |
| 29 | - list($factory, , $formFactory) = $this->createFactory(); |
|
| 29 | + list($factory,, $formFactory) = $this->createFactory(); |
|
| 30 | 30 | |
| 31 | 31 | $action = $this->createActionWithConfigurationMock([ |
| 32 | 32 | ['form', 'form_type'], |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $formBuilder |
| 103 | 103 | ->expects($this->exactly(2)) |
| 104 | 104 | ->method('addModelTransformer') |
| 105 | - ->willReturnCallback(function (CallbackTransformer $transformer) { |
|
| 105 | + ->willReturnCallback(function(CallbackTransformer $transformer) { |
|
| 106 | 106 | // TODO test transformers |
| 107 | 107 | // if ('array' === $field) { |
| 108 | 108 | // $this->assertEquals('key: value'.PHP_EOL, $transformer->transform(['key' => 'value'])); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $formBuilder |
| 114 | 114 | ->expects($this->exactly(3)) |
| 115 | 115 | ->method('add') |
| 116 | - ->willReturnCallback(function ($field) { |
|
| 116 | + ->willReturnCallback(function($field) { |
|
| 117 | 117 | $this->assertContains($field, [ |
| 118 | 118 | 'pandas', |
| 119 | 119 | 'array', |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | |
| 113 | 113 | public function testRenderHeaderWithNoMappedField() |
| 114 | 114 | { |
| 115 | - list($renderer, , ) = $this->createRender(); |
|
| 115 | + list($renderer,,) = $this->createRender(); |
|
| 116 | 116 | |
| 117 | 117 | $admin = $this->createMock(ViewInterface::class); |
| 118 | 118 | $field = $this->createMock(FieldInterface::class); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | ->setAllowedValues('type', $this->allowedFields) |
| 32 | 32 | ->setAllowedTypes('type', 'string') |
| 33 | 33 | ->setAllowedTypes('options', 'array') |
| 34 | - ->setNormalizer('type', function (Options $options, $value) { |
|
| 34 | + ->setNormalizer('type', function(Options $options, $value) { |
|
| 35 | 35 | if (null === $value) { |
| 36 | 36 | $value = ''; |
| 37 | 37 | } |