1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* @author : Korotkov Danila <[email protected]> |
7
|
|
|
* @copyright Copyright (c) 2018, Korotkov Danila |
8
|
|
|
* @license http://www.gnu.org/licenses/gpl.html GNU GPLv3.0 |
9
|
|
|
*/ |
10
|
|
|
|
11
|
|
|
namespace Rudra\ExternalTraits; |
12
|
|
|
|
13
|
|
|
use Rudra\Pagination; |
|
|
|
|
14
|
|
|
use Rudra\ContainerInterface; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Trait ContainerTrait |
18
|
|
|
* @package Rudra\Container\Traits |
19
|
|
|
*/ |
20
|
|
|
trait ContainerTrait |
21
|
|
|
{ |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @return mixed |
25
|
|
|
*/ |
26
|
|
|
public function validation() |
27
|
|
|
{ |
28
|
|
|
return $this->container()->get('validation'); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @param null $target |
|
|
|
|
33
|
|
|
* @return mixed |
34
|
|
|
*/ |
35
|
|
|
public function redirect($target = null) |
36
|
|
|
{ |
37
|
|
|
return isset($target) ? $this->container()->get('redirect')->run($target) : $this->container()->get('redirect'); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @param null $key |
|
|
|
|
42
|
|
|
* @return mixed |
43
|
|
|
*/ |
44
|
|
|
public function post($key = null) |
45
|
|
|
{ |
46
|
|
|
return $this->container()->getPost($key); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @param $object |
51
|
|
|
* @param null $params |
|
|
|
|
52
|
|
|
* @return mixed |
53
|
|
|
*/ |
54
|
|
|
public function new($object, $params = null) |
55
|
|
|
{ |
56
|
|
|
return $this->container()->new($object, $params); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @param string $key |
61
|
|
|
* @param string|null $subKey |
62
|
|
|
*/ |
63
|
|
|
public function unsetSession(string $key, string $subKey = null) |
64
|
|
|
{ |
65
|
|
|
$this->container()->unsetSession($key, $subKey); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @return mixed |
70
|
|
|
*/ |
71
|
|
|
public function pagination() |
72
|
|
|
{ |
73
|
|
|
return $this->container()->get('pagination'); |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @param $value |
78
|
|
|
*/ |
79
|
|
|
public function setPagination($value): void |
80
|
|
|
{ |
81
|
|
|
$this->container()->set('pagination', new Pagination($value['id']), 'raw'); |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* @param string $key |
87
|
|
|
* @param string $value |
88
|
|
|
* @param string|null $subKey |
89
|
|
|
*/ |
90
|
|
|
public function setSession(string $key, string $value, string $subKey = null): void |
91
|
|
|
{ |
92
|
|
|
$this->container()->setSession($key, $value, $subKey); |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* @return mixed |
97
|
|
|
*/ |
98
|
|
|
public function db() |
99
|
|
|
{ |
100
|
|
|
return $this->container()->get('db'); |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* @return mixed |
105
|
|
|
*/ |
106
|
|
|
abstract public function container(): ContainerInterface; |
107
|
|
|
} |
108
|
|
|
|
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