1 | <?php |
||
14 | class AppTable extends Table |
||
15 | { |
||
16 | use InstanceConfigTrait { |
||
17 | getConfig as private traitGetConfig; |
||
18 | } |
||
19 | |||
20 | /** @var array default config for InstanceConfigTrait */ |
||
21 | protected $_defaultConfig = []; |
||
22 | |||
23 | public $SharedObjects; |
||
24 | |||
25 | /** |
||
26 | * @var SaitoEventManager |
||
27 | */ |
||
28 | protected $_SEM; |
||
29 | |||
30 | /** |
||
31 | * Toggle bool field value. |
||
32 | * |
||
33 | * @param int $recordId The record-ID. |
||
34 | * @param string $field The name of the field to toggle. |
||
35 | * @return int new field The new value after the toggle. |
||
36 | */ |
||
37 | public function toggle($recordId, $field) |
||
49 | |||
50 | /** |
||
51 | * Check that a record exists. |
||
52 | * |
||
53 | * @param int|array|\ArrayAccess $conditions Record-ID or query conditions. |
||
54 | * @return bool |
||
55 | */ |
||
56 | public function exists($conditions) |
||
64 | |||
65 | /** |
||
66 | * Increments value of a field |
||
67 | * |
||
68 | * @param int|array $where entry-id or array with conditions |
||
69 | * @param string $field fielt to increment |
||
70 | * @param int $amount Increment size. |
||
71 | * @return void |
||
72 | * @throws \InvalidArgumentException |
||
73 | */ |
||
74 | public function increment($where, $field, $amount = 1) |
||
92 | |||
93 | /** |
||
94 | * Dispatches an event |
||
95 | * |
||
96 | * - Always passes the issuing model class as subject |
||
97 | * - Wrapper for CakeEvent boilerplate code |
||
98 | * - Easier to test |
||
99 | * |
||
100 | * @param string $event event identifier `Model.<modelname>.<event>` |
||
101 | * @param array $data additional event data |
||
102 | * @return void |
||
103 | */ |
||
104 | protected function _dispatchEvent($event, $data = []) |
||
110 | |||
111 | /** |
||
112 | * Dispatch Saito Event |
||
113 | * |
||
114 | * @param string $event event |
||
115 | * @param array $data data |
||
116 | * @return void |
||
117 | */ |
||
118 | public function dispatchSaitoEvent($event, $data) |
||
125 | |||
126 | /** |
||
127 | * {@inheritdoc} |
||
128 | */ |
||
129 | public function getConfig($key = null, $default = null) |
||
140 | } |
||
141 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.