Issues (16)

src/Chips/Joining.php (4 issues)

Labels
Severity
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
It seems like watching() 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 ignore-call  annotation

31
        $this->/** @scrutinizer ignore-call */ 
32
               watching('*', $observer);
Loading history...
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 ignore-call  annotation

41
        $this->/** @scrutinizer ignore-call */ 
42
               replica($key, $value);
Loading history...
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 ignore-call  annotation

43
        $this->locked($key) || $this->/** @scrutinizer ignore-call */ reset($key, $value, true);
Loading history...
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 ignore-call  annotation

43
        $this->/** @scrutinizer ignore-call */ 
44
               locked($key) || $this->reset($key, $value, true);
Loading history...
44
    }
45
}
46