@@ -70,7 +70,7 @@ public function getDescription(): string
7070 }
7171
7272 /**
73- * @return array
73+ * @return array<array<string>>
7474 */
7575 public function getArgs (): array
7676 {
@@ -109,7 +109,7 @@ public function getArgs(): array
109109 $ ext = pathinfo ($ files [$ index ], PATHINFO_EXTENSION );
110110 }
111111
112- return [$ folder , $ ext ];
112+ return [[ $ folder , $ ext] ];
113113 }
114114
115115 /**
@@ -120,9 +120,6 @@ public function getSolution(): SolutionInterface
120120 return DirectorySolution::fromDirectory (__DIR__ . '/../../exercises/concerned-about-separation/solution ' );
121121 }
122122
123- /**
124- * @return null
125- */
126123 public function tearDown (): void
127124 {
128125 $ this ->filesystem ->remove ($ this ->getTemporaryPath ());
@@ -134,7 +131,11 @@ public function tearDown(): void
134131 */
135132 public function check (Input $ input ): ResultInterface
136133 {
137- $ statements = $ this ->parser ->parse (file_get_contents ($ input ->getArgument ('program ' )));
134+ $ statements = $ this ->parser ->parse ((string ) file_get_contents ($ input ->getRequiredArgument ('program ' )));
135+
136+ if (null === $ statements ) {
137+ return Failure::fromNameAndReason ($ this ->getName (), 'No code was found ' );
138+ }
138139
139140 $ include = null ;
140141 foreach ($ statements as $ statement ) {
@@ -156,6 +157,6 @@ public function check(Input $input): ResultInterface
156157 */
157158 public function getType (): ExerciseType
158159 {
159- return ExerciseType::CLI ( );
160+ return new ExerciseType (ExerciseType ::CLI );
160161 }
161162}
0 commit comments