Skip to content

[DI][Routing] Allow invokable objects to be used as PHP-DSL loaders #27065

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
Apr 27, 2018
Merged

[DI][Routing] Allow invokable objects to be used as PHP-DSL loaders #27065

merged 1 commit into from
Apr 27, 2018

Conversation

aurimasniekis
Copy link
Contributor

@aurimasniekis aurimasniekis commented Apr 26, 2018

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #26583, #25630
License MIT
Doc PR none

Changed DI/Router PHPFileLoader to check is_object && is_callable instead of instance of Closure

@nicolas-grekas
Copy link
Member

Thanks :)
Would you mind adding a test case please?

@nicolas-grekas nicolas-grekas added this to the 4.1 milestone Apr 26, 2018
@aurimasniekis
Copy link
Contributor Author

aurimasniekis commented Apr 26, 2018

For which case? When tried to supply array callback? Because when array would be passed nothing will happen so I don't know what to test against.

@nicolas-grekas
Copy link
Member

For the case when you pass an invokable object.

@aurimasniekis
Copy link
Contributor Author

Oh right forgot about this simple case 😊

@aurimasniekis
Copy link
Contributor Author

@nicolas-grekas I don't know about Routing test I did not want to introduce copied test case so I just extended existing test case there.

@nicolas-grekas nicolas-grekas changed the title #26583 Changed DI/Router PHPFileLoader to check is_object && is_callable instead of instance of Closure [DI][Routing] Allow invokable objects to be used as PHP-DSL loaders Apr 26, 2018
@@ -0,0 +1,10 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

extra unneeded line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fabpot
Copy link
Member

fabpot commented Apr 27, 2018

Thank you @aurimasniekis.

@fabpot fabpot merged commit 662ff7e into symfony:master Apr 27, 2018
fabpot added a commit that referenced this pull request Apr 27, 2018
…P-DSL loaders (aurimasniekis)

This PR was squashed before being merged into the 4.1-dev branch (closes #27065).

Discussion
----------

[DI][Routing] Allow invokable objects to be used as PHP-DSL loaders

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26583, #25630
| License       | MIT
| Doc PR        | none

Changed DI/Router PHPFileLoader to check is_object && is_callable instead of instance of Closure

Commits
-------

662ff7e [DI][Routing] Allow invokable objects to be used as PHP-DSL loaders
@fabpot fabpot mentioned this pull request May 7, 2018
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.

5 participants