Passed
Push — dev ( 1a31b5...8e8e3b )
by Dispositif
03:08
created

SubjectTrait   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 5
1
<?php
2
///**
3
// * This file is part of dispositif/wikibot application
4
// * 2019 : Philippe M. <[email protected]>
5
// * For the full copyright and MIT license information, please view the LICENSE file.
6
// */
7
//
8
//declare(strict_types=1);
9
//
10
//namespace App\Infrastructure;
11
//
12
//use SplObserver;
13
//
14
///**
15
// * TODO: not used
16
// * Observer pattern. For class which implements SplSubject.
17
// * Trait SubjectTrait.
18
// */
19
//trait SubjectTrait
20
//{
21
//    protected $observers = [];
22
//
23
//    public function attach(SplObserver $observer)
24
//    {
25
//        $this->observers[] = $observer;
26
//
27
//        return $this;
28
//    }
29
//
30
//    public function detach(SplObserver $observer)
31
//    {
32
//        if (is_int($key = array_search($observer, $this->observers, true))) {
33
//            unset($this->observers[$key]);
34
//        }
35
//
36
//        return $this;
37
//    }
38
//
39
//    public function notify()
40
//    {
41
//        foreach ($this->observers as $observer) {
42
//            /*
43
//             * @var $observer SplObserver
44
//             */
45
//            $observer->update($this);
46
//        }
47
//    }
48
//}
49