Skip to content

Instantly share code, notes, and snippets.

View stloyd's full-sized avatar

Joseph Bielawski stloyd

View GitHub Profile
@stloyd
stloyd / DisallowCatchingThrowableExceptionRule.php
Created April 4, 2022 16:15
Custom PHPStan rule to disallow catching \Throwable exception
<?php
declare(strict_types=1);
namespace App\PHPStan\Rules;
use PhpParser\Node;
use PhpParser\Node\Stmt;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\Rule;
<?php
declare(strict_types=1);
namespace App\ApiPlatform\Metadata\Resource\Factory;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Exception\ResourceClassNotFoundException;
use ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface;
use ApiPlatform\Core\Metadata\Resource\ResourceMetadata;