mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-01 19:27:39 +08:00
Fixed bug.
This commit is contained in:
parent
483166c0bf
commit
ae2a5c4193
@ -43,6 +43,7 @@
|
||||
},
|
||||
"replace": {
|
||||
"hyperf/amqp": "self.version",
|
||||
"hyperf/cache": "self.version",
|
||||
"hyperf/config": "self.version",
|
||||
"hyperf/constants": "self.version",
|
||||
"hyperf/contract": "self.version",
|
||||
@ -72,6 +73,7 @@
|
||||
],
|
||||
"psr-4": {
|
||||
"Hyperf\\Amqp\\": "src/amqp/src/",
|
||||
"Hyperf\\Cache\\": "src/cache/src/",
|
||||
"Hyperf\\Config\\": "src/config/src/",
|
||||
"Hyperf\\Constants\\": "src/constants/src/",
|
||||
"Hyperf\\Contract\\": "src/contract/src/",
|
||||
@ -109,6 +111,7 @@
|
||||
"hyperf": {
|
||||
"config": [
|
||||
"Hyperf\\Amqp\\ConfigProvider",
|
||||
"Hyperf\\Cache\\ConfigProvider",
|
||||
"Hyperf\\Config\\ConfigProvider",
|
||||
"Hyperf\\Devtool\\ConfigProvider",
|
||||
"Hyperf\\DbConnection\\ConfigProvider",
|
||||
|
@ -52,5 +52,4 @@ class AnnotationCollector extends MetadataCollector
|
||||
{
|
||||
return static::get($class . '._c.' . $annotation);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -80,26 +80,28 @@ trait ProxyTrait
|
||||
{
|
||||
$aspects = AspectCollector::get('classes');
|
||||
$matchAspect = [];
|
||||
foreach ($aspects as $aspect => [$rule]) {
|
||||
if (strpos($rule, '*') !== false) {
|
||||
$preg = str_replace(['*', '\\'], ['.*', '\\\\'], $rule);
|
||||
$pattern = "/^${preg}$/";
|
||||
if (! preg_match($pattern, $className)) {
|
||||
foreach ($aspects as $aspect => $rules) {
|
||||
foreach ($rules as $rule) {
|
||||
if (strpos($rule, '*') !== false) {
|
||||
$preg = str_replace(['*', '\\'], ['.*', '\\\\'], $rule);
|
||||
$pattern = "/^${preg}$/";
|
||||
if (! preg_match($pattern, $className)) {
|
||||
continue;
|
||||
}
|
||||
} elseif ($rule !== $className) {
|
||||
continue;
|
||||
}
|
||||
} elseif ($rule !== $className) {
|
||||
continue;
|
||||
}
|
||||
if (strpos($rule, '::') !== false) {
|
||||
[$expectedClass, $expectedMethod] = explode('::', $rule);
|
||||
if ($expectedClass === $className && $expectedMethod === $method) {
|
||||
$matchAspect[] = $aspect;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if ($rule === $className) {
|
||||
$matchAspect[] = $aspect;
|
||||
break;
|
||||
if (strpos($rule, '::') !== false) {
|
||||
[$expectedClass, $expectedMethod] = explode('::', $rule);
|
||||
if ($expectedClass === $className && $expectedMethod === $method) {
|
||||
$matchAspect[] = $aspect;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if ($rule === $className) {
|
||||
$matchAspect[] = $aspect;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user