modify
This commit is contained in:
+6
-12
@@ -239,19 +239,13 @@ class Container extends BaseObject
|
|||||||
if ($method->isStatic()) {
|
if ($method->isStatic()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
static::$_reflectionMethod[$class->getName()][$method->getName()] = $method;
|
$this->setReflectionMethod($class, $method);
|
||||||
static::$_methodsAttributes[$class->getName()][$method->getName()] = [];
|
|
||||||
foreach ($method->getAttributes() as $attribute) {
|
foreach ($method->getAttributes() as $attribute) {
|
||||||
if (!class_exists($attribute->getName())) {
|
if (!class_exists($attribute->getName())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->setMethodsAttributes($class, $method, $attribute->newInstance());
|
||||||
$instance = $attribute->newInstance();
|
|
||||||
|
|
||||||
$this->setAttributeMapping($attribute, $class, $method, $instance);
|
|
||||||
$this->setMethodsAttributes($class, $method, $instance);
|
|
||||||
static::$_methodsAttributes[$class->getName()][$method->getName()][] = $attribute->newInstance();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -262,12 +256,12 @@ class Container extends BaseObject
|
|||||||
* @param \ReflectionClass $class
|
* @param \ReflectionClass $class
|
||||||
* @param $object
|
* @param $object
|
||||||
*/
|
*/
|
||||||
private function setAttributeMapping(\ReflectionAttribute $attribute, ReflectionClass $class, $object)
|
private function setReflectionMethod(ReflectionClass $class, \ReflectionMethod $method)
|
||||||
{
|
{
|
||||||
if (!isset(static::$_attributeMaping[$attribute->getName()])) {
|
if (!isset(static::$_attributeMaping[$class->getName()])) {
|
||||||
static::$_attributeMaping[$attribute->getName()] = [];
|
static::$_attributeMaping[$class->getName()] = [];
|
||||||
}
|
}
|
||||||
static::$_attributeMaping[$attribute->getName()][$class->getName()][] = $object;
|
static::$_attributeMaping[$class->getName()][$method->getName()][] = $method;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user