Skip to content

Commit 221c380

Browse files
cmaerzmsonowal
authored andcommitted
Error gots thrown if a non Model ist in app/ folder
I know it's not the nicest fix but maybe someone comes up with a better solution. I had my helpers.php file in app/ and an error got thrown cause $classes[0] wasn't set.
1 parent 9212a50 commit 221c380

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/helpers.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ function getClassNameFromFile($filePathName)
9494
$classes[] = $class_name;
9595
}
9696
}
97-
97+
if (!isset($classes[0]) {
98+
return 'no_class_found_in_file';
99+
}
98100
return $classes[0];
99101
}

0 commit comments

Comments
 (0)