1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace WebStream\Annotation\Attributes; |
4
|
|
|
|
5
|
|
|
use WebStream\Annotation\Base\Annotation; |
6
|
|
|
use WebStream\Annotation\Base\IAnnotatable; |
7
|
|
|
use WebStream\Annotation\Base\IMethods; |
8
|
|
|
use WebStream\Annotation\Base\IRead; |
9
|
|
|
use WebStream\Annotation\Container\AnnotationContainer; |
10
|
|
|
use WebStream\Container\Container; |
|
|
|
|
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* Filter |
14
|
|
|
* @author Ryuichi TANAKA. |
15
|
|
|
* @since 2013/10/20 |
16
|
|
|
* @version 0.4 |
17
|
|
|
* |
18
|
|
|
* @Annotation |
19
|
|
|
* @Target("METHOD") |
20
|
|
|
*/ |
21
|
|
|
class Filter extends Annotation implements IMethods, IRead |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* @var array<string> 注入アノテーション情報 |
25
|
|
|
*/ |
26
|
|
|
private array $injectAnnotation; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var array<string> 読み込みアノテーション情報 |
30
|
|
|
*/ |
31
|
|
|
private array $readAnnotation; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* {@inheritdoc} |
35
|
|
|
*/ |
36
|
20 |
|
public function onInject(array $injectAnnotation) |
37
|
|
|
{ |
38
|
20 |
|
$this->injectAnnotation = $injectAnnotation; |
39
|
20 |
|
$this->readAnnotation = []; |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* {@inheritdoc} |
44
|
|
|
*/ |
45
|
20 |
|
public function getAnnotationInfo(): array |
46
|
|
|
{ |
47
|
20 |
|
return $this->readAnnotation; |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* {@inheritdoc} |
52
|
|
|
*/ |
53
|
20 |
|
public function onMethodInject(IAnnotatable $instance, \ReflectionMethod $method, Container $container) |
54
|
|
|
{ |
55
|
20 |
|
$annotationContainer = new AnnotationContainer(); |
56
|
20 |
|
foreach ($this->injectAnnotation as $key => $value) { |
57
|
20 |
|
$annotationContainer->{$key} = $value; |
58
|
|
|
} |
59
|
|
|
|
60
|
20 |
|
$this->readAnnotation = [ |
61
|
20 |
|
'classpath' => get_class($instance), |
62
|
20 |
|
'action' => $container->action, |
63
|
20 |
|
'refMethod' => $method, |
64
|
20 |
|
'annotation' => $annotationContainer |
65
|
|
|
]; |
66
|
|
|
} |
67
|
|
|
} |
68
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths