File tree 1 file changed +8
-6
lines changed
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
34
34
{
35
35
$ exercise = $ event ->getParameter ('exercise ' );
36
36
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 ());
43
45
}
44
46
}
45
47
}
You can’t perform that action at this time.
0 commit comments