1 | <?php |
||
2 | |||
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
3 | namespace Jaxon\App; |
||
4 | |||
5 | use Jaxon\App\Session\SessionInterface; |
||
6 | use Jaxon\App\View\ViewRenderer; |
||
7 | use Jaxon\Exception\SetupException; |
||
8 | use Jaxon\Plugin\Request\CallableClass\CallableClassHelper; |
||
9 | use Jaxon\Plugin\Response\DataBag\DataBagContext; |
||
10 | use Jaxon\Plugin\Response\JQuery\DomSelector; |
||
11 | use Jaxon\Request\Factory\RequestFactory; |
||
12 | use Jaxon\Request\TargetInterface; |
||
13 | use Jaxon\Response\Response; |
||
14 | use Psr\Log\LoggerInterface; |
||
15 | |||
16 | class CallableClass |
||
0 ignored issues
–
show
|
|||
17 | { |
||
18 | /** |
||
19 | * @var Response |
||
20 | */ |
||
21 | protected $response = null; |
||
0 ignored issues
–
show
|
|||
22 | |||
23 | /** |
||
24 | * @var CallableClassHelper |
||
25 | */ |
||
26 | protected $xCallableClassHelper = null; |
||
27 | |||
28 | /** |
||
29 | * Get the Jaxon request target |
||
30 | * |
||
31 | * @return TargetInterface |
||
32 | */ |
||
33 | protected function target(): TargetInterface |
||
0 ignored issues
–
show
|
|||
34 | { |
||
35 | return $this->xCallableClassHelper->xTarget; |
||
36 | } |
||
0 ignored issues
–
show
|
|||
37 | |||
38 | /** |
||
39 | * Get an instance of a Jaxon class by name |
||
40 | * |
||
41 | * @param string $sClassName the class name |
||
42 | * |
||
43 | * @return mixed |
||
44 | * @throws SetupException |
||
45 | */ |
||
46 | public function cl(string $sClassName) |
||
47 | { |
||
48 | return $this->xCallableClassHelper->cl($sClassName); |
||
49 | } |
||
0 ignored issues
–
show
|
|||
50 | |||
51 | /** |
||
52 | * Get the request factory. |
||
53 | * |
||
54 | * @param string $sClassName |
||
0 ignored issues
–
show
|
|||
55 | * |
||
56 | * @return RequestFactory |
||
57 | */ |
||
58 | public function rq(string $sClassName = ''): RequestFactory |
||
59 | { |
||
60 | return $this->xCallableClassHelper->rq($sClassName); |
||
61 | } |
||
0 ignored issues
–
show
|
|||
62 | |||
63 | /** |
||
64 | * Get the logger |
||
65 | * |
||
66 | * @return LoggerInterface |
||
67 | */ |
||
68 | public function logger(): LoggerInterface |
||
69 | { |
||
70 | return $this->xCallableClassHelper->xLogger; |
||
71 | } |
||
0 ignored issues
–
show
|
|||
72 | |||
73 | /** |
||
74 | * Get the view renderer |
||
75 | * |
||
76 | * @return ViewRenderer |
||
77 | */ |
||
78 | public function view(): ViewRenderer |
||
79 | { |
||
80 | return $this->xCallableClassHelper->xViewRenderer; |
||
81 | } |
||
0 ignored issues
–
show
|
|||
82 | |||
83 | /** |
||
84 | * Get the session manager |
||
85 | * |
||
86 | * @return SessionInterface |
||
87 | */ |
||
88 | public function session(): SessionInterface |
||
89 | { |
||
90 | return $this->xCallableClassHelper->xSessionManager; |
||
91 | } |
||
0 ignored issues
–
show
|
|||
92 | |||
93 | /** |
||
94 | * Get the uploaded files |
||
95 | * |
||
96 | * @return array |
||
97 | */ |
||
98 | public function files(): array |
||
99 | { |
||
100 | return $this->xCallableClassHelper->xUploadHandler->files(); |
||
101 | } |
||
0 ignored issues
–
show
|
|||
102 | |||
103 | /** |
||
104 | * Create a JQuery DomSelector, and link it to the response attribute. |
||
105 | * |
||
106 | * @param string $sPath The jQuery selector path |
||
107 | * @param mixed $xContext A context associated to the selector |
||
0 ignored issues
–
show
|
|||
108 | * |
||
109 | * @return DomSelector |
||
110 | */ |
||
111 | public function jq(string $sPath = '', $xContext = null): DomSelector |
||
112 | { |
||
113 | return $this->response->jq($sPath, $xContext); |
||
114 | } |
||
0 ignored issues
–
show
|
|||
115 | |||
116 | /** |
||
117 | * Get a data bag. |
||
118 | * |
||
119 | * @param string $sBagName |
||
0 ignored issues
–
show
|
|||
120 | * |
||
121 | * @return DataBagContext |
||
122 | */ |
||
123 | public function bag(string $sBagName): DataBagContext |
||
124 | { |
||
125 | return $this->response->bag($sBagName); |
||
126 | } |
||
0 ignored issues
–
show
|
|||
127 | } |
||
128 |