@@ -41,7 +41,7 @@ |
||
41 | 41 | { |
42 | 42 | if (null === $value) { |
43 | 43 | return $this->options['nullValue']; |
44 | - } elseif (! $value instanceof DateTimeInterface) { |
|
44 | + } elseif (!$value instanceof DateTimeInterface) { |
|
45 | 45 | $value = new DateTime((string) $value); |
46 | 46 | } |
47 | 47 |
@@ -60,11 +60,11 @@ |
||
60 | 60 | |
61 | 61 | public function render($value, $context) |
62 | 62 | { |
63 | - if (! $context instanceof Part) { |
|
63 | + if (!$context instanceof Part) { |
|
64 | 64 | throw new RuntimeException('$context must be a Part object!'); |
65 | 65 | } |
66 | 66 | $tmp = ''; |
67 | - $attachments = $context->getAttachments()->filter(function (Attachment $attachment) { |
|
67 | + $attachments = $context->getAttachments()->filter(function(Attachment $attachment) { |
|
68 | 68 | return $attachment->getShowInTable() && $this->attachmentManager->isFileExisting($attachment); |
69 | 69 | }); |
70 | 70 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | throw new RuntimeException('You can not download external attachments!'); |
57 | 57 | } |
58 | 58 | |
59 | - if (! $helper->isFileExisting($attachment)) { |
|
59 | + if (!$helper->isFileExisting($attachment)) { |
|
60 | 60 | throw new RuntimeException('The file associated with the attachment is not existing!'); |
61 | 61 | } |
62 | 62 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | throw new RuntimeException('You can not download external attachments!'); |
87 | 87 | } |
88 | 88 | |
89 | - if (! $helper->isFileExisting($attachment)) { |
|
89 | + if (!$helper->isFileExisting($attachment)) { |
|
90 | 90 | throw new RuntimeException('The file associated with the attachment is not existing!'); |
91 | 91 | } |
92 | 92 |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | ); |
99 | 99 | |
100 | 100 | //Check if user is allowed to read info, otherwise apply placeholder |
101 | - if ((null !== $annotation) && ! $this->isGranted('read', $annotation, $element)) { |
|
101 | + if ((null !== $annotation) && !$this->isGranted('read', $annotation, $element)) { |
|
102 | 102 | $property->setAccessible(true); |
103 | 103 | $value = $annotation->getPlaceholder(); |
104 | 104 | |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | $property->setAccessible(true); |
147 | 147 | |
148 | 148 | //If the user is not allowed to edit or read this property, reset all values. |
149 | - if ((! $this->isGranted('read', $annotation, $element) |
|
150 | - || ! $this->isGranted('edit', $annotation, $element))) { |
|
149 | + if ((!$this->isGranted('read', $annotation, $element) |
|
150 | + || !$this->isGranted('edit', $annotation, $element))) { |
|
151 | 151 | //Set value to old value, so that there a no change to this property |
152 | 152 | if (isset($old_data[$property->getName()])) { |
153 | 153 | $property->setValue($element, $old_data[$property->getName()]); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | */ |
171 | 171 | protected function isRunningFromCLI() |
172 | 172 | { |
173 | - if (empty($_SERVER['REMOTE_ADDR']) && ! isset($_SERVER['HTTP_USER_AGENT']) && count($_SERVER['argv']) > 0) { |
|
173 | + if (empty($_SERVER['REMOTE_ADDR']) && !isset($_SERVER['HTTP_USER_AGENT']) && count($_SERVER['argv']) > 0) { |
|
174 | 174 | return true; |
175 | 175 | } |
176 | 176 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | //Check if we have already have saved the permission, otherwise save it to cache |
206 | - if (! isset($this->perm_cache[$mode][get_class($element)][$operation])) { |
|
206 | + if (!isset($this->perm_cache[$mode][get_class($element)][$operation])) { |
|
207 | 207 | $this->perm_cache[$mode][get_class($element)][$operation] = $this->security->isGranted($operation, $element); |
208 | 208 | } |
209 | 209 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | 'label_attr' => [ |
43 | 43 | 'class' => 'checkbox-custom', |
44 | 44 | ], |
45 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
45 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
46 | 46 | ]); |
47 | 47 | |
48 | 48 | $builder->add('disable_manufacturers', CheckboxType::class, [ |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | 'label_attr' => [ |
53 | 53 | 'class' => 'checkbox-custom', |
54 | 54 | ], |
55 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
55 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
56 | 56 | ]); |
57 | 57 | |
58 | 58 | $builder->add('disable_autodatasheets', CheckboxType::class, [ |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | 'label_attr' => [ |
63 | 63 | 'class' => 'checkbox-custom', |
64 | 64 | ], |
65 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
65 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
66 | 66 | ]); |
67 | 67 | |
68 | 68 | $builder->add('disable_properties', CheckboxType::class, [ |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | 'label_attr' => [ |
73 | 73 | 'class' => 'checkbox-custom', |
74 | 74 | ], |
75 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
75 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
76 | 76 | ]); |
77 | 77 | |
78 | 78 | $builder->add('partname_hint', TextType::class, [ |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | 'attr' => [ |
83 | 83 | 'placeholder' => 'category.edit.partname_hint.placeholder', |
84 | 84 | ], |
85 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
85 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
86 | 86 | ]); |
87 | 87 | |
88 | 88 | $builder->add('partname_regex', TextType::class, [ |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | 'attr' => [ |
93 | 93 | 'placeholder' => 'category.edit.partname_regex.placeholder', |
94 | 94 | ], |
95 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
95 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
96 | 96 | ]); |
97 | 97 | |
98 | 98 | $builder->add('default_description', TextType::class, [ |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | 'attr' => [ |
103 | 103 | 'placeholder' => 'category.edit.default_description.placeholder', |
104 | 104 | ], |
105 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
105 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
106 | 106 | ]); |
107 | 107 | |
108 | 108 | $builder->add('default_comment', TextType::class, [ |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | 'attr' => [ |
113 | 113 | 'placeholder' => 'category.edit.default_comment.placeholder', |
114 | 114 | ], |
115 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
115 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
116 | 116 | ]); |
117 | 117 | } |
118 | 118 | } |
@@ -54,15 +54,15 @@ |
||
54 | 54 | 'placeholder' => 'attachment_type.edit.filetype_filter.placeholder', |
55 | 55 | ], |
56 | 56 | 'empty_data' => '', |
57 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
57 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
58 | 58 | ]); |
59 | 59 | |
60 | 60 | //Normalize data before writing it to database |
61 | 61 | $builder->get('filetype_filter')->addViewTransformer(new CallbackTransformer( |
62 | - function ($value) { |
|
62 | + function($value) { |
|
63 | 63 | return $value; |
64 | 64 | }, |
65 | - function ($value) { |
|
65 | + function($value) { |
|
66 | 66 | return $this->filterTools->normalizeFilterString($value); |
67 | 67 | } |
68 | 68 | )); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | 'label_attr' => [ |
44 | 44 | 'class' => 'checkbox-custom', |
45 | 45 | ], |
46 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
46 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
47 | 47 | ]); |
48 | 48 | |
49 | 49 | $builder->add('limit_to_existing_parts', CheckboxType::class, [ |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | 'label_attr' => [ |
54 | 54 | 'class' => 'checkbox-custom', |
55 | 55 | ], |
56 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
56 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
57 | 57 | ]); |
58 | 58 | |
59 | 59 | $builder->add('only_single_part', CheckboxType::class, [ |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | 'label_attr' => [ |
64 | 64 | 'class' => 'checkbox-custom', |
65 | 65 | ], |
66 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
66 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
67 | 67 | ]); |
68 | 68 | |
69 | 69 | $builder->add('storage_type', StructuralEntityType::class, [ |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | 'help' => 'storelocation.storage_type.help', |
73 | 73 | 'class' => MeasurementUnit::class, |
74 | 74 | 'disable_not_selectable' => true, |
75 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
75 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity), |
|
76 | 76 | ]); |
77 | 77 | } |
78 | 78 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | 'label_attr' => [ |
43 | 43 | 'class' => 'checkbox-custom', |
44 | 44 | ], |
45 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
45 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
46 | 46 | ]); |
47 | 47 | |
48 | 48 | $builder->add('use_si_prefix', CheckboxType::class, [ |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | 'label_attr' => [ |
53 | 53 | 'class' => 'checkbox-custom', |
54 | 54 | ], |
55 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
55 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
56 | 56 | ]); |
57 | 57 | |
58 | 58 | $builder->add('unit', TextType::class, [ |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | 'attr' => [ |
62 | 62 | 'placeholder' => 'measurement_unit.edit.unit_symbol.placeholder', |
63 | 63 | ], |
64 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
64 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
65 | 65 | ]); |
66 | 66 | } |
67 | 67 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | $builder->add('address', TextareaType::class, [ |
41 | 41 | 'label' => 'company.edit.address', |
42 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
42 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
43 | 43 | 'attr' => [ |
44 | 44 | 'placeholder' => 'company.edit.address.placeholder', |
45 | 45 | ], |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | $builder->add('phone_number', TelType::class, [ |
51 | 51 | 'label' => 'company.edit.phone_number', |
52 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
52 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
53 | 53 | 'attr' => [ |
54 | 54 | 'placeholder' => 'company.edit.phone_number.placeholder', |
55 | 55 | ], |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | $builder->add('fax_number', TelType::class, [ |
61 | 61 | 'label' => 'company.edit.fax_number', |
62 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
62 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
63 | 63 | 'attr' => [ |
64 | 64 | 'placeholder' => 'company.fax_number.placeholder', |
65 | 65 | ], |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | $builder->add('email_address', EmailType::class, [ |
71 | 71 | 'label' => 'company.edit.email', |
72 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
72 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
73 | 73 | 'attr' => [ |
74 | 74 | 'placeholder' => 'company.edit.email.placeholder', |
75 | 75 | ], |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | $builder->add('website', UrlType::class, [ |
81 | 81 | 'label' => 'company.edit.website', |
82 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
82 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
83 | 83 | 'attr' => [ |
84 | 84 | 'placeholder' => 'company.edit.website.placeholder', |
85 | 85 | ], |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $builder->add('auto_product_url', UrlType::class, [ |
91 | 91 | 'label' => 'company.edit.auto_product_url', |
92 | 92 | 'help' => 'company.edit.auto_product_url.help', |
93 | - 'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
93 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity), |
|
94 | 94 | 'attr' => [ |
95 | 95 | 'placeholder' => 'company.edit.auto_product_url.placeholder', |
96 | 96 | ], |