CoreController::__customAnnotation()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace WebStream\Core;
3
4
use WebStream\Delegate\Resolver;
5
use WebStream\DI\Injector;
6
use WebStream\Container\Container;
7
use WebStream\Annotation\Attributes\Filter;
8
use WebStream\Annotation\Base\IAnnotatable;
9
10
/**
11
 * CoreControllerクラス
12
 * @author Ryuichi TANAKA.
13
 * @since 2011/09/11
14
 * @version 0.4.2
15
 */
16
class CoreController implements CoreInterface, IAnnotatable
17
{
18
    use Injector;
19
20
    /**
21
     * @var Session セッション
0 ignored issues
show
Bug introduced by
The type WebStream\Core\Session was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
22
     */
23
    protected $session;
24
25
    /**
26
     * @var Request リクエスト
0 ignored issues
show
Bug introduced by
The type WebStream\Core\Request was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
27
     */
28
    protected $request;
29
30
    /**
31
     * @var Response レスポンス
0 ignored issues
show
Bug introduced by
The type WebStream\Core\Response was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
32
     */
33
    private $response;
34
35
    /**
36
     * @var CoreDelegator コアデリゲータ
0 ignored issues
show
Bug introduced by
The type WebStream\Core\CoreDelegator was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
37
     */
38
    private $coreDelegator;
39
40
    /**
41
     * @var array<mixed> カスタムアノテーション
42
     */
43
    protected $annotation;
44
45
    /**
46
     * @var LoggerAdapter ロガー
0 ignored issues
show
Bug introduced by
The type WebStream\Core\LoggerAdapter was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
47
     */
48
    protected $logger;
49
50
    /**
51
     * destructor
52
     */
53
    public function __destruct()
54
    {
55
        $this->logger->debug("Controller end.");
56
        $this->__clear();
57
    }
58
59
    /**
60
     * 静的ファイルを読み込む
61
     * @param string 静的ファイルパス
0 ignored issues
show
Documentation Bug introduced by
The doc comment 静的ファイルパス at position 0 could not be parsed: Unknown type name '静的ファイルパス' at position 0 in 静的ファイルパス.
Loading history...
62
     */
63
    final public function __callStaticFile($filepath)
64
    {
65
        $this->coreDelegator->getView()->__file($filepath);
66
    }
67
68
    /**
69
     * {@inheritdoc}
70
     */
71
    public function __customAnnotation(array $annotation)
72
    {
73
        $this->annotation = $annotation;
74
    }
75
76
    /**
77
     * {@inheritdoc}
78
     * @Filter(type="initialize")
79
     */
80
    public function __initialize(Container $container)
81
    {
82
        $pageName = $this->coreDelegator->getPageName();
83
        $resolver = new Resolver($container);
84
        $this->{$pageName} = $resolver->runService() ?: $resolver->runModel();
85
    }
86
}
87