Passed
Push — v1 ( 82f5a4...170edf )
by Andrew
19:12 queued 13s
created
src/autocompletes/TwigLanguageAutocomplete.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
         $filters = array_keys($twig->getFilters());
281 281
         foreach ($filters as $filter) {
282 282
             $docs = self::FILTER_DOCS[$filter] ?? '';
283
-            $docs = str_replace('(#', '(' . self::CRAFT_FILTER_DOCS_URL . '#', $docs);
283
+            $docs = str_replace('(#', '('.self::CRAFT_FILTER_DOCS_URL.'#', $docs);
284 284
             CompleteItem::create()
285 285
                 ->label($filter)
286 286
                 ->insertText($filter)
@@ -292,9 +292,9 @@  discard block
 block discarded – undo
292 292
         // Twig Functions
293 293
         $functions = array_keys($twig->getFunctions());
294 294
         foreach ($functions as $function) {
295
-            $functionLabel = $function . '()';
295
+            $functionLabel = $function.'()';
296 296
             $docs = self::FUNCTION_DOCS[$function] ?? '';
297
-            $docs = str_replace('(#', '(' . self::CRAFT_FUNCTION_DOCS_URL . '#', $docs);
297
+            $docs = str_replace('(#', '('.self::CRAFT_FUNCTION_DOCS_URL.'#', $docs);
298 298
             CompleteItem::create()
299 299
                 ->label($functionLabel)
300 300
                 ->insertText($functionLabel)
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
         $tags = array_merge(self::ADDITIONAL_TAGS, array_keys($twig->getTokenParsers()));
308 308
         foreach ($tags as $tag) {
309 309
             $docs = self::TAG_DOCS[$tag] ?? '';
310
-            $docs = str_replace('(#', '(' . self::CRAFT_TAG_DOCS_URL . '#', $docs);
310
+            $docs = str_replace('(#', '('.self::CRAFT_TAG_DOCS_URL.'#', $docs);
311 311
             CompleteItem::create()
312 312
                 ->label($tag)
313 313
                 ->insertText($tag)
Please login to merge, or discard this patch.
src/autocompletes/EnvironmentVariableAutocomplete.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
                     ->filterText($trimmedName)
63 63
                     ->detail($item['hint'])
64 64
                     ->kind(CompleteItemKind::ConstantKind)
65
-                    ->sortText('~' . $name)
65
+                    ->sortText('~'.$name)
66 66
                     ->add($this);
67 67
             }
68 68
         }
Please login to merge, or discard this patch.
src/autocompletes/CraftApiAutocomplete.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -120,10 +120,10 @@
 block discarded – undo
120 120
                             $value = json_encode(array_keys($value));
121 121
                         }
122 122
                         CompleteItem::create()
123
-                            ->detail((string)$value)
123
+                            ->detail((string) $value)
124 124
                             ->kind($kind)
125
-                            ->label((string)$key)
126
-                            ->insertText((string)$key)
125
+                            ->label((string) $key)
126
+                            ->insertText((string) $key)
127 127
                             ->add($this, $path);
128 128
                         break;
129 129
                 }
Please login to merge, or discard this patch.
src/helpers/Config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
         $fileName .= self::PHP_SUFFIX;
42 42
         $currentEnv = Craft::$app->getConfig()->env;
43 43
         // Try craft/config first
44
-        $path = Craft::getAlias('@config/' . $fileName, false);
44
+        $path = Craft::getAlias('@config/'.$fileName, false);
45 45
         if ($path === false || !file_exists($path)) {
46 46
             // Now try our own internal config
47 47
             $path = Craft::getAlias('@nystudio107/codeeditor/config.php', false);
Please login to merge, or discard this patch.
ecs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 
6 6
 return static function(ECSConfig $ecsConfig): void {
7 7
     $ecsConfig->paths([
8
-        __DIR__ . '/src',
8
+        __DIR__.'/src',
9 9
         __FILE__,
10 10
     ]);
11 11
     $ecsConfig->parallel();
Please login to merge, or discard this patch.
src/services/AutocompleteService.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
             $dependency = new TagDependency([
137 137
                 'tags' => [
138 138
                     self::AUTOCOMPLETE_CACHE_TAG,
139
-                    self::AUTOCOMPLETE_CACHE_TAG . $name,
140
-                    self::AUTOCOMPLETE_CACHE_TAG . get_class($autocomplete),
139
+                    self::AUTOCOMPLETE_CACHE_TAG.$name,
140
+                    self::AUTOCOMPLETE_CACHE_TAG.get_class($autocomplete),
141 141
                 ],
142 142
             ]);
143 143
             // Get the autocompletes from the cache, or generate them if they aren't cached
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
     public function clearAutocompleteCache(string $autocompleteName = ''): void
166 166
     {
167 167
         $cache = Craft::$app->getCache();
168
-        TagDependency::invalidate($cache, self::AUTOCOMPLETE_CACHE_TAG . $autocompleteName);
168
+        TagDependency::invalidate($cache, self::AUTOCOMPLETE_CACHE_TAG.$autocompleteName);
169 169
         Craft::info('CodeEditor caches invalidated', __METHOD__);
170 170
     }
171 171
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
      */
179 179
     public function getAutocompleteCacheKey(Autocomplete $autocomplete, array $config): string
180 180
     {
181
-        return $this->cacheKeyPrefix . $autocomplete->name . md5(serialize($config));
181
+        return $this->cacheKeyPrefix.$autocomplete->name.md5(serialize($config));
182 182
     }
183 183
 
184 184
     // Protected Methods
Please login to merge, or discard this patch.
src/CodeEditor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         // Translation category
102 102
         $i18n = Craft::$app->getI18n();
103 103
         /** @noinspection UnSafeIsSetOverArrayInspection */
104
-        if (!isset($i18n->translations[$this->id]) && !isset($i18n->translations[$this->id . '*'])) {
104
+        if (!isset($i18n->translations[$this->id]) && !isset($i18n->translations[$this->id.'*'])) {
105 105
             $i18n->translations[$this->id] = [
106 106
                 'class' => PhpMessageSource::class,
107 107
                 'sourceLanguage' => 'en-US',
@@ -136,14 +136,14 @@  discard block
 block discarded – undo
136 136
     {
137 137
         // Base CP templates directory
138 138
         Event::on(View::class, View::EVENT_REGISTER_CP_TEMPLATE_ROOTS, function(RegisterTemplateRootsEvent $e) {
139
-            if (is_dir($baseDir = $this->getBasePath() . DIRECTORY_SEPARATOR . 'templates')) {
139
+            if (is_dir($baseDir = $this->getBasePath().DIRECTORY_SEPARATOR.'templates')) {
140 140
                 $e->roots[$this->id] = $baseDir;
141 141
             }
142 142
         });
143 143
         // Base Site templates directory
144 144
         if (self::$settings->allowTemplateAccess) {
145 145
             Event::on(View::class, View::EVENT_REGISTER_SITE_TEMPLATE_ROOTS, function(RegisterTemplateRootsEvent $e) {
146
-                if (is_dir($baseDir = $this->getBasePath() . DIRECTORY_SEPARATOR . 'templates')) {
146
+                if (is_dir($baseDir = $this->getBasePath().DIRECTORY_SEPARATOR.'templates')) {
147 147
                     $e->roots[$this->id] = $baseDir;
148 148
                 }
149 149
             });
Please login to merge, or discard this patch.
src/base/ObjectParserAutocomplete.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -157,11 +157,11 @@  discard block
 block discarded – undo
157 157
         $className = $reflectionClass->getName();
158 158
         $docs = $this->getDocs($reflectionClass, $factory);
159 159
         CompleteItem::create()
160
-            ->detail((string)$className)
161
-            ->documentation((string)$docs)
160
+            ->detail((string) $className)
161
+            ->documentation((string) $docs)
162 162
             ->kind(CompleteItemKind::ClassKind)
163
-            ->label((string)$name)
164
-            ->insertText((string)$name)
163
+            ->label((string) $name)
164
+            ->insertText((string) $name)
165 165
             ->add($this, $path);
166 166
     }
167 167
 
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
             // Exclude some properties
212 212
             $propertyAllowed = true;
213 213
             foreach (self::EXCLUDED_PROPERTY_REGEXES as $excludePattern) {
214
-                $pattern = '`' . $excludePattern . '`i';
214
+                $pattern = '`'.$excludePattern.'`i';
215 215
                 if (preg_match($pattern, $propertyName) === 1) {
216 216
                     $propertyAllowed = false;
217 217
                 }
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
                                 $value = '';
269 269
                             }
270 270
                             if (!empty($value)) {
271
-                                $detail = (string)$value;
271
+                                $detail = (string) $value;
272 272
                             }
273 273
                         }
274 274
                     }
@@ -276,12 +276,12 @@  discard block
 block discarded – undo
276 276
                 $thisPath = trim(implode('.', [$path, $propertyName]), '.');
277 277
                 $label = $propertyName;
278 278
                 CompleteItem::create()
279
-                    ->detail((string)$detail)
280
-                    ->documentation((string)$docs)
279
+                    ->detail((string) $detail)
280
+                    ->documentation((string) $docs)
281 281
                     ->kind($customField ? CompleteItemKind::FieldKind : CompleteItemKind::PropertyKind)
282
-                    ->label((string)$label)
283
-                    ->insertText((string)$label)
284
-                    ->sortText((string)$sortPrefix . (string)$label)
282
+                    ->label((string) $label)
283
+                    ->insertText((string) $label)
284
+                    ->sortText((string) $sortPrefix.(string) $label)
285 285
                     ->add($this, $thisPath);
286 286
                 // Recurse through if this is an object
287 287
                 if (isset($object->$propertyName) && is_object($object->$propertyName)) {
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
             // Exclude some properties
316 316
             $methodAllowed = true;
317 317
             foreach (self::EXCLUDED_METHOD_REGEXES as $excludePattern) {
318
-                $pattern = '`' . $excludePattern . '`i';
318
+                $pattern = '`'.$excludePattern.'`i';
319 319
                 if (preg_match($pattern, $methodName) === 1) {
320 320
                     $methodAllowed = false;
321 321
                 }
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
                 if (!empty($docs)) {
328 328
                     $docblock = $factory->create($docs);
329 329
                 }
330
-                $detail = $methodName . '(';
330
+                $detail = $methodName.'(';
331 331
                 $params = $reflectionMethod->getParameters();
332 332
                 $paramList = [];
333 333
                 foreach ($params as $param) {
@@ -337,20 +337,20 @@  discard block
 block discarded – undo
337 337
                             $unionTypes = $reflectionType->getTypes();
338 338
                             $typeName = '';
339 339
                             foreach ($unionTypes as $unionType) {
340
-                                $typeName .= '|' . $unionType->getName();
340
+                                $typeName .= '|'.$unionType->getName();
341 341
                             }
342 342
                             $typeName = trim($typeName, '|');
343
-                            $paramList[] = $typeName . ': ' . '$' . $param->getName();
343
+                            $paramList[] = $typeName.': '.'$'.$param->getName();
344 344
                         } elseif ($param->getType() instanceof ReflectionNamedType) {
345
-                            $paramList[] = $param->getType()->getName() . ': ' . '$' . $param->getName();
345
+                            $paramList[] = $param->getType()->getName().': '.'$'.$param->getName();
346 346
                         }
347 347
                     } else {
348
-                        $paramList[] = '$' . $param->getName();
348
+                        $paramList[] = '$'.$param->getName();
349 349
                     }
350 350
                 }
351
-                $detail .= implode(', ', $paramList) . ')';
351
+                $detail .= implode(', ', $paramList).')';
352 352
                 $thisPath = trim(implode('.', [$path, $methodName]), '.');
353
-                $label = $methodName . '()';
353
+                $label = $methodName.'()';
354 354
                 $docsPreamble = '';
355 355
                 // Figure out the type
356 356
                 if ($docblock) {
@@ -358,18 +358,18 @@  discard block
 block discarded – undo
358 358
                     if ($tags) {
359 359
                         $docsPreamble = "Parameters:\n\n";
360 360
                         foreach ($tags as $tag) {
361
-                            $docsPreamble .= $tag . "\n";
361
+                            $docsPreamble .= $tag."\n";
362 362
                         }
363 363
                         $docsPreamble .= "\n";
364 364
                     }
365 365
                 }
366 366
                 CompleteItem::create()
367
-                    ->detail((string)$detail)
368
-                    ->documentation((string)$docsPreamble . (string)$docs)
367
+                    ->detail((string) $detail)
368
+                    ->documentation((string) $docsPreamble.(string) $docs)
369 369
                     ->kind(CompleteItemKind::MethodKind)
370
-                    ->label((string)$label)
371
-                    ->insertText((string)$label)
372
-                    ->sortText($this->methodSortPrefix . (string)$label)
370
+                    ->label((string) $label)
371
+                    ->insertText((string) $label)
372
+                    ->sortText($this->methodSortPrefix.(string) $label)
373 373
                     ->add($this, $thisPath);
374 374
             }
375 375
         }
Please login to merge, or discard this patch.