1 | <?php |
||
32 | class AppComponent extends Component |
||
33 | { |
||
34 | |||
35 | /** |
||
36 | * Controller object. |
||
37 | * |
||
38 | * @var Controller |
||
39 | */ |
||
40 | protected $_controller; |
||
41 | |||
42 | /** |
||
43 | * Hold controller request (Server request). |
||
44 | * |
||
45 | * @var ServerRequest |
||
46 | */ |
||
47 | protected $_request; |
||
48 | |||
49 | /** |
||
50 | * Constructor hook method. |
||
51 | * |
||
52 | * @param array $config |
||
53 | * @return void |
||
54 | */ |
||
55 | public function initialize(array $config) |
||
62 | |||
63 | /** |
||
64 | * Redirect by request data. |
||
65 | * |
||
66 | * @param array $options |
||
67 | * @return \Cake\Http\Response|null |
||
68 | */ |
||
69 | public function redirect(array $options = []) |
||
101 | |||
102 | /** |
||
103 | * Toggle table field value. |
||
104 | * |
||
105 | * @param Table $table |
||
106 | * @param int $id |
||
107 | * @param string|int $value |
||
108 | * @param string $field |
||
109 | */ |
||
110 | public function toggleField(Table $table, $id, $value, $field = 'status') |
||
130 | |||
131 | /** |
||
132 | * Check is ajax request. |
||
133 | * |
||
134 | * @return void |
||
135 | */ |
||
136 | public function checkIsAjax() |
||
142 | |||
143 | /** |
||
144 | * Check toggle data. |
||
145 | * |
||
146 | * @param int $id |
||
147 | * @param string|int $value |
||
148 | */ |
||
149 | protected function _checkToggleData($id, $value) |
||
155 | } |
||
156 |
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.