@@ -128,7 +128,7 @@ |
||
128 | 128 | */ |
129 | 129 | public function getStyle(string $name): string |
130 | 130 | { |
131 | - if (!$this->hasStyle($name)) { |
|
131 | + if ( ! $this->hasStyle($name)) { |
|
132 | 132 | throw new InvalidArgumentException('Undefined style: '.$name); |
133 | 133 | } |
134 | 134 |
@@ -74,7 +74,7 @@ |
||
74 | 74 | * |
75 | 75 | * @return \Syscodes\Components\Console\Formatter\OutputFormatterStyle |
76 | 76 | */ |
77 | - public function push(OutputFormatterStyleInterface $style = null) |
|
77 | + public function push(OutputFormatterStyleInterface $style = null) |
|
78 | 78 | { |
79 | 79 | $this->styles[] = $style; |
80 | 80 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * Constructor. Create a new Interactor instance. |
50 | 50 | * |
51 | 51 | * @param \Syscodes\Components\Contracts\Console\Input\Input|null $input The input interface implemented |
52 | - * @param \Syscodes\Components\Contracts\Console\Output\Output|null $output The output interface implemented |
|
52 | + * @param \Syscodes\Components\Contracts\Console\Output\Output|null $output The output interface implemented |
|
53 | 53 | * |
54 | 54 | * @return void |
55 | 55 | */ |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | */ |
55 | 55 | protected static $defaultName; |
56 | 56 | |
57 | - /** |
|
58 | - * The default command description. |
|
59 | - * |
|
60 | - * @var string|null $defaultDescription |
|
61 | - */ |
|
57 | + /** |
|
58 | + * The default command description. |
|
59 | + * |
|
60 | + * @var string|null $defaultDescription |
|
61 | + */ |
|
62 | 62 | protected static $defaultDescription; |
63 | 63 | |
64 | 64 | /** |
@@ -436,9 +436,9 @@ discard block |
||
436 | 436 | */ |
437 | 437 | public function setApplication(Application $application = null): static |
438 | 438 | { |
439 | - $this->application = $application; |
|
439 | + $this->application = $application; |
|
440 | 440 | |
441 | - return $this; |
|
441 | + return $this; |
|
442 | 442 | } |
443 | 443 | |
444 | 444 | /** |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * |
83 | 83 | * @return bool |
84 | 84 | */ |
85 | - public function hasParameterOption(string|array $values, bool $params = false): bool |
|
85 | + public function hasParameterOption(string | array $values, bool $params = false): bool |
|
86 | 86 | { |
87 | 87 | foreach ($this->parameters as $key => $value) { |
88 | 88 | if ( ! is_int($key)) { |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * |
111 | 111 | * @return mixed |
112 | 112 | */ |
113 | - public function getParameterOption(string|array $values, mixed $default = false, bool $params = false): mixed |
|
113 | + public function getParameterOption(string | array $values, mixed $default = false, bool $params = false): mixed |
|
114 | 114 | { |
115 | 115 | foreach ($this->parameters as $key => $value) { |
116 | 116 | if ($params && ('--' === $key || (is_int($key) && '--' === $value))) { |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $len = strlen($name); |
137 | 137 | |
138 | 138 | for ($i = 0; $i < $len; $i++) { |
139 | - if (!$this->definition->hasShortcut($name[$i])) { |
|
139 | + if ( ! $this->definition->hasShortcut($name[$i])) { |
|
140 | 140 | throw new RuntimeException(sprintf('The "-%s" option does not exist', $name[$i])); |
141 | 141 | } |
142 | 142 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | * |
250 | 250 | * @return bool |
251 | 251 | */ |
252 | - public function hasParameterOption(string|array $values, bool $params = false): bool |
|
252 | + public function hasParameterOption(string | array $values, bool $params = false): bool |
|
253 | 253 | { |
254 | 254 | $tokens = $this->getTokens(); |
255 | 255 | |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | * |
279 | 279 | * @return mixed |
280 | 280 | */ |
281 | - public function getParameterOption(string|array $values, $default = false, bool $params = false): mixed |
|
281 | + public function getParameterOption(string | array $values, $default = false, bool $params = false): mixed |
|
282 | 282 | { |
283 | 283 | $tokens = $this->getTokens(); |
284 | 284 | |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | { |
325 | 325 | $self = $this; |
326 | 326 | |
327 | - $tokens = array_map(function ($token) use ($self) { |
|
327 | + $tokens = array_map(function($token) use ($self) { |
|
328 | 328 | if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { |
329 | 329 | return $match[1].$self->escapeToken($match[2]); |
330 | 330 | } |
@@ -268,7 +268,7 @@ |
||
268 | 268 | * |
269 | 269 | * @return string |
270 | 270 | */ |
271 | - private static function determinePrefix(Route $route,array $tokens): string |
|
271 | + private static function determinePrefix(Route $route, array $tokens): string |
|
272 | 272 | { |
273 | 273 | if ('text' !== $tokens[0][0]) { |
274 | 274 | return ($route->hasDefault($tokens[0][3]) || '/' === $tokens[0][1]) ? '' : $tokens[0][1]; |
@@ -34,61 +34,61 @@ discard block |
||
34 | 34 | */ |
35 | 35 | class Application extends BaseApplication |
36 | 36 | { |
37 | - /** |
|
38 | - * Application config data. |
|
39 | - * |
|
40 | - * @var array $config |
|
41 | - */ |
|
42 | - protected $config = [ |
|
43 | - 'homepage' => '', |
|
44 | - 'publishAt' => '02.05.2019', |
|
45 | - 'updateAt' => '13.09.2021', |
|
46 | - 'logoText' => '', |
|
47 | - 'logoStyle' => 'info', |
|
48 | - ]; |
|
49 | - |
|
50 | - /** |
|
51 | - * The event dispatcher instance. |
|
52 | - * |
|
53 | - * @var \Syscodes\Components\Contracts\Events\Dispatcher $events |
|
54 | - */ |
|
55 | - protected $events; |
|
56 | - |
|
57 | - /** |
|
58 | - * The Lenevor application instance. |
|
59 | - * |
|
60 | - * @var \Syscodes\Components\Contracts\Container|Container $lenevor |
|
61 | - */ |
|
62 | - protected $lenevor; |
|
63 | - |
|
64 | - /** |
|
65 | - * Console constructor. Initialize the console of Lenevor. |
|
66 | - * |
|
67 | - * @param \Syscodes\Components\Contracts\Core\Container $lenevor |
|
68 | - * |
|
69 | - * @param string $version |
|
70 | - * |
|
71 | - * @return void |
|
72 | - */ |
|
73 | - public function __construct(Container $lenevor, Dispatcher $events, string $version) |
|
74 | - { |
|
75 | - parent::__construct(Version::NAME, $version); |
|
76 | - |
|
77 | - $this->events = $events; |
|
78 | - $this->lenevor = $lenevor; |
|
79 | - } |
|
80 | - |
|
81 | - /** |
|
82 | - * Runs the current command discovered on the CLI. |
|
37 | + /** |
|
38 | + * Application config data. |
|
39 | + * |
|
40 | + * @var array $config |
|
41 | + */ |
|
42 | + protected $config = [ |
|
43 | + 'homepage' => '', |
|
44 | + 'publishAt' => '02.05.2019', |
|
45 | + 'updateAt' => '13.09.2021', |
|
46 | + 'logoText' => '', |
|
47 | + 'logoStyle' => 'info', |
|
48 | + ]; |
|
49 | + |
|
50 | + /** |
|
51 | + * The event dispatcher instance. |
|
52 | + * |
|
53 | + * @var \Syscodes\Components\Contracts\Events\Dispatcher $events |
|
54 | + */ |
|
55 | + protected $events; |
|
56 | + |
|
57 | + /** |
|
58 | + * The Lenevor application instance. |
|
59 | + * |
|
60 | + * @var \Syscodes\Components\Contracts\Container|Container $lenevor |
|
61 | + */ |
|
62 | + protected $lenevor; |
|
63 | + |
|
64 | + /** |
|
65 | + * Console constructor. Initialize the console of Lenevor. |
|
66 | + * |
|
67 | + * @param \Syscodes\Components\Contracts\Core\Container $lenevor |
|
68 | + * |
|
69 | + * @param string $version |
|
70 | + * |
|
71 | + * @return void |
|
72 | + */ |
|
73 | + public function __construct(Container $lenevor, Dispatcher $events, string $version) |
|
74 | + { |
|
75 | + parent::__construct(Version::NAME, $version); |
|
76 | + |
|
77 | + $this->events = $events; |
|
78 | + $this->lenevor = $lenevor; |
|
79 | + } |
|
80 | + |
|
81 | + /** |
|
82 | + * Runs the current command discovered on the CLI. |
|
83 | 83 | * |
84 | 84 | * @param \Syscodes\Components\Contracts\Console\Input\Input|null $input The input interface implemented |
85 | 85 | * @param \Syscodes\Components\Contracts\Console\Output\Output|null $output The output interface implemented |
86 | 86 | * |
87 | 87 | * @return int |
88 | - */ |
|
89 | - public function run(InputInterface $input = null, OutputInterface $output = null) |
|
90 | - { |
|
91 | - $this->setLogo(" __ |
|
88 | + */ |
|
89 | + public function run(InputInterface $input = null, OutputInterface $output = null) |
|
90 | + { |
|
91 | + $this->setLogo(" __ |
|
92 | 92 | / / ___ ____ ___ _ ______ _____ |
93 | 93 | / / / _ \/ __ \/ _ \ | / / __ \/ ___/ |
94 | 94 | / /___/ __/ / / / __/ |/ / /_/ / / |
@@ -101,25 +101,25 @@ discard block |
||
101 | 101 | /_/ /_/ |
102 | 102 | ", 'info'); |
103 | 103 | |
104 | - $exit = parent::run($input, $output); |
|
104 | + $exit = parent::run($input, $output); |
|
105 | 105 | |
106 | - return $exit; |
|
107 | - } |
|
106 | + return $exit; |
|
107 | + } |
|
108 | 108 | |
109 | - /** |
|
110 | - * Returns the version of the console. |
|
109 | + /** |
|
110 | + * Returns the version of the console. |
|
111 | 111 | * |
112 | 112 | * @return string |
113 | - */ |
|
114 | - public function getConsoleVersion(): string |
|
115 | - { |
|
116 | - return parent::getConsoleVersion(). |
|
117 | - sprintf(' (env: <comment>%s</>, debug: <comment>%s</>) [<note>%s</>]', |
|
118 | - env('APP_ENV'), env('APP_DEBUG') ? 'true' : 'false', PHP_OS |
|
119 | - ); |
|
120 | - } |
|
121 | - |
|
122 | - /** |
|
113 | + */ |
|
114 | + public function getConsoleVersion(): string |
|
115 | + { |
|
116 | + return parent::getConsoleVersion(). |
|
117 | + sprintf(' (env: <comment>%s</>, debug: <comment>%s</>) [<note>%s</>]', |
|
118 | + env('APP_ENV'), env('APP_DEBUG') ? 'true' : 'false', PHP_OS |
|
119 | + ); |
|
120 | + } |
|
121 | + |
|
122 | + /** |
|
123 | 123 | * Gets the logo text for console app. |
124 | 124 | * |
125 | 125 | * @return string|null |
@@ -168,13 +168,13 @@ discard block |
||
168 | 168 | $this->config['logoStyle'] = $style; |
169 | 169 | } |
170 | 170 | |
171 | - /** |
|
172 | - * Gets the Lenevor application instance. |
|
173 | - * |
|
174 | - * @return void |
|
175 | - */ |
|
176 | - public function getLenevor() |
|
177 | - { |
|
178 | - return $this->lenevor; |
|
179 | - } |
|
171 | + /** |
|
172 | + * Gets the Lenevor application instance. |
|
173 | + * |
|
174 | + * @return void |
|
175 | + */ |
|
176 | + public function getLenevor() |
|
177 | + { |
|
178 | + return $this->lenevor; |
|
179 | + } |
|
180 | 180 | } |
181 | 181 | \ No newline at end of file |
@@ -48,8 +48,8 @@ |
||
48 | 48 | |
49 | 49 | // Register the autoloader |
50 | 50 | if ( ! class_exists(Syscodes\Bundles\WebResourceBundle\Autoloader\Autoload::class, false)) { |
51 | - require_once SYS_PATH.'src/bundles/WebResourceBundle/Autoloader/AutoloadConfig.php'; |
|
52 | - require_once SYS_PATH.'src/bundles/WebResourceBundle/Autoloader/Autoload.php'; |
|
51 | + require_once SYS_PATH.'src/bundles/WebResourceBundle/Autoloader/AutoloadConfig.php'; |
|
52 | + require_once SYS_PATH.'src/bundles/WebResourceBundle/Autoloader/Autoload.php'; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | // Activate the framework class autoloader |
@@ -24,9 +24,15 @@ |
||
24 | 24 | */ |
25 | 25 | |
26 | 26 | // Define the absolute paths for configured directories |
27 | -if ( ! defined('APP_PATH')) define('APP_PATH', realpath($paths['path.app']).DIRECTORY_SEPARATOR); |
|
28 | -if ( ! defined('CON_PATH')) define('CON_PATH', realpath($paths['path.config']).DIRECTORY_SEPARATOR); |
|
29 | -if ( ! defined('SYS_PATH')) define('SYS_PATH', realpath($paths['path.sys']).DIRECTORY_SEPARATOR); |
|
27 | +if ( ! defined('APP_PATH')) { |
|
28 | + define('APP_PATH', realpath($paths['path.app']).DIRECTORY_SEPARATOR); |
|
29 | +} |
|
30 | +if ( ! defined('CON_PATH')) { |
|
31 | + define('CON_PATH', realpath($paths['path.config']).DIRECTORY_SEPARATOR); |
|
32 | +} |
|
33 | +if ( ! defined('SYS_PATH')) { |
|
34 | + define('SYS_PATH', realpath($paths['path.sys']).DIRECTORY_SEPARATOR); |
|
35 | +} |
|
30 | 36 | |
31 | 37 | // Call the file constants |
32 | 38 | require CON_PATH.'constants.php'; |