File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,14 @@ public function __invoke(Event $event): void
3434 {
3535 $ exercise = $ event ->getParameter ('exercise ' );
3636
37- if ($ exercise instanceof ProvidesInitialCode) {
38- foreach ($ exercise ->getInitialCode ()->getFiles () as $ file ) {
39- /** @var SolutionFile $file */
40- if (!file_exists ($ this ->workingDirectory . '/ ' . $ file ->getRelativePath ())) {
41- copy ($ file ->getAbsolutePath (), $ this ->workingDirectory . '/ ' . $ file ->getRelativePath ());
42- }
37+ if (!$ exercise instanceof ProvidesInitialCode) {
38+ return ;
39+ }
40+
41+ foreach ($ exercise ->getInitialCode ()->getFiles () as $ file ) {
42+ /** @var SolutionFile $file */
43+ if (!file_exists ($ this ->workingDirectory . '/ ' . $ file ->getRelativePath ())) {
44+ copy ($ file ->getAbsolutePath (), $ this ->workingDirectory . '/ ' . $ file ->getRelativePath ());
4345 }
4446 }
4547 }
You can’t perform that action at this time.
0 commit comments