mirror of
https://github.com/Karaka-Management/oms-Dashboard.git
synced 2026-02-16 10:28:40 +00:00
fix phpstan lvl 9 bugs
This commit is contained in:
parent
6275e05a45
commit
59807e5997
|
|
@ -120,6 +120,7 @@ final class Installer extends InstallerAbstract
|
||||||
$apiApp->moduleManager = $app->moduleManager;
|
$apiApp->moduleManager = $app->moduleManager;
|
||||||
$apiApp->eventManager = $app->eventManager;
|
$apiApp->eventManager = $app->eventManager;
|
||||||
|
|
||||||
|
/** @var array $dashboardData */
|
||||||
foreach ($dashboardData as $dashboard) {
|
foreach ($dashboardData as $dashboard) {
|
||||||
switch ($dashboard['type']) {
|
switch ($dashboard['type']) {
|
||||||
case 'component':
|
case 'component':
|
||||||
|
|
@ -138,11 +139,11 @@ final class Installer extends InstallerAbstract
|
||||||
* @param ApplicationAbstract $app Application
|
* @param ApplicationAbstract $app Application
|
||||||
* @param array $data Type info
|
* @param array $data Type info
|
||||||
*
|
*
|
||||||
* @return DashboardComponent
|
* @return array
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private static function createComponent(ApplicationAbstract $app, array $data) : DashboardComponent
|
private static function createComponent(ApplicationAbstract $app, array $data) : array
|
||||||
{
|
{
|
||||||
$module = $app->moduleManager->get('Dashboard');
|
$module = $app->moduleManager->get('Dashboard');
|
||||||
|
|
||||||
|
|
@ -156,6 +157,13 @@ final class Installer extends InstallerAbstract
|
||||||
|
|
||||||
$module->apiComponentCreate($request, $response);
|
$module->apiComponentCreate($request, $response);
|
||||||
|
|
||||||
return $response->get('')['response'];
|
$responseData = $response->get('');
|
||||||
|
if (!\is_array($responseData)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return !\is_array($responseData['response'])
|
||||||
|
? $responseData['response']->toArray()
|
||||||
|
: $responseData['response'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user