1 | <?php |
||||||||
2 | /** |
||||||||
3 | * Config joining (merged from upstream) |
||||||||
4 | * User: moyo |
||||||||
5 | * Date: 19/10/2017 |
||||||||
6 | * Time: 4:06 PM |
||||||||
7 | */ |
||||||||
8 | |||||||||
9 | namespace Carno\Config\Chips; |
||||||||
10 | |||||||||
11 | use Carno\Config\Config; |
||||||||
12 | use Closure; |
||||||||
13 | |||||||||
14 | trait Joining |
||||||||
15 | { |
||||||||
16 | /** |
||||||||
17 | * @param Config $upstream |
||||||||
18 | */ |
||||||||
19 | public function joining(Config $upstream) : void |
||||||||
20 | { |
||||||||
21 | $upstream->jFollow(function (...$args) { |
||||||||
22 | $this->jWatched(...$args); |
||||||||
23 | }); |
||||||||
24 | } |
||||||||
25 | |||||||||
26 | /** |
||||||||
27 | * @param Closure $observer |
||||||||
28 | */ |
||||||||
29 | private function jFollow(Closure $observer) : void |
||||||||
30 | { |
||||||||
31 | $this->watching('*', $observer); |
||||||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||||||
32 | } |
||||||||
33 | |||||||||
34 | /** |
||||||||
35 | * @param mixed $value |
||||||||
36 | * @param string $key |
||||||||
37 | */ |
||||||||
38 | private function jWatched($value, string $key) : void |
||||||||
39 | { |
||||||||
40 | // REPLICA log |
||||||||
41 | $this->replica($key, $value); |
||||||||
0 ignored issues
–
show
It seems like
replica() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||||
42 | // NEVER reset existed value |
||||||||
43 | $this->locked($key) || $this->reset($key, $value, true); |
||||||||
0 ignored issues
–
show
It seems like
reset() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() It seems like
locked() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||||
44 | } |
||||||||
45 | } |
||||||||
46 |