Skip to content
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

Merged
merged 3 commits into from
Jul 22, 2017
Merged

More descriptive exception when the bundled-extension class does not exist #6839

merged 3 commits into from
Jul 22, 2017

Conversation

lenvanessen
Copy link
Contributor

@lenvanessen lenvanessen commented Jul 20, 2017

A class thatt doesn't exist can't implement an interface, so this should be checked first.

@@ -158,6 +158,9 @@ public static function run($rootPath)
'extensions',
function ($extensions) use ($config) {
foreach ((array) $config['extensions'] as $extensionClass) {
if(! class_exists($extensionClass) ) {

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

@lenvanessen
Copy link
Contributor Author

fixes #6836

@lenvanessen lenvanessen changed the title More descriptive exception when the class does not exist (a class tha… More descriptive exception when the bundled-extension class does not exist Jul 20, 2017
@@ -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");
}
Copy link
Contributor

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

@GwendolenLynch
Copy link
Contributor

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 👍

@@ -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)) {

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

GwendolenLynch
GwendolenLynch previously approved these changes Jul 22, 2017
@GwendolenLynch
Copy link
Contributor

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 👍

@GwendolenLynch GwendolenLynch merged commit 6cd00e8 into bolt:release/3.3 Jul 22, 2017
@GwendolenLynch GwendolenLynch modified the milestone: Bolt 3.3 - Feature release Jul 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants