diff --git a/src/Controller/KiCADAPIController.php b/src/Controller/KiCADAPIController.php index 01c79032..17be45ea 100644 --- a/src/Controller/KiCADAPIController.php +++ b/src/Controller/KiCADAPIController.php @@ -36,17 +36,16 @@ use Symfony\Component\Routing\Annotation\Route; class KiCADAPIController extends AbstractController { public function __construct( - private readonly EntityManagerInterface $em, private readonly KiCADHelper $kiCADHelper, - ) { - } #[Route('/', name: 'kicad_api_root')] public function root(): Response { + $this->denyAccessUnlessGranted('HAS_ACCESS_PERMISSIONS'); + //The API documentation says this can be either blank or the URL to the endpoints return $this->json([ 'categories' => '', diff --git a/src/Form/Part/EDA/KicadFieldAutocompleteType.php b/src/Form/Part/EDA/KicadFieldAutocompleteType.php index f1960559..9545114a 100644 --- a/src/Form/Part/EDA/KicadFieldAutocompleteType.php +++ b/src/Form/Part/EDA/KicadFieldAutocompleteType.php @@ -48,6 +48,7 @@ class KicadFieldAutocompleteType extends AbstractType 'file' => fn(Options $options) => match ($options['type']) { self::TYPE_FOOTPRINT => self::FOOTPRINT_PATH, self::TYPE_SYMBOL => self::SYMBOL_PATH, + default => throw new \InvalidArgumentException('Invalid type'), } ]); } diff --git a/src/Services/Cache/ElementCacheTagGenerator.php b/src/Services/Cache/ElementCacheTagGenerator.php index 7873ba1b..382c9317 100644 --- a/src/Services/Cache/ElementCacheTagGenerator.php +++ b/src/Services/Cache/ElementCacheTagGenerator.php @@ -59,7 +59,7 @@ class ElementCacheTagGenerator } //If the element is a proxy, then get the real class name of the underlying object - if ($element instanceof Proxy || str_starts_with($element, 'Proxies\\')) { + if (is_a($element, Proxy::class, true) || str_starts_with($element, 'Proxies\\')) { $element = get_parent_class($element); }