Skip to content

Commit d313900

Browse files
authored
web error handler supports method updated (#186)
2 parents ac0b09d + 319e915 commit d313900

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/Phaseolies/Error/Handlers/WebErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public function handle(Throwable $exception): void
3434
*/
3535
public function supports(): bool
3636
{
37-
return !request()->isAjax() && !request()->isApiRequest() && PHP_SAPI !== 'cli';
37+
return !request()->isAjax() || !request()->isApiRequest() || PHP_SAPI !== 'cli';
3838
}
3939
}

src/Phaseolies/Helpers/helpers.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,11 @@ function dopparEnv(string $key, string|float|int|bool|null $default = null): str
6060
*/
6161
function app($abstract = null, array $parameters = [])
6262
{
63-
$container = Container::getInstance();
64-
6563
if (is_null($abstract)) {
66-
return $container;
67-
}
68-
69-
if (!$container->has($abstract)) {
70-
return null;
64+
return Container::getInstance();
7165
}
7266

73-
return $container->get($abstract, $parameters);
67+
return Container::getInstance()->get($abstract, $parameters);
7468
}
7569
}
7670

0 commit comments

Comments
 (0)