@@ -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 | } |
@@ -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 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $this->stdout('Generating autocomplete classes ... ', BaseConsole::FG_YELLOW); |
32 | 32 | /* @noinspection NullPointerExceptionInspection */ |
33 | 33 | Autocomplete::getInstance()->generateAutocompleteClasses(); |
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()->regenerateAutocompleteClasses(); |
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 | } |
@@ -112,11 +112,11 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function registerEventHandlers() |
114 | 114 | { |
115 | - Event::on(Plugins::class,Plugins::EVENT_AFTER_INSTALL_PLUGIN, [$this, 'regenerateAutocompleteClasses']); |
|
116 | - Event::on(Plugins::class,Plugins::EVENT_AFTER_UNINSTALL_PLUGIN, [$this, 'deleteAutocompleteClasses']); |
|
117 | - Event::on(Globals::class,Globals::EVENT_AFTER_SAVE_GLOBAL_SET, [$this, 'deleteAutocompleteClasses']); |
|
118 | - Event::on(Plugins::class,Plugins::EVENT_AFTER_LOAD_PLUGINS, [$this, 'generateAutocompleteClasses']); |
|
119 | - Craft::info('Event Handlers installed',__METHOD__); |
|
115 | + Event::on(Plugins::class, Plugins::EVENT_AFTER_INSTALL_PLUGIN, [$this, 'regenerateAutocompleteClasses']); |
|
116 | + Event::on(Plugins::class, Plugins::EVENT_AFTER_UNINSTALL_PLUGIN, [$this, 'deleteAutocompleteClasses']); |
|
117 | + Event::on(Globals::class, Globals::EVENT_AFTER_SAVE_GLOBAL_SET, [$this, 'deleteAutocompleteClasses']); |
|
118 | + Event::on(Plugins::class, Plugins::EVENT_AFTER_LOAD_PLUGINS, [$this, 'generateAutocompleteClasses']); |
|
119 | + Craft::info('Event Handlers installed', __METHOD__); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -125,11 +125,11 @@ discard block |
||
125 | 125 | public function generateAutocompleteClasses() |
126 | 126 | { |
127 | 127 | $autocompleteGenerators = $this->getAllAutocompleteGenerators(); |
128 | - foreach($autocompleteGenerators as $generatorClass) { |
|
128 | + foreach ($autocompleteGenerators as $generatorClass) { |
|
129 | 129 | /* @var Generator $generatorClass */ |
130 | 130 | $generatorClass::generate(); |
131 | 131 | } |
132 | - Craft::info('Autocomplete classes generated',__METHOD__); |
|
132 | + Craft::info('Autocomplete classes generated', __METHOD__); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -138,11 +138,11 @@ discard block |
||
138 | 138 | public function regenerateAutocompleteClasses() |
139 | 139 | { |
140 | 140 | $autocompleteGenerators = $this->getAllAutocompleteGenerators(); |
141 | - foreach($autocompleteGenerators as $generatorClass) { |
|
141 | + foreach ($autocompleteGenerators as $generatorClass) { |
|
142 | 142 | /* @var Generator $generatorClass */ |
143 | 143 | $generatorClass::regenerate(); |
144 | 144 | } |
145 | - Craft::info('Autocomplete classes regenerated',__METHOD__); |
|
145 | + Craft::info('Autocomplete classes regenerated', __METHOD__); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
@@ -151,11 +151,11 @@ discard block |
||
151 | 151 | public function deleteAutocompleteClasses() |
152 | 152 | { |
153 | 153 | $autocompleteGenerators = $this->getAllAutocompleteGenerators(); |
154 | - foreach($autocompleteGenerators as $generatorClass) { |
|
154 | + foreach ($autocompleteGenerators as $generatorClass) { |
|
155 | 155 | /* @var Generator $generatorClass */ |
156 | 156 | $generatorClass::delete(); |
157 | 157 | } |
158 | - Craft::info('Autocomplete classes deleted',__METHOD__); |
|
158 | + Craft::info('Autocomplete classes deleted', __METHOD__); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | // Protected Methods |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $type = gettype($value); |
82 | 82 | switch ($type) { |
83 | 83 | case 'object': |
84 | - $values[$key] = 'new \\' . get_class($value) . '()'; |
|
84 | + $values[$key] = 'new \\'.get_class($value).'()'; |
|
85 | 85 | break; |
86 | 86 | |
87 | 87 | case 'boolean': |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | break; |
95 | 95 | |
96 | 96 | case 'string': |
97 | - $values[$key] = "'" . addslashes($value) . "'"; |
|
97 | + $values[$key] = "'".addslashes($value)."'"; |
|
98 | 98 | break; |
99 | 99 | |
100 | 100 | case 'array': |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | // Format the line output for each value |
126 | 126 | foreach ($values as $key => $value) { |
127 | - $values[$key] = " '" . $key . "' => " . $value . ","; |
|
127 | + $values[$key] = " '".$key."' => ".$value.","; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | // Save the template with variable substitution |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | /* @var Element $elementType */ |
147 | 147 | $key = $elementType::refHandle(); |
148 | 148 | if (!empty($key) && !in_array($key, static::ELEMENT_ROUTE_EXCLUDES, true)) { |
149 | - $routeVariables[$key] = 'new \\' . $elementType . '()'; |
|
149 | + $routeVariables[$key] = 'new \\'.$elementType.'()'; |
|
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $globalVariables = []; |
165 | 165 | $globalsExtension = new GlobalsExtension(); |
166 | 166 | foreach ($globalsExtension->getGlobals() as $key => $value) { |
167 | - $globalVariables[$key] = 'new \\' . get_class($value) . '()'; |
|
167 | + $globalVariables[$key] = 'new \\'.get_class($value).'()'; |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | return $globalVariables; |