Skip to content

Commit

Permalink
Merge pull request #228 from Legion112/patch-1
Browse files Browse the repository at this point in the history
Catch even Throwable when trying to create class
  • Loading branch information
mr-feek authored Jun 9, 2022
2 parents 7524304 + c35a229 commit c82b7c7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Util/ContainerResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@

namespace Psalm\LaravelPlugin\Util;

use Illuminate\Contracts\Container\BindingResolutionException;
use PhpParser\Node\Arg;
use Psalm\LaravelPlugin\Providers\ApplicationProvider;
use Psalm\NodeTypeProvider;
use Psalm\Type\Atomic\TLiteralString;
use Psalm\Type\Atomic\TNamedObject;
use Psalm\Type\Union;
use ReflectionException;

use function array_key_exists;
use function class_exists;
Expand Down Expand Up @@ -42,7 +40,7 @@ private static function resolveFromApplicationContainer(string $abstract): ?stri
// dynamic analysis to resolve the actual type from the container
try {
$concrete = ApplicationProvider::getApp()->make($abstract);
} catch (BindingResolutionException | ReflectionException $e) {
} catch (\Throwable $e) {
return null;
}

Expand Down

0 comments on commit c82b7c7

Please sign in to comment.