Passed
Push — master ( 892132...fe0f69 )
by Jan
04:10
created
src/Services/Trees/TreeViewGenerator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
                 $item->setSelected(true);
97 97
             }
98 98
 
99
-            if (! empty($item->getNodes())) {
99
+            if (!empty($item->getNodes())) {
100 100
                 $item->addTag((string) \count($item->getNodes()));
101 101
             }
102 102
 
103
-            if (! empty($href_type)) {
103
+            if (!empty($href_type)) {
104 104
                 $entity = $this->em->getPartialReference($class, $item->getId());
105 105
                 $item->setHref($this->urlGenerator->getURL($entity, $href_type));
106 106
             }
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
      */
122 122
     public function getGenericTree(string $class, ?StructuralDBElement $parent = null): array
123 123
     {
124
-        if (! is_a($class, NamedDBElement::class, true)) {
124
+        if (!is_a($class, NamedDBElement::class, true)) {
125 125
             throw new \InvalidArgumentException('$class must be a class string that implements StructuralDBElement or NamedDBElement!');
126 126
         }
127
-        if (null !== $parent && ! is_a($parent, $class)) {
127
+        if (null !== $parent && !is_a($parent, $class)) {
128 128
             throw new \InvalidArgumentException('$parent must be of the type $class!');
129 129
         }
130 130
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         $secure_class_name = str_replace('\\', '_', $class);
140 140
         $key = 'treeview_'.$this->keyGenerator->generateKey().'_'.$secure_class_name;
141 141
 
142
-        return $this->cache->get($key, function (ItemInterface $item) use ($repo, $parent, $secure_class_name) {
142
+        return $this->cache->get($key, function(ItemInterface $item) use ($repo, $parent, $secure_class_name) {
143 143
             // Invalidate when groups, a element with the class or the user changes
144 144
             $item->tag(['groups', 'tree_treeview', $this->keyGenerator->generateKey(), $secure_class_name]);
145 145
 
Please login to merge, or discard this patch.
src/Services/EntityURLGenerator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -293,7 +293,7 @@
 block discarded – undo
293 293
         $class = \get_class($entity);
294 294
 
295 295
         //Check if we have an direct mapping for the given class
296
-        if (! \array_key_exists($class, $map)) {
296
+        if (!\array_key_exists($class, $map)) {
297 297
             //Check if we need to check inheritance by looping through our map
298 298
             foreach ($map as $key => $value) {
299 299
                 if (is_a($entity, $key)) {
Please login to merge, or discard this patch.
src/Services/EntityImporter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
         //Expand every line to a single entry:
61 61
         $names = explode("\n", $lines);
62 62
 
63
-        if (! is_a($class_name, StructuralDBElement::class, true)) {
63
+        if (!is_a($class_name, StructuralDBElement::class, true)) {
64 64
             throw new \InvalidArgumentException('$class_name must be a StructuralDBElement type!');
65 65
         }
66
-        if (null !== $parent && ! is_a($parent, $class_name)) {
66
+        if (null !== $parent && !is_a($parent, $class_name)) {
67 67
             throw new \InvalidArgumentException('$parent must have the same type as specified in $class_name!');
68 68
         }
69 69
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             ['groups' => $groups, 'csv_delimiter' => $options['csv_separator']]);
175 175
 
176 176
         //Ensure we have an array of entitity elements.
177
-        if (! \is_array($entities)) {
177
+        if (!\is_array($entities)) {
178 178
             $entities = [$entities];
179 179
         }
180 180
 
Please login to merge, or discard this patch.
src/Services/PasswordResetManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         $expiration_date->add(date_interval_create_from_date_string('1 day'));
74 74
         $user->setPwResetExpires($expiration_date);
75 75
 
76
-        if (! empty($user->getEmail())) {
76
+        if (!empty($user->getEmail())) {
77 77
             $address = new Address($user->getEmail(), $user->getFullName());
78 78
             $mail = new TemplatedEmail();
79 79
             $mail->to($address);
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         }
122 122
 
123 123
         //Check if token is valid
124
-        if (! $this->passwordEncoder->isPasswordValid($user->getPwResetToken(), $token, null)) {
124
+        if (!$this->passwordEncoder->isPasswordValid($user->getPwResetToken(), $token, null)) {
125 125
             return false;
126 126
         }
127 127
 
Please login to merge, or discard this patch.
src/Services/EntityExporter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,13 +56,13 @@  discard block
 block discarded – undo
56 56
         $format = $request->get('format') ?? 'json';
57 57
 
58 58
         //Check if we have one of the supported formats
59
-        if (! \in_array($format, ['json', 'csv', 'yaml', 'xml'], true)) {
59
+        if (!\in_array($format, ['json', 'csv', 'yaml', 'xml'], true)) {
60 60
             throw new \InvalidArgumentException('Given format is not supported!');
61 61
         }
62 62
 
63 63
         //Check export verbosity level
64 64
         $level = $request->get('level') ?? 'extended';
65
-        if (! \in_array($level, ['simple', 'extended', 'full'], true)) {
65
+        if (!\in_array($level, ['simple', 'extended', 'full'], true)) {
66 66
             throw new \InvalidArgumentException('Given level is not supported!');
67 67
         }
68 68
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         $response->headers->set('Content-Type', $content_type);
109 109
 
110 110
         //If view option is not specified, then download the file.
111
-        if (! $request->get('view')) {
111
+        if (!$request->get('view')) {
112 112
             if ($entity instanceof NamedDBElement) {
113 113
                 $entity_name = $entity->getName();
114 114
             } elseif (\is_array($entity)) {
Please login to merge, or discard this patch.
src/Services/CustomEnvVarProcessor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
             try {
36 36
                 $env = $getEnv($name);
37 37
 
38
-                return ! empty($env) && 'null://null' !== $env;
38
+                return !empty($env) && 'null://null' !== $env;
39 39
             } catch (EnvNotFoundException $exception) {
40 40
                 return false;
41 41
             }
Please login to merge, or discard this patch.
src/Services/Attachments/AttachmentSubmitHandler.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         }
118 118
 
119 119
         //Ensure the given attachment class is known to mapping
120
-        if (! isset($this->folder_mapping[\get_class($attachment)])) {
120
+        if (!isset($this->folder_mapping[\get_class($attachment)])) {
121 121
             throw new \InvalidArgumentException('The given attachment class is not known! The passed class was: '.\get_class($attachment));
122 122
         }
123 123
         //Ensure the attachment has an assigned element
@@ -203,13 +203,13 @@  discard block
 block discarded – undo
203 203
 
204 204
         //Determine the old filepath
205 205
         $old_path = $this->pathResolver->placeholderToRealPath($attachment->getPath());
206
-        if (! file_exists($old_path)) {
206
+        if (!file_exists($old_path)) {
207 207
             return $attachment;
208 208
         }
209 209
 
210 210
         $filename = basename($old_path);
211 211
         //If the basename is not one of the new unique on, we have to save the old filename
212
-        if (! preg_match('/\w+-\w{13}\./', $filename)) {
212
+        if (!preg_match('/\w+-\w{13}\./', $filename)) {
213 213
             //Save filename to attachment field
214 214
             $attachment->setFilename($attachment->getFilename());
215 215
         }
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
     protected function downloadURL(Attachment $attachment, array $options): Attachment
240 240
     {
241 241
         //Check if we are allowed to download files
242
-        if (! $this->allow_attachments_downloads) {
242
+        if (!$this->allow_attachments_downloads) {
243 243
             throw new \RuntimeException('Download of attachments is not allowed!');
244 244
         }
245 245
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 
290 290
             //Check if we have a extension given
291 291
             $pathinfo = pathinfo($filename);
292
-            if (! empty($pathinfo['extension'])) {
292
+            if (!empty($pathinfo['extension'])) {
293 293
                 $new_ext = $pathinfo['extension'];
294 294
             } else { //Otherwise we have to guess the extension for the new file, based on its content
295 295
                 $new_ext = $this->mimeTypes->getExtensions($this->mimeTypes->guessMimeType($tmp_path))[0] ?? 'tmp';
Please login to merge, or discard this patch.
src/Services/Attachments/AttachmentPathResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@
 block discarded – undo
183 183
         }
184 184
 
185 185
         //If the new string does not begin with a placeholder, it is invalid
186
-        if (! preg_match('/^%\w+%/', $real_path)) {
186
+        if (!preg_match('/^%\w+%/', $real_path)) {
187 187
             return null;
188 188
         }
189 189
 
Please login to merge, or discard this patch.
src/Services/Attachments/AttachmentManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function attachmentToFile(Attachment $attachment): ?\SplFileInfo
54 54
     {
55
-        if ($attachment->isExternal() || ! $this->isFileExisting($attachment)) {
55
+        if ($attachment->isExternal() || !$this->isFileExisting($attachment)) {
56 56
             return null;
57 57
         }
58 58
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             return null;
121 121
         }
122 122
 
123
-        if (! $this->isFileExisting($attachment)) {
123
+        if (!$this->isFileExisting($attachment)) {
124 124
             return null;
125 125
         }
126 126
 
Please login to merge, or discard this patch.