aggio
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^7.2.5|^8.0",
|
||||
"codexshaper/laravel-woocommerce": "^3.0",
|
||||
"codexshaper/laravel-woocommerce": "^3.0.4",
|
||||
"fideloper/proxy": "^4.4",
|
||||
"guzzlehttp/guzzle": "^6.3.1|^7.0.1",
|
||||
"laravel/framework": "^7.29",
|
||||
|
||||
@@ -12,6 +12,9 @@ use ReflectionClass;
|
||||
use ReflectionException;
|
||||
use ReflectionParameter;
|
||||
|
||||
use ReturnTypeWillChange; // Aggiungi questa riga in cima al file se non è già presente
|
||||
|
||||
|
||||
class Container implements ArrayAccess, ContainerContract
|
||||
{
|
||||
/**
|
||||
@@ -159,8 +162,8 @@ class Container implements ArrayAccess, ContainerContract
|
||||
public function bound($abstract)
|
||||
{
|
||||
return isset($this->bindings[$abstract]) ||
|
||||
isset($this->instances[$abstract]) ||
|
||||
$this->isAlias($abstract);
|
||||
isset($this->instances[$abstract]) ||
|
||||
$this->isAlias($abstract);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,7 +187,7 @@ class Container implements ArrayAccess, ContainerContract
|
||||
}
|
||||
|
||||
return isset($this->resolved[$abstract]) ||
|
||||
isset($this->instances[$abstract]);
|
||||
isset($this->instances[$abstract]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -196,8 +199,8 @@ class Container implements ArrayAccess, ContainerContract
|
||||
public function isShared($abstract)
|
||||
{
|
||||
return isset($this->instances[$abstract]) ||
|
||||
(isset($this->bindings[$abstract]['shared']) &&
|
||||
$this->bindings[$abstract]['shared'] === true);
|
||||
(isset($this->bindings[$abstract]['shared']) &&
|
||||
$this->bindings[$abstract]['shared'] === true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -235,7 +238,7 @@ class Container implements ArrayAccess, ContainerContract
|
||||
// up inside its own Closure to give us more convenience when extending.
|
||||
if (! $concrete instanceof Closure) {
|
||||
if (! is_string($concrete)) {
|
||||
throw new \TypeError(self::class.'::bind(): Argument #2 ($concrete) must be of type Closure|string|null');
|
||||
throw new \TypeError(self::class . '::bind(): Argument #2 ($concrete) must be of type Closure|string|null');
|
||||
}
|
||||
|
||||
$concrete = $this->getClosure($abstract, $concrete);
|
||||
@@ -266,7 +269,9 @@ class Container implements ArrayAccess, ContainerContract
|
||||
}
|
||||
|
||||
return $container->resolve(
|
||||
$concrete, $parameters, $raiseEvents = false
|
||||
$concrete,
|
||||
$parameters,
|
||||
$raiseEvents = false
|
||||
);
|
||||
};
|
||||
}
|
||||
@@ -303,7 +308,7 @@ class Container implements ArrayAccess, ContainerContract
|
||||
protected function parseBindMethod($method)
|
||||
{
|
||||
if (is_array($method)) {
|
||||
return $method[0].'@'.$method[1];
|
||||
return $method[0] . '@' . $method[1];
|
||||
}
|
||||
|
||||
return $method;
|
||||
@@ -875,8 +880,8 @@ class Container implements ArrayAccess, ContainerContract
|
||||
// primitive type which we can not resolve since it is not a class and
|
||||
// we will just bomb out with an error since we have no-where to go.
|
||||
$result = is_null(Util::getParameterClassName($dependency))
|
||||
? $this->resolvePrimitive($dependency)
|
||||
: $this->resolveClass($dependency);
|
||||
? $this->resolvePrimitive($dependency)
|
||||
: $this->resolveClass($dependency);
|
||||
|
||||
if ($dependency->isVariadic()) {
|
||||
$results = array_merge($results, $result);
|
||||
@@ -897,7 +902,8 @@ class Container implements ArrayAccess, ContainerContract
|
||||
protected function hasParameterOverride($dependency)
|
||||
{
|
||||
return array_key_exists(
|
||||
$dependency->name, $this->getLastParameterOverride()
|
||||
$dependency->name,
|
||||
$this->getLastParameterOverride()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -932,7 +938,7 @@ class Container implements ArrayAccess, ContainerContract
|
||||
*/
|
||||
protected function resolvePrimitive(ReflectionParameter $parameter)
|
||||
{
|
||||
if (! is_null($concrete = $this->getContextualConcrete('$'.$parameter->getName()))) {
|
||||
if (! is_null($concrete = $this->getContextualConcrete('$' . $parameter->getName()))) {
|
||||
return $concrete instanceof Closure ? $concrete($this) : $concrete;
|
||||
}
|
||||
|
||||
@@ -955,8 +961,8 @@ class Container implements ArrayAccess, ContainerContract
|
||||
{
|
||||
try {
|
||||
return $parameter->isVariadic()
|
||||
? $this->resolveVariadicClass($parameter)
|
||||
: $this->make(Util::getParameterClassName($parameter));
|
||||
? $this->resolveVariadicClass($parameter)
|
||||
: $this->make(Util::getParameterClassName($parameter));
|
||||
}
|
||||
|
||||
// If we can not resolve the class instance, we will check to see if the value
|
||||
@@ -1084,7 +1090,8 @@ class Container implements ArrayAccess, ContainerContract
|
||||
$this->fireCallbackArray($object, $this->globalResolvingCallbacks);
|
||||
|
||||
$this->fireCallbackArray(
|
||||
$object, $this->getCallbacksForType($abstract, $object, $this->resolvingCallbacks)
|
||||
$object,
|
||||
$this->getCallbacksForType($abstract, $object, $this->resolvingCallbacks)
|
||||
);
|
||||
|
||||
$this->fireAfterResolvingCallbacks($abstract, $object);
|
||||
@@ -1102,7 +1109,8 @@ class Container implements ArrayAccess, ContainerContract
|
||||
$this->fireCallbackArray($object, $this->globalAfterResolvingCallbacks);
|
||||
|
||||
$this->fireCallbackArray(
|
||||
$object, $this->getCallbacksForType($abstract, $object, $this->afterResolvingCallbacks)
|
||||
$object,
|
||||
$this->getCallbacksForType($abstract, $object, $this->afterResolvingCallbacks)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1267,6 +1275,7 @@ class Container implements ArrayAccess, ContainerContract
|
||||
* @param string $key
|
||||
* @return bool
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetExists($key)
|
||||
{
|
||||
return $this->bound($key);
|
||||
@@ -1278,7 +1287,8 @@ class Container implements ArrayAccess, ContainerContract
|
||||
* @param string $key
|
||||
* @return mixed
|
||||
*/
|
||||
public function offsetGet($key)
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($key)
|
||||
{
|
||||
return $this->make($key);
|
||||
}
|
||||
@@ -1290,7 +1300,8 @@ class Container implements ArrayAccess, ContainerContract
|
||||
* @param mixed $value
|
||||
* @return void
|
||||
*/
|
||||
public function offsetSet($key, $value)
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetSet($key, $value)
|
||||
{
|
||||
$this->bind($key, $value instanceof Closure ? $value : function () use ($value) {
|
||||
return $value;
|
||||
@@ -1303,6 +1314,7 @@ class Container implements ArrayAccess, ContainerContract
|
||||
* @param string $key
|
||||
* @return void
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetUnset($key)
|
||||
{
|
||||
unset($this->bindings[$key], $this->instances[$key], $this->resolved[$key]);
|
||||
|
||||
Reference in New Issue
Block a user