1 | <?php |
||
15 | class VoteForm extends Model |
||
16 | { |
||
17 | use ModuleTrait; |
||
18 | |||
19 | const ACTION_POSITIVE = 'positive'; |
||
20 | const ACTION_NEGATIVE = 'negative'; |
||
21 | const ACTION_TOGGLE = 'toggle'; |
||
22 | |||
23 | /** |
||
24 | * @var string entity (e.g. "user.like" or "page.voting") |
||
25 | */ |
||
26 | public $entity; |
||
27 | |||
28 | /** |
||
29 | * @var integer target model id |
||
30 | */ |
||
31 | public $targetId; |
||
32 | |||
33 | /** |
||
34 | * @var string +/-? |
||
35 | */ |
||
36 | public $action; |
||
37 | |||
38 | /** |
||
39 | * @return array |
||
40 | * @throws \yii\base\InvalidConfigException |
||
41 | */ |
||
42 | public function rules() |
||
51 | |||
52 | /** |
||
53 | * @return int |
||
54 | */ |
||
55 | public function getValue() |
||
59 | |||
60 | /** |
||
61 | * @return bool |
||
62 | * @throws \yii\base\InvalidConfigException |
||
63 | */ |
||
64 | public function checkModel() |
||
86 | } |
||
87 |
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.