1 | <?php |
||
22 | class MyFirstIo extends AbstractExercise implements |
||
23 | ExerciseInterface, |
||
24 | CliExercise, |
||
25 | FunctionRequirementsExerciseCheck |
||
26 | { |
||
27 | use TemporaryDirectoryTrait; |
||
28 | |||
29 | /** |
||
30 | * @var Filesystem |
||
31 | */ |
||
32 | private $filesystem; |
||
33 | |||
34 | /** |
||
35 | * @var Generator |
||
36 | */ |
||
37 | private $faker; |
||
38 | |||
39 | /** |
||
40 | * @param Filesystem $filesystem |
||
41 | * @param Generator $faker |
||
42 | */ |
||
43 | public function __construct(Filesystem $filesystem, Generator $faker) |
||
48 | |||
49 | /** |
||
50 | * @return string |
||
51 | */ |
||
52 | public function getName() |
||
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | public function getDescription() |
||
64 | |||
65 | /** |
||
66 | * @return array |
||
67 | */ |
||
68 | public function getArgs() |
||
76 | |||
77 | /** |
||
78 | * @return null |
||
79 | */ |
||
80 | public function tearDown() |
||
84 | |||
85 | /** |
||
86 | * @return string[] |
||
87 | */ |
||
88 | public function getRequiredFunctions() |
||
92 | |||
93 | /** |
||
94 | * @return string[] |
||
95 | */ |
||
96 | public function getBannedFunctions() |
||
100 | |||
101 | /** |
||
102 | * @return ExerciseType |
||
103 | */ |
||
104 | public function getType() |
||
108 | |||
109 | /** |
||
110 | * @param ExerciseDispatcher $dispatcher |
||
111 | */ |
||
112 | public function configure(ExerciseDispatcher $dispatcher) |
||
116 | } |
||
117 |
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.