Upgrade to 3.8.0

This commit is contained in:
Bastian Allgeier
2022-10-06 10:11:54 +02:00
parent a9ed4e45ca
commit 7d168aae58
332 changed files with 26337 additions and 21977 deletions

View File

@@ -52,6 +52,7 @@ trait AppPlugins
'blueprints' => [],
'cacheTypes' => [],
'collections' => [],
'commands' => [],
'components' => [],
'controllers' => [],
'collectionFilters' => [],
@@ -120,14 +121,14 @@ trait AppPlugins
protected function extendApi($api): array
{
if (is_array($api) === true) {
if (is_a($api['routes'] ?? [], 'Closure') === true) {
if (($api['routes'] ?? []) instanceof Closure) {
$api['routes'] = $api['routes']($this);
}
return $this->extensions['api'] = A::merge($this->extensions['api'], $api, A::MERGE_APPEND);
} else {
return $this->extensions['api'];
}
return $this->extensions['api'];
}
/**
@@ -215,6 +216,17 @@ trait AppPlugins
return $this->extensions['cacheTypes'] = array_merge($this->extensions['cacheTypes'], $cacheTypes);
}
/**
* Registers additional CLI commands
*
* @param array $commands
* @return array
*/
protected function extendCommands(array $commands): array
{
return $this->extensions['commands'] = array_merge($this->extensions['commands'], $commands);
}
/**
* Registers additional collection filters
*
@@ -520,7 +532,7 @@ trait AppPlugins
*/
protected function extendRoutes($routes): array
{
if (is_a($routes, 'Closure') === true) {
if ($routes instanceof Closure) {
$routes = $routes($this);
}