mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
fix: spark namespaces cannot show a namespace with mutilple paths
This commit is contained in:
parent
f30fba67ed
commit
fbb8db40f5
@ -38,7 +38,8 @@ class Autoload extends AutoloadConfig
|
||||
* ];
|
||||
*```
|
||||
*
|
||||
* @var array<string, string>
|
||||
* @var array<string, array<int, string>|string>
|
||||
* @phpstan-var array<string, string|list<string>>
|
||||
*/
|
||||
public $psr4 = [
|
||||
APP_NAMESPACE => APPPATH, // For custom app namespace
|
||||
|
@ -20,11 +20,6 @@ parameters:
|
||||
count: 1
|
||||
path: system/Autoloader/Autoloader.php
|
||||
|
||||
-
|
||||
message: "#^Property Config\\\\Autoload\\:\\:\\$psr4 \\(array\\<string, string\\>\\) in isset\\(\\) is not nullable\\.$#"
|
||||
count: 1
|
||||
path: system/Autoloader/Autoloader.php
|
||||
|
||||
-
|
||||
message: "#^Property Config\\\\Cache\\:\\:\\$backupHandler \\(string\\) in isset\\(\\) is not nullable\\.$#"
|
||||
count: 1
|
||||
|
@ -74,14 +74,20 @@ class Namespaces extends BaseCommand
|
||||
|
||||
$tbody = [];
|
||||
|
||||
foreach ($config->psr4 as $ns => $path) {
|
||||
$path = realpath($path) ?: $path;
|
||||
foreach ($config->psr4 as $ns => $paths) {
|
||||
if (is_string($paths)) {
|
||||
$paths = [$paths];
|
||||
}
|
||||
|
||||
$tbody[] = [
|
||||
$ns,
|
||||
realpath($path) ?: $path,
|
||||
is_dir($path) ? 'Yes' : 'MISSING',
|
||||
];
|
||||
foreach ($paths as $path) {
|
||||
$path = realpath($path) ?: $path;
|
||||
|
||||
$tbody[] = [
|
||||
$ns,
|
||||
realpath($path) ?: $path,
|
||||
is_dir($path) ? 'Yes' : 'MISSING',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$thead = [
|
||||
|
@ -45,7 +45,8 @@ class AutoloadConfig
|
||||
* but this should be done prior to creating any namespaced classes,
|
||||
* else you will need to modify all of those classes for this to work.
|
||||
*
|
||||
* @var array<string, string>
|
||||
* @var array<string, array<int, string>|string>
|
||||
* @phpstan-var array<string, string|list<string>>
|
||||
*/
|
||||
public $psr4 = [];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user