Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[FrameworkBundle] Check for class existence before is_subclass_of #19842

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

Merged
merged 1 commit into from
Sep 6, 2016

Conversation

chalasr
Copy link
Member

@chalasr chalasr commented Sep 4, 2016

Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

Same as #19342

@chalasr chalasr changed the title [FrameworkBundle] Check for class existance before is_subclass_of [FrameworkBundle] Check for class existence before is_subclass_of Sep 4, 2016
@chalasr chalasr force-pushed the class_exist_before_issublassof branch from 52fb4de to f13d082 Compare September 4, 2016 01:08
@@ -38,6 +39,10 @@ public function process(ContainerBuilder $container)

$class = $container->getParameterBag()->resolveValue($definition->getClass());
if (!is_subclass_of($class, 'Symfony\\Component\\Console\\Command\\Command')) {
if (!class_exists($class, false)) {
throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use \InvalidArgumentException for consistency in this PR (and rely on your other PR to use "DI" exceptions)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the inverse would be easier, change done

@chalasr chalasr force-pushed the class_exist_before_issublassof branch from f13d082 to 8a9e0f5 Compare September 6, 2016 08:59
@nicolas-grekas
Copy link
Member

👍

@nicolas-grekas
Copy link
Member

Thank you @chalasr.

@nicolas-grekas nicolas-grekas merged commit 8a9e0f5 into symfony:2.7 Sep 6, 2016
nicolas-grekas added a commit that referenced this pull request Sep 6, 2016
…lass_of (chalasr)

This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Check for class existence before is_subclass_of

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Same as #19342

Commits
-------

8a9e0f5 [FrameworkBundle] Check for class existence before is_subclass_of
@chalasr chalasr deleted the class_exist_before_issublassof branch September 6, 2016 09:23
This was referenced Sep 7, 2016
@fabpot fabpot mentioned this pull request Oct 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.