-
-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More descriptive exception when the bundled-extension class does not exist #6839
Conversation
src/Bootstrap.php
Outdated
@@ -158,6 +158,9 @@ public static function run($rootPath) | |||
'extensions', | |||
function ($extensions) use ($config) { | |||
foreach ((array) $config['extensions'] as $extensionClass) { | |||
if(! class_exists($extensionClass) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Expected 1 space after IF keyword; 0 found
- Expected 0 spaces before closing bracket; 1 found
fixes #6836 |
src/Bootstrap.php
Outdated
@@ -158,6 +158,9 @@ public static function run($rootPath) | |||
'extensions', | |||
function ($extensions) use ($config) { | |||
foreach ((array) $config['extensions'] as $extensionClass) { | |||
if(! class_exists($extensionClass) ) { | |||
throw new LogicException("$extensionClass is defined in bolt.yml, but class is misspelled or is not loaded by composer"); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will throw exceptions for instantiated classed.
Bundles are expert level, from the beginning by design, this is out of scope
Reopening, as now I have more time to reply (plus what I mentioned in Slack), lets get this over the line. My reply was too terse 😆 I can do some magic for you to get this where it needs to be, or grab me again in Slack and lets go over it with more detail 👍 |
src/Bootstrap.php
Outdated
@@ -165,13 +165,16 @@ public static function run($rootPath) | |||
function ($extensions) use ($config) { | |||
foreach ((array) $config['extensions'] as $extensionClass) { | |||
if (is_string($extensionClass)) { | |||
if(!class_exists($extensionClass)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected 1 space after IF keyword; 0 found
As mentioned in Slack, I've rebased the branch to pull in the tests from #6844 and tweaked the location of the check, plus added a test for it. Catch you when you're back 👍 |
A class thatt doesn't exist can't implement an interface, so this should be checked first.