| @@ -25,7 +25,7 @@ | ||
| 25 | 25 | |
| 26 | 26 | const TEMPLATE_EXTENSION = '.php'; | 
| 27 | 27 | const STUBS_EXTENSION = '.php.stub'; | 
| 28 | - const STUBS_DIR = DIRECTORY_SEPARATOR . 'stubs'; | |
| 28 | + const STUBS_DIR = DIRECTORY_SEPARATOR.'stubs'; | |
| 29 | 29 | |
| 30 | 30 | // Public Static Methods | 
| 31 | 31 | // ========================================================================= | 
| @@ -44,7 +44,7 @@ discard block | ||
| 44 | 44 | */ | 
| 45 | 45 | public static function getGeneratorStubsPath(): string | 
| 46 | 46 |      { | 
| 47 | - return Autocomplete::getInstance()->basePath . self::STUBS_DIR; | |
| 47 | + return Autocomplete::getInstance()->basePath.self::STUBS_DIR; | |
| 48 | 48 | } | 
| 49 | 49 | |
| 50 | 50 | /** | 
| @@ -101,7 +101,7 @@ discard block | ||
| 101 | 101 | */ | 
| 102 | 102 | protected static function getGeneratedFilePath(): string | 
| 103 | 103 |      { | 
| 104 | - return Craft::$app->getPath()->getCompiledClassesPath() . DIRECTORY_SEPARATOR . static::getGeneratorName() . self::TEMPLATE_EXTENSION; | |
| 104 | + return Craft::$app->getPath()->getCompiledClassesPath().DIRECTORY_SEPARATOR.static::getGeneratorName().self::TEMPLATE_EXTENSION; | |
| 105 | 105 | } | 
| 106 | 106 | |
| 107 | 107 | /** | 
| @@ -111,7 +111,7 @@ discard block | ||
| 111 | 111 | */ | 
| 112 | 112 | protected static function getStubFilePath(): string | 
| 113 | 113 |      { | 
| 114 | - return static::getGeneratorStubsPath() . DIRECTORY_SEPARATOR . static::getGeneratorName() . self::STUBS_EXTENSION; | |
| 114 | + return static::getGeneratorStubsPath().DIRECTORY_SEPARATOR.static::getGeneratorName().self::STUBS_EXTENSION; | |
| 115 | 115 | } | 
| 116 | 116 | |
| 117 | 117 | } | 
| @@ -31,7 +31,7 @@ discard block | ||
| 31 | 31 |          $this->stdout('Generating autocomplete classes ... ', BaseConsole::FG_YELLOW); | 
| 32 | 32 | /* @noinspection NullPointerExceptionInspection */ | 
| 33 | 33 | Autocomplete::getInstance()->generateAutocompleteTemplates(); | 
| 34 | -        $this->stdout('done' . PHP_EOL, BaseConsole::FG_GREEN); | |
| 34 | +        $this->stdout('done'.PHP_EOL, BaseConsole::FG_GREEN); | |
| 35 | 35 | |
| 36 | 36 | return ExitCode::OK; | 
| 37 | 37 | } | 
| @@ -44,7 +44,7 @@ discard block | ||
| 44 | 44 |          $this->stdout('Regenerating autocomplete classes ... ', BaseConsole::FG_YELLOW); | 
| 45 | 45 | /* @noinspection NullPointerExceptionInspection */ | 
| 46 | 46 | Autocomplete::getInstance()->regenerateAutocompleteTemplates(); | 
| 47 | -        $this->stdout('done' . PHP_EOL, BaseConsole::FG_GREEN); | |
| 47 | +        $this->stdout('done'.PHP_EOL, BaseConsole::FG_GREEN); | |
| 48 | 48 | |
| 49 | 49 | return ExitCode::OK; | 
| 50 | 50 | } | 
| @@ -79,7 +79,7 @@ | ||
| 79 | 79 | |
| 80 | 80 | // Format the line output for each value | 
| 81 | 81 |          foreach ($values as $key => $value) { | 
| 82 | - $values[$key] = ' * @property \\' . $value . ' $' . $key; | |
| 82 | + $values[$key] = ' * @property \\'.$value.' $'.$key; | |
| 83 | 83 | } | 
| 84 | 84 | |
| 85 | 85 | // Save the template with variable substitution | 
| @@ -76,7 +76,7 @@ discard block | ||
| 76 | 76 | $type = gettype($value); | 
| 77 | 77 |              switch ($type) { | 
| 78 | 78 | case 'object': | 
| 79 | - $values[$key] = 'new \\' . get_class($value) . '()'; | |
| 79 | + $values[$key] = 'new \\'.get_class($value).'()'; | |
| 80 | 80 | break; | 
| 81 | 81 | |
| 82 | 82 | case 'boolean': | 
| @@ -89,7 +89,7 @@ discard block | ||
| 89 | 89 | break; | 
| 90 | 90 | |
| 91 | 91 | case 'string': | 
| 92 | - $values[$key] = "'" . addslashes($value) . "'"; | |
| 92 | + $values[$key] = "'".addslashes($value)."'"; | |
| 93 | 93 | break; | 
| 94 | 94 | |
| 95 | 95 | case 'array': | 
| @@ -108,7 +108,7 @@ discard block | ||
| 108 | 108 | static::setCachedValues($values); | 
| 109 | 109 | // Format the line output for each value | 
| 110 | 110 |          foreach ($values as $key => $value) { | 
| 111 | - $values[$key] = " '" . $key . "' => " . $value . ","; | |
| 111 | + $values[$key] = " '".$key."' => ".$value.","; | |
| 112 | 112 | } | 
| 113 | 113 | |
| 114 | 114 | // Save the template with variable substitution | 
| @@ -157,7 +157,7 @@ discard block | ||
| 157 | 157 | */ | 
| 158 | 158 | private static function getCacheKey(): string | 
| 159 | 159 |      { | 
| 160 | - return static::getGeneratorName() . static::CACHE_KEY; | |
| 160 | + return static::getGeneratorName().static::CACHE_KEY; | |
| 161 | 161 | } | 
| 162 | 162 | |
| 163 | 163 | /** | 
| @@ -111,10 +111,10 @@ discard block | ||
| 111 | 111 | */ | 
| 112 | 112 | public function registerEventHandlers() | 
| 113 | 113 |      { | 
| 114 | - Event::on(Plugins::class,Plugins::EVENT_AFTER_INSTALL_PLUGIN, [$this, 'regenerateAutocompleteTemplates']); | |
| 115 | - Event::on(Plugins::class,Plugins::EVENT_AFTER_UNINSTALL_PLUGIN, [$this, 'regenerateAutocompleteTemplates']); | |
| 116 | - Event::on(Plugins::class,Plugins::EVENT_AFTER_LOAD_PLUGINS, [$this, 'generateAutocompleteTemplates']); | |
| 117 | -        Craft::info('Event Handlers installed',__METHOD__); | |
| 114 | + Event::on(Plugins::class, Plugins::EVENT_AFTER_INSTALL_PLUGIN, [$this, 'regenerateAutocompleteTemplates']); | |
| 115 | + Event::on(Plugins::class, Plugins::EVENT_AFTER_UNINSTALL_PLUGIN, [$this, 'regenerateAutocompleteTemplates']); | |
| 116 | + Event::on(Plugins::class, Plugins::EVENT_AFTER_LOAD_PLUGINS, [$this, 'generateAutocompleteTemplates']); | |
| 117 | +        Craft::info('Event Handlers installed', __METHOD__); | |
| 118 | 118 | } | 
| 119 | 119 | |
| 120 | 120 | /** | 
| @@ -123,11 +123,11 @@ discard block | ||
| 123 | 123 | public function generateAutocompleteTemplates() | 
| 124 | 124 |      { | 
| 125 | 125 | $autocompleteGenerators = $this->getAllAutocompleteGenerators(); | 
| 126 | -        foreach($autocompleteGenerators as $generatorClass) { | |
| 126 | +        foreach ($autocompleteGenerators as $generatorClass) { | |
| 127 | 127 | /* @var Generator $generatorClass */ | 
| 128 | 128 | $generatorClass::generate(); | 
| 129 | 129 | } | 
| 130 | -        Craft::info('Autocomplete templates generated',__METHOD__); | |
| 130 | +        Craft::info('Autocomplete templates generated', __METHOD__); | |
| 131 | 131 | } | 
| 132 | 132 | |
| 133 | 133 | /** | 
| @@ -136,11 +136,11 @@ discard block | ||
| 136 | 136 | public function regenerateAutocompleteTemplates() | 
| 137 | 137 |      { | 
| 138 | 138 | $autocompleteGenerators = $this->getAllAutocompleteGenerators(); | 
| 139 | -        foreach($autocompleteGenerators as $generatorClass) { | |
| 139 | +        foreach ($autocompleteGenerators as $generatorClass) { | |
| 140 | 140 | /* @var Generator $generatorClass */ | 
| 141 | 141 | $generatorClass::regenerate(); | 
| 142 | 142 | } | 
| 143 | -        Craft::info('Autocomplete templates regenerated',__METHOD__); | |
| 143 | +        Craft::info('Autocomplete templates regenerated', __METHOD__); | |
| 144 | 144 | } | 
| 145 | 145 | |
| 146 | 146 | // Protected Methods |