| 1 | <?php |
||
| 20 | class EnumDefinition extends ScalarDefinition |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var array |
||
| 24 | */ |
||
| 25 | private $values = array(); |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Define enum values. |
||
| 29 | * |
||
| 30 | * @param array $values |
||
| 31 | * |
||
| 32 | * @return $this |
||
| 33 | */ |
||
| 34 | public function values(array $values) |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Instantiate enum node. |
||
| 49 | * |
||
| 50 | * @return EnumNode |
||
| 51 | */ |
||
| 52 | protected function instantiateNode() |
||
| 56 | } |
||
| 57 |
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.