1 | <?php |
||
18 | class MyFirstIo extends AbstractExercise implements |
||
19 | ExerciseInterface, |
||
20 | StdOutExerciseCheck, |
||
21 | FunctionRequirementsExerciseCheck |
||
22 | { |
||
23 | use TemporaryDirectoryTrait; |
||
24 | |||
25 | /** |
||
26 | * @var Filesystem |
||
27 | */ |
||
28 | private $filesystem; |
||
29 | |||
30 | /** |
||
31 | * @var Generator |
||
32 | */ |
||
33 | private $faker; |
||
34 | |||
35 | /** |
||
36 | * @param Filesystem $filesystem |
||
37 | * @param Generator $faker |
||
38 | */ |
||
39 | public function __construct(Filesystem $filesystem, Generator $faker) |
||
44 | |||
45 | /** |
||
46 | * @return string |
||
47 | */ |
||
48 | public function getName() |
||
52 | |||
53 | /** |
||
54 | * @return string |
||
55 | */ |
||
56 | public function getDescription() |
||
60 | |||
61 | /** |
||
62 | * @return array |
||
63 | */ |
||
64 | public function getArgs() |
||
72 | |||
73 | /** |
||
74 | * @return null |
||
75 | */ |
||
76 | public function tearDown() |
||
80 | |||
81 | /** |
||
82 | * @return string[] |
||
83 | */ |
||
84 | public function getRequiredFunctions() |
||
88 | |||
89 | /** |
||
90 | * @return string[] |
||
91 | */ |
||
92 | public function getBannedFunctions() |
||
96 | } |
||
97 |
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.