| @@ -74,12 +74,12 @@ | ||
| 74 | 74 | } | 
| 75 | 75 | |
| 76 | 76 |          $user = getenv('USER'); | 
| 77 | -        if (! empty($user)) { | |
| 77 | +        if (!empty($user)) { | |
| 78 | 78 | return $user; | 
| 79 | 79 | } | 
| 80 | 80 | |
| 81 | 81 |          $user = getenv('USERNAME'); | 
| 82 | -        if (! empty($user)) { | |
| 82 | +        if (!empty($user)) { | |
| 83 | 83 | return $user; | 
| 84 | 84 | } | 
| 85 | 85 | |
| @@ -44,7 +44,7 @@ discard block | ||
| 44 | 44 | |
| 45 | 45 | //create the dir for exception classes if not already exists | 
| 46 | 46 | $path .= '/'; | 
| 47 | -        if (! is_dir($path)) { | |
| 47 | +        if (!is_dir($path)) { | |
| 48 | 48 | mkdir($path); | 
| 49 | 49 | } | 
| 50 | 50 | |
| @@ -92,7 +92,7 @@ discard block | ||
| 92 | 92 | $fileExists = is_file($fileName); | 
| 93 | 93 | |
| 94 | 94 | // if user has set overwrite argument or file doesnt already exists return early | 
| 95 | -        if ($this->overwrite || ! $fileExists) { | |
| 95 | +        if ($this->overwrite || !$fileExists) { | |
| 96 | 96 | return true; | 
| 97 | 97 | } | 
| 98 | 98 | // if user has chosen to skip overwriting all existing files, then return early | 
| @@ -85,7 +85,7 @@ discard block | ||
| 85 | 85 | $loopedPaths[] = basename($path); | 
| 86 | 86 | $path = dirname($path) !== 'vfs:' ? dirname($path) : 'vfs://'; | 
| 87 | 87 | //break early cuz DirectoryIterator can't handle vfs root folder | 
| 88 | - } while ((0 === count($directory) || ! $breakEvent->isPropagationStopped()) && $path !== 'vfs://'); | |
| 88 | + } while ((0 === count($directory) || !$breakEvent->isPropagationStopped()) && $path !== 'vfs://'); | |
| 89 | 89 | |
| 90 | 90 | return $namespace; | 
| 91 | 91 | } | 
| @@ -100,7 +100,7 @@ discard block | ||
| 100 | 100 | $directory = new DirectoryIterator($path); | 
| 101 | 101 | $items = []; | 
| 102 | 102 |          foreach ($directory as $item) { | 
| 103 | -            if (! $item->isDot()) { | |
| 103 | +            if (!$item->isDot()) { | |
| 104 | 104 | $items[] = clone $item; | 
| 105 | 105 | } | 
| 106 | 106 | } | 
| @@ -34,7 +34,7 @@ discard block | ||
| 34 | 34 | |
| 35 | 35 | public function resolve(string $path, array $loopedDirectories): string|bool | 
| 36 | 36 |      { | 
| 37 | -        if (! is_readable($path)) { | |
| 37 | +        if (!is_readable($path)) { | |
| 38 | 38 |              throw new RuntimeException('PHP file "' . $path . '" isn\'t readable'); | 
| 39 | 39 | } | 
| 40 | 40 | |
| @@ -68,7 +68,7 @@ discard block | ||
| 68 | 68 | |
| 69 | 69 |              if ($lookForToken && $validToken) { | 
| 70 | 70 | $namespace .= $token[1]; | 
| 71 | -            } elseif ($lookForToken && ! $validToken) { | |
| 71 | +            } elseif ($lookForToken && !$validToken) { | |
| 72 | 72 | $namespace = false; | 
| 73 | 73 | break; | 
| 74 | 74 | } | 
| @@ -42,12 +42,12 @@ discard block | ||
| 42 | 42 | */ | 
| 43 | 43 | public function match(string $templateName): bool|string | 
| 44 | 44 |      { | 
| 45 | -        if (! is_readable($this->configPath)) { | |
| 45 | +        if (!is_readable($this->configPath)) { | |
| 46 | 46 | return false; | 
| 47 | 47 | } | 
| 48 | 48 | |
| 49 | 49 | $jsonData = json_decode(file_get_contents($this->configPath), true); | 
| 50 | -        if (json_last_error() !== JSON_ERROR_NONE || ! is_array($jsonData)) { | |
| 50 | +        if (json_last_error() !== JSON_ERROR_NONE || !is_array($jsonData)) { | |
| 51 | 51 |              throw new RuntimeException("Could not parse json configuration \"$this->configPath\"."); | 
| 52 | 52 | } | 
| 53 | 53 | |
| @@ -59,7 +59,7 @@ discard block | ||
| 59 | 59 | */ | 
| 60 | 60 | protected function getPaths(array $configData, string $templateName): bool|string | 
| 61 | 61 |      { | 
| 62 | -        if (! isset($configData['templatepath']) || ! is_array($configData['templatepath'])) { | |
| 62 | +        if (!isset($configData['templatepath']) || !is_array($configData['templatepath'])) { | |
| 63 | 63 | return false; | 
| 64 | 64 | } | 
| 65 | 65 | |
| @@ -104,7 +104,7 @@ discard block | ||
| 104 | 104 | */ | 
| 105 | 105 | protected function getMostRelatedPath(array $filteredProjects, string $templateName): bool|string | 
| 106 | 106 |      { | 
| 107 | -        uksort($filteredProjects, function ($a, $b) { | |
| 107 | +        uksort($filteredProjects, function($a, $b) { | |
| 108 | 108 | $strlenA = strlen($a); | 
| 109 | 109 | $strlenB = strlen($b); | 
| 110 | 110 | |
| @@ -79,7 +79,7 @@ discard block | ||
| 79 | 79 | $path = dirname($path) !== static::VFSSTREAM_PREFIX ? dirname($path) : static::VFSSTREAM_URL; | 
| 80 | 80 | $loopedPaths[] = basename($path); | 
| 81 | 81 | //break early cuz DirectoryIterator can't handle vfs root folder | 
| 82 | - } while ((0 === count($directory) || ! $breakEvent->isPropagationStopped()) && $path !== static::VFSSTREAM_URL); | |
| 82 | + } while ((0 === count($directory) || !$breakEvent->isPropagationStopped()) && $path !== static::VFSSTREAM_URL); | |
| 83 | 83 | |
| 84 | 84 | return $exceptionDirArray; | 
| 85 | 85 | } | 
| @@ -94,7 +94,7 @@ discard block | ||
| 94 | 94 | $directory = new DirectoryIterator($path); | 
| 95 | 95 | $items = []; | 
| 96 | 96 |          foreach ($directory as $item) { | 
| 97 | -            if (! $item->isDot()) { | |
| 97 | +            if (!$item->isDot()) { | |
| 98 | 98 | $items[] = clone $item; | 
| 99 | 99 | } | 
| 100 | 100 | } |