@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | use AttachDaftFramework; |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | - * @return BaseCommand|null |
|
| 23 | - */ |
|
| 22 | + * @return BaseCommand|null |
|
| 23 | + */ |
|
| 24 | 24 | public function add(BaseCommand $command) |
| 25 | 25 | { |
| 26 | 26 | return $this->addStrict($command); |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | - * @psalm-param class-string ...$sources |
|
| 71 | - */ |
|
| 70 | + * @psalm-param class-string ...$sources |
|
| 71 | + */ |
|
| 72 | 72 | public function CollectCommands(string ...$sources) : void |
| 73 | 73 | { |
| 74 | 74 | $framework = $this->GetDaftFramework(); |
@@ -80,15 +80,15 @@ discard block |
||
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | - * @var iterable<scalar|array|object|null> |
|
| 84 | - */ |
|
| 83 | + * @var iterable<scalar|array|object|null> |
|
| 84 | + */ |
|
| 85 | 85 | $implementations = $this->GetCommandCollector()->Collect(...$sources); |
| 86 | 86 | |
| 87 | 87 | foreach ($implementations as $implementation) { |
| 88 | 88 | if (is_string($implementation) && is_a($implementation, BaseCommand::class, true)) { |
| 89 | 89 | /** |
| 90 | - * @var BaseCommand |
|
| 91 | - */ |
|
| 90 | + * @var BaseCommand |
|
| 91 | + */ |
|
| 92 | 92 | $command = new $implementation($implementation::getDefaultName()); |
| 93 | 93 | |
| 94 | 94 | $this->add($command); |
@@ -97,8 +97,8 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
| 100 | - * @return static |
|
| 101 | - */ |
|
| 100 | + * @return static |
|
| 101 | + */ |
|
| 102 | 102 | public static function CollectApplicationWithCommands( |
| 103 | 103 | string $name, |
| 104 | 104 | string $version, |
@@ -110,10 +110,10 @@ discard block |
||
| 110 | 110 | $config = (array) ($framework->ObtainConfig()[DaftConsoleSource::class] ?? []); |
| 111 | 111 | |
| 112 | 112 | /** |
| 113 | - * @var string[] |
|
| 114 | - * |
|
| 115 | - * @psalm-var class-string[] |
|
| 116 | - */ |
|
| 113 | + * @var string[] |
|
| 114 | + * |
|
| 115 | + * @psalm-var class-string[] |
|
| 116 | + */ |
|
| 117 | 117 | $sources = array_values(array_filter($config, 'is_string')); |
| 118 | 118 | |
| 119 | 119 | $application->CollectCommands(...$sources); |
@@ -18,8 +18,8 @@ discard block |
||
| 18 | 18 | const INT_RETURN_FAIL = 1; |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | - * @var string |
|
| 22 | - */ |
|
| 21 | + * @var string |
|
| 22 | + */ |
|
| 23 | 23 | protected static $defaultName = 'daft-framework:router:update-cache'; |
| 24 | 24 | |
| 25 | 25 | public function execute(InputInterface $input, OutputInterface $output) : int |
@@ -35,10 +35,10 @@ discard block |
||
| 35 | 35 | $cacheFilename .= '.cache'; |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | - * @var string[] |
|
| 39 | - * |
|
| 40 | - * @psalm-var array<int, class-string<\SignpostMarv\DaftRouter\DaftSource>> |
|
| 41 | - */ |
|
| 38 | + * @var string[] |
|
| 39 | + * |
|
| 40 | + * @psalm-var array<int, class-string<\SignpostMarv\DaftRouter\DaftSource>> |
|
| 41 | + */ |
|
| 42 | 42 | $sources = $input->getArgument('sources'); |
| 43 | 43 | |
| 44 | 44 | Compiler::ObtainDispatcher(['cacheFile' => $cacheFilename], ...$sources); |
@@ -9,9 +9,9 @@ |
||
| 9 | 9 | interface DaftConsoleSource |
| 10 | 10 | { |
| 11 | 11 | /** |
| 12 | - * Provides an array of Command\Command implmentations, or DaftConsoleSource implementations. |
|
| 13 | - * |
|
| 14 | - * @return array<int, string> |
|
| 15 | - */ |
|
| 12 | + * Provides an array of Command\Command implmentations, or DaftConsoleSource implementations. |
|
| 13 | + * |
|
| 14 | + * @return array<int, string> |
|
| 15 | + */ |
|
| 16 | 16 | public static function DaftFrameworkConsoleSources() : array; |
| 17 | 17 | } |
@@ -11,8 +11,8 @@ |
||
| 11 | 11 | trait AttachDaftFramework |
| 12 | 12 | { |
| 13 | 13 | /** |
| 14 | - * @var Framework|null |
|
| 15 | - */ |
|
| 14 | + * @var Framework|null |
|
| 15 | + */ |
|
| 16 | 16 | protected $daftFrameworkInstance; |
| 17 | 17 | |
| 18 | 18 | public function AttachDaftFramework(Framework $framework) : void |
@@ -19,28 +19,28 @@ discard block |
||
| 19 | 19 | const BOOL_IN_ARRAY_STRICT = true; |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | - * @var string |
|
| 23 | - */ |
|
| 22 | + * @var string |
|
| 23 | + */ |
|
| 24 | 24 | private $baseUrl; |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * @var string |
|
| 28 | - */ |
|
| 27 | + * @var string |
|
| 28 | + */ |
|
| 29 | 29 | private $basePath; |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * @var EasyDB|null |
|
| 33 | - */ |
|
| 32 | + * @var EasyDB|null |
|
| 33 | + */ |
|
| 34 | 34 | private $db; |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | - * @var array |
|
| 38 | - */ |
|
| 37 | + * @var array |
|
| 38 | + */ |
|
| 39 | 39 | private $config; |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | - * @var array<string, self> |
|
| 43 | - */ |
|
| 42 | + * @var array<string, self> |
|
| 43 | + */ |
|
| 44 | 44 | private static $requestpair = []; |
| 45 | 45 | |
| 46 | 46 | public function __construct(string $baseUrl, string $basePath, array $config = []) |
@@ -68,13 +68,13 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | - * @var string |
|
| 72 | - */ |
|
| 71 | + * @var string |
|
| 72 | + */ |
|
| 73 | 73 | $scheme = $parsed['scheme'] ?? ''; |
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | - * @var string |
|
| 77 | - */ |
|
| 76 | + * @var string |
|
| 77 | + */ |
|
| 78 | 78 | $host = $parsed['host'] ?? ''; |
| 79 | 79 | |
| 80 | 80 | $baseUrl = $scheme . '://' . $host; |
@@ -84,8 +84,8 @@ discard block |
||
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | - * @var string |
|
| 88 | - */ |
|
| 87 | + * @var string |
|
| 88 | + */ |
|
| 89 | 89 | $path = $parsed['path'] ?? ''; |
| 90 | 90 | |
| 91 | 91 | return $baseUrl . str_replace('//', '/', $path); |
@@ -182,8 +182,8 @@ discard block |
||
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | /** |
| 185 | - * @throws InvalidArgumentException if $config contains something not valid |
|
| 186 | - */ |
|
| 185 | + * @throws InvalidArgumentException if $config contains something not valid |
|
| 186 | + */ |
|
| 187 | 187 | protected function ValidateConfig(array $config) : array |
| 188 | 188 | { |
| 189 | 189 | return $config; |
@@ -24,15 +24,15 @@ discard block |
||
| 24 | 24 | ' config property cacheFile does not exist under the framework base path.'; |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * @var string |
|
| 28 | - */ |
|
| 27 | + * @var string |
|
| 28 | + */ |
|
| 29 | 29 | private $routerCacheFile; |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * @var array<int, string> |
|
| 33 | - * |
|
| 34 | - * @psalm-var array<int, class-string<DaftSource>> |
|
| 35 | - */ |
|
| 32 | + * @var array<int, string> |
|
| 33 | + * |
|
| 34 | + * @psalm-var array<int, class-string<DaftSource>> |
|
| 35 | + */ |
|
| 36 | 36 | private $routerSources; |
| 37 | 37 | |
| 38 | 38 | public function __construct(string $baseUrl, string $basePath, array $config = []) |
@@ -42,10 +42,10 @@ discard block |
||
| 42 | 42 | $this->routerCacheFile = (string) ((array) $config[DaftSource::class])['cacheFile']; |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * @var string[] |
|
| 46 | - * |
|
| 47 | - * @psalm-var array<int, class-string<DaftSource>> |
|
| 48 | - */ |
|
| 45 | + * @var string[] |
|
| 46 | + * |
|
| 47 | + * @psalm-var array<int, class-string<DaftSource>> |
|
| 48 | + */ |
|
| 49 | 49 | $sources = (array) ((array) $config[DaftSource::class])['sources']; |
| 50 | 50 | |
| 51 | 51 | $this->routerSources = array_values(array_filter($sources, 'is_string')); |
@@ -80,8 +80,8 @@ discard block |
||
| 80 | 80 | protected function ValidateConfig(array $config) : array |
| 81 | 81 | { |
| 82 | 82 | /** |
| 83 | - * @var array|null |
|
| 84 | - */ |
|
| 83 | + * @var array|null |
|
| 84 | + */ |
|
| 85 | 85 | $subConfig = $config[DaftSource::class] ?? null; |
| 86 | 86 | |
| 87 | 87 | if ( ! is_array($subConfig) || ! isset($subConfig['cacheFile'], $subConfig['sources'])) { |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | |
| 71 | 71 | public function AttachToEventDispatcher(EventDispatcher $dispatcher) : void |
| 72 | 72 | { |
| 73 | - $dispatcher->addListener(KernelEvents::REQUEST, function (GetResponseEvent $e) : void { |
|
| 73 | + $dispatcher->addListener(KernelEvents::REQUEST, function(GetResponseEvent $e) : void { |
|
| 74 | 74 | if ( ! $e->hasResponse()) { |
| 75 | 75 | $e->setResponse($this->handle($e->getRequest())); |
| 76 | 76 | } |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | Response $response |
| 21 | 21 | ) : Response { |
| 22 | 22 | /** |
| 23 | - * @var Response |
|
| 24 | - */ |
|
| 23 | + * @var Response |
|
| 24 | + */ |
|
| 25 | 25 | $response = static::OmNomNom($request, $response); |
| 26 | 26 | |
| 27 | 27 | return $response; |
@@ -110,8 +110,8 @@ discard block |
||
| 110 | 110 | $config = (array) $config[self::class]; |
| 111 | 111 | |
| 112 | 112 | /** |
| 113 | - * @var string|null |
|
| 114 | - */ |
|
| 113 | + * @var string|null |
|
| 114 | + */ |
|
| 115 | 115 | $sameSite = $config['sameSite'] ?? null; |
| 116 | 116 | $sameSite = is_string($sameSite) ? $sameSite : null; |
| 117 | 117 | $isSecure = (bool) ($config['secure'] ?? null); |