Skip to content

[TwigBundle] changed the runtime loader to return null if there is no match #20119

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
Oct 3, 2016

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Oct 1, 2016

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

ping @stof

@fabpot fabpot force-pushed the runtime-loader-logging branch 2 times, most recently from 263f637 to d7b912b Compare October 1, 2016 16:47
@fabpot fabpot force-pushed the runtime-loader-logging branch from d7b912b to c03fd80 Compare October 1, 2016 16:47
return $this->container->get($this->mapping[$class]);
if (null !== $this->logger) {
$this->logger->warning(sprintf('Class "%s" is not configured as a Twig runtime. Add the "twig.runtime" tag to the related service in the container.', $class));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What about simply injecting a null/void logger if non is configured?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because I don't like forcing using a Logger if not available.

@fabpot fabpot merged commit c03fd80 into symfony:master Oct 3, 2016
fabpot added a commit that referenced this pull request Oct 3, 2016
… if there is no match (fabpot)

This PR was merged into the 3.2-dev branch.

Discussion
----------

[TwigBundle] changed the runtime loader to return null if there is no match

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

ping @stof

Commits
-------

c03fd80 [TwigBundle] changed the runtime loader to return null if there is no match
@fabpot fabpot deleted the runtime-loader-logging branch October 24, 2016 21:39
@fabpot fabpot mentioned this pull request Oct 27, 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