@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | $tree_node = new TreeViewNode($element->__toString(), $href, $children_nodes); |
104 | 104 | |
105 | - if($children_nodes != null) { |
|
105 | + if ($children_nodes != null) { |
|
106 | 106 | $tree_node->addTag((string) count($children_nodes)); |
107 | 107 | } |
108 | 108 | |
@@ -177,9 +177,9 @@ discard block |
||
177 | 177 | $parent_id = $parent != null ? $parent->getID() : "0"; |
178 | 178 | // Backslashes are not allowed in cache keys |
179 | 179 | $secure_class_name = str_replace("\\", '_', $class_name); |
180 | - $key = "list_" . $this->keyGenerator->generateKey() . "_" . $secure_class_name . $parent_id; |
|
180 | + $key = "list_".$this->keyGenerator->generateKey()."_".$secure_class_name.$parent_id; |
|
181 | 181 | |
182 | - $ret = $this->cache->get($key, function (ItemInterface $item) use ($class_name, $parent, $secure_class_name) { |
|
182 | + $ret = $this->cache->get($key, function(ItemInterface $item) use ($class_name, $parent, $secure_class_name) { |
|
183 | 183 | // Invalidate when groups, a element with the class or the user changes |
184 | 184 | $item->tag(['groups', 'tree_list', $this->keyGenerator->generateKey(), $secure_class_name]); |
185 | 185 | /** |
@@ -66,9 +66,9 @@ |
||
66 | 66 | */ |
67 | 67 | public function getTree() : array |
68 | 68 | { |
69 | - $key = "tree_tools_" . $this->keyGenerator->generateKey(); |
|
69 | + $key = "tree_tools_".$this->keyGenerator->generateKey(); |
|
70 | 70 | |
71 | - return $this->cache->get($key, function (ItemInterface $item) { |
|
71 | + return $this->cache->get($key, function(ItemInterface $item) { |
|
72 | 72 | //Invalidate tree, whenever group or the user changes |
73 | 73 | $item->tag(["tree_tools", "groups", $this->keyGenerator->generateKey()]); |
74 | 74 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | { |
59 | 59 | $resolver->setDefaults([ |
60 | 60 | 'measurement_unit' => null, |
61 | - 'show_prefix' => function (Options $options) { |
|
61 | + 'show_prefix' => function(Options $options) { |
|
62 | 62 | if ($options['measurement_unit'] !== null) { |
63 | 63 | /** @var MeasurementUnit $unit */ |
64 | 64 | $unit = $options['measurement_unit']; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | return false; |
68 | 68 | }, |
69 | - 'is_integer' => function (Options $options) { |
|
69 | + 'is_integer' => function(Options $options) { |
|
70 | 70 | if ($options['measurement_unit'] !== null) { |
71 | 71 | /** @var MeasurementUnit $unit */ |
72 | 72 | $unit = $options['measurement_unit']; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | } |
75 | 75 | return false; |
76 | 76 | }, |
77 | - 'unit' => function (Options $options) { |
|
77 | + 'unit' => function(Options $options) { |
|
78 | 78 | if ($options['measurement_unit'] !== null) { |
79 | 79 | /** @var MeasurementUnit $unit */ |
80 | 80 | $unit = $options['measurement_unit']; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } |
83 | 83 | return null; |
84 | 84 | }, |
85 | - 'error_mapping' => [ '.' => 'value'] |
|
85 | + 'error_mapping' => ['.' => 'value'] |
|
86 | 86 | ]); |
87 | 87 | |
88 | 88 | $resolver->setAllowedTypes('measurement_unit', [MeasurementUnit::class, 'null']); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $resolver->setDefaults([ |
93 | 93 | 'min' => 0, |
94 | 94 | 'max' => '', |
95 | - 'step' => function (Options $options) { |
|
95 | + 'step' => function(Options $options) { |
|
96 | 96 | if ($options['is_integer'] === true) { |
97 | 97 | return 1; |
98 | 98 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | if ($options['show_prefix']) { |
119 | 119 | $builder->add('prefix', ChoiceType::class, [ |
120 | - 'choices' => ['M' => 6, 'k' => 3, '' => 0, 'm' => -3, 'µ' => -6 ] |
|
120 | + 'choices' => ['M' => 6, 'k' => 3, '' => 0, 'm' => -3, 'µ' => -6] |
|
121 | 121 | ]); |
122 | 122 | } |
123 | 123 |
@@ -79,7 +79,7 @@ |
||
79 | 79 | |
80 | 80 | |
81 | 81 | //Add pricedetails after we know the data, so we can set the default currency |
82 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($options) { |
|
82 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) use ($options) { |
|
83 | 83 | /** @var Orderdetail $orderdetail */ |
84 | 84 | $orderdetail = $event->getData(); |
85 | 85 |
@@ -62,7 +62,7 @@ |
||
62 | 62 | // This options allows you to override the currency shown for the null value |
63 | 63 | $resolver->setDefault('base_currency', null); |
64 | 64 | |
65 | - $resolver->setDefault('empty_message', function (Options $options) { |
|
65 | + $resolver->setDefault('empty_message', function(Options $options) { |
|
66 | 66 | //By default we use the global base currency: |
67 | 67 | $iso_code = $this->base_currency; |
68 | 68 |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | public function buildForm(FormBuilderInterface $builder, array $options) |
75 | 75 | { |
76 | 76 | $builder->addModelTransformer(new CallbackTransformer( |
77 | - function ($value) use ($options){ |
|
77 | + function($value) use ($options){ |
|
78 | 78 | return $this->transform($value, $options); |
79 | - }, function ($value) use ($options) { |
|
79 | + }, function($value) use ($options) { |
|
80 | 80 | return $this->reverseTransform($value, $options); |
81 | 81 | })); |
82 | 82 | } |
@@ -86,24 +86,24 @@ discard block |
||
86 | 86 | $resolver->setRequired(['class']); |
87 | 87 | $resolver->setDefaults([ |
88 | 88 | 'show_fullpath_in_subtext' => true, //When this is enabled, the full path will be shown in subtext |
89 | - 'subentities_of' => null, //Only show entities with the given parent class |
|
90 | - 'disable_not_selectable' => false, //Disable entries with not selectable property |
|
89 | + 'subentities_of' => null, //Only show entities with the given parent class |
|
90 | + 'disable_not_selectable' => false, //Disable entries with not selectable property |
|
91 | 91 | 'choice_value' => 'id', //Use the element id as option value and for comparing items |
92 | - 'choice_loader' => function (Options $options) { |
|
93 | - return new CallbackChoiceLoader(function () use ($options) { |
|
92 | + 'choice_loader' => function(Options $options) { |
|
93 | + return new CallbackChoiceLoader(function() use ($options) { |
|
94 | 94 | return $this->getEntries($options); |
95 | 95 | }); |
96 | - }, 'choice_label' => function ($choice, $key, $value) { |
|
96 | + }, 'choice_label' => function($choice, $key, $value) { |
|
97 | 97 | return $this->generateChoiceLabels($choice, $key, $value); |
98 | - }, 'choice_attr' => function ($choice, $key, $value) { |
|
98 | + }, 'choice_attr' => function($choice, $key, $value) { |
|
99 | 99 | return $this->generateChoiceAttr($choice, $key, $value); |
100 | 100 | } |
101 | 101 | ]); |
102 | 102 | |
103 | 103 | $resolver->setDefault('empty_message', null); |
104 | 104 | |
105 | - $resolver->setDefault('attr', function (Options $options) { |
|
106 | - $tmp = ['class' => 'selectpicker', 'data-live-search' => true]; |
|
105 | + $resolver->setDefault('attr', function(Options $options) { |
|
106 | + $tmp = ['class' => 'selectpicker', 'data-live-search' => true]; |
|
107 | 107 | if ($options['empty_message']) { |
108 | 108 | $tmp['data-none-Selected-Text'] = $options['empty_message']; |
109 | 109 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | |
142 | 142 | $tmp = str_repeat(' ', $choice->getLevel()); //Use 3 spaces for intendation |
143 | - $tmp .= htmlspecialchars($choice->getName()); |
|
143 | + $tmp .= htmlspecialchars($choice->getName()); |
|
144 | 144 | return $tmp; |
145 | 145 | } |
146 | 146 |
@@ -66,12 +66,12 @@ |
||
66 | 66 | //Disable import if user is not allowed to create elements. |
67 | 67 | $entity = new $data['entity_class'](); |
68 | 68 | $perm_name = "create"; |
69 | - $disabled = ! $this->security->isGranted($perm_name, $entity); |
|
69 | + $disabled = !$this->security->isGranted($perm_name, $entity); |
|
70 | 70 | |
71 | 71 | $builder |
72 | 72 | |
73 | 73 | ->add('format', ChoiceType::class, [ |
74 | - 'choices' => ['JSON' => 'json', 'XML' => 'xml','CSV' => 'csv' ,'YAML' => 'yaml'], |
|
74 | + 'choices' => ['JSON' => 'json', 'XML' => 'xml', 'CSV' => 'csv', 'YAML' => 'yaml'], |
|
75 | 75 | 'label' => $this->trans->trans('export.format'), |
76 | 76 | 'disabled' => $disabled]) |
77 | 77 | ->add('csv_separator', TextType::class, ['data' => ';', |
@@ -65,7 +65,7 @@ |
||
65 | 65 | //Disable import if user is not allowed to create elements. |
66 | 66 | $entity = new $data['entity_class'](); |
67 | 67 | $perm_name = "create"; |
68 | - $disabled = ! $this->security->isGranted($perm_name, $entity); |
|
68 | + $disabled = !$this->security->isGranted($perm_name, $entity); |
|
69 | 69 | |
70 | 70 | $builder |
71 | 71 | ->add('lines', TextareaType::class, ['data' => '', |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | return "indeterminate"; |
128 | 128 | } |
129 | 129 | |
130 | - throw new \InvalidArgumentException('Invalid value encountered!: ' . $value); |
|
130 | + throw new \InvalidArgumentException('Invalid value encountered!: '.$value); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | case "indeterminate": |
169 | 169 | return null; |
170 | 170 | default: |
171 | - throw new \InvalidArgumentException('Invalid value encountered!: ' . $value); |
|
171 | + throw new \InvalidArgumentException('Invalid value encountered!: '.$value); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | } |
175 | 175 | \ No newline at end of file |