Skip to content

Commit

Permalink
Check if class exists
Browse files Browse the repository at this point in the history
  • Loading branch information
xepozz committed Jul 6, 2024
1 parent 73fb5f6 commit e55726a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Debug/Provider/DebugApiProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function getDefinitions(): array

public function getExtensions(): array
{
return [
$extensions = [
RouteCollectorInterface::class => static function (
ContainerInterface $container,
RouteCollectorInterface $routeCollector
Expand All @@ -36,12 +36,18 @@ public function getExtensions(): array

return $routeCollector;
},
Application::class => static function (ContainerInterface $container, Application $application) {
];
if (class_exists(Application::class)) {
$extensions[Application::class] = static function (
ContainerInterface $container,
Application $application

Check failure on line 43 in src/Debug/Provider/DebugApiProvider.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

UndefinedClass

src/Debug/Provider/DebugApiProvider.php:43:17: UndefinedClass: Class, interface or enum named Yiisoft\Yii\Http\Application does not exist (see https://psalm.dev/019)

Check failure on line 43 in src/Debug/Provider/DebugApiProvider.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

UndefinedClass

src/Debug/Provider/DebugApiProvider.php:43:17: UndefinedClass: Class, interface or enum named Yiisoft\Yii\Http\Application does not exist (see https://psalm.dev/019)

Check failure on line 43 in src/Debug/Provider/DebugApiProvider.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.3-ubuntu-latest

UndefinedClass

src/Debug/Provider/DebugApiProvider.php:43:17: UndefinedClass: Class, interface or enum named Yiisoft\Yii\Http\Application does not exist (see https://psalm.dev/019)
) {
$applicationWrapper = $container->get(HttpApplicationWrapper::class);
$applicationWrapper->wrap($application);

return $application;
},
];
};
}
return $extensions;
}
}

0 comments on commit e55726a

Please sign in to comment.