From ce9b2119ceb911faab15fa43e741d63e3fb7834c Mon Sep 17 00:00:00 2001
From: filippo.bertilotti <filippobertilotti@gmail.com>
Date: Tue, 21 May 2024 10:09:46 +0200
Subject: [PATCH] aggiunto ref a ogni product e aggiunta eccezione di prodotto non trovato in caso non esista nel database (parte 119)

---
 src/Framework/Container.php |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/Framework/Container.php b/src/Framework/Container.php
index d88e41d..cde3165 100644
--- a/src/Framework/Container.php
+++ b/src/Framework/Container.php
@@ -4,7 +4,7 @@
 use ReflectionClass;
 use Closure;
 use ReflectionNamedType;
-use Exception;
+use InvalidArgumentException;
 
 class Container {
 
@@ -30,16 +30,16 @@
             $type = $param->getType();
             
             if($type === null) {
-                throw new Exception("Constructor parameter '{$param->getName()}' in the $class_name class has no type declaration");
+                throw new InvalidArgumentException("Constructor parameter '{$param->getName()}' in the $class_name class has no type declaration");
             }
 
             if( ! ($type instanceof ReflectionNamedType)) {
-                throw new Exception("Constructor parameter '{$param->getName()}' in the $class_name class is an invalid type: $type
+                throw new InvalidArgumentException("Constructor parameter '{$param->getName()}' in the $class_name class is an invalid type: $type
                      - only single named type supported");
             }
 
             if($type->isBuiltin()) {
-                throw new Exception("Unable to resolve costructor parameter '{$param->getName()}' of type '$type' in the '$class_name' class");
+                throw new InvalidArgumentException("Unable to resolve costructor parameter '{$param->getName()}' of type '$type' in the '$class_name' class");
             }
             $dependencies[] = $this->get((string) $type);
         }

--
Gitblit v1.8.0