Total Complexity | 6 |
Total Lines | 64 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
11 | trait HasObservables |
||
12 | { |
||
13 | /** |
||
14 | * User exposed observable events. |
||
15 | * |
||
16 | * These are extra user-defined events observers may subscribe to. |
||
17 | * |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $observables = []; |
||
21 | |||
22 | /** |
||
23 | * Get the observable event names. |
||
24 | * |
||
25 | * @return array |
||
26 | */ |
||
27 | public function getObservableEvents() |
||
28 | { |
||
29 | return array_merge( |
||
30 | Observe::all(), |
||
31 | $this->observables |
||
32 | ); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * Set the observable event names. |
||
37 | * |
||
38 | * @param array $observables |
||
39 | * @return $this |
||
40 | */ |
||
41 | public function setObservableEvents(array $observables) |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * Add an observable event name. |
||
50 | * |
||
51 | * @param array|mixed $observables |
||
52 | * @return void |
||
53 | */ |
||
54 | public function addObservableEvents($observables) |
||
60 | ) |
||
61 | ); |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * Remove an observable event name. |
||
66 | * |
||
67 | * @param array|mixed $observables |
||
68 | * @return void |
||
69 | */ |
||
70 | public function removeObservableEvents($observables) |
||
75 | ); |
||
76 | } |
||
78 |