Skip to content

[TwigBridge] Fix BC break due required twig environment #24851

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

Closed
wants to merge 2 commits into from
Closed

[TwigBridge] Fix BC break due required twig environment #24851

wants to merge 2 commits into from

Conversation

ro0NL
Copy link
Contributor

@ro0NL ro0NL commented Nov 7, 2017

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes/no
Fixed tickets #24236 (comment)
License MIT
Doc PR symfony/symfony-docs#...

See ezsystems/ezplatform-design-engine#12 + silexphp/Silex-WebProfiler#126 + bolt/bolt#7154

Sorry for that :)

cc @fabpot

@@ -31,7 +31,7 @@ class TwigDataCollector extends DataCollector implements LateDataCollectorInterf
private $twig;
private $computed;

public function __construct(Profile $profile, Environment $twig)
public function __construct(Profile $profile, Environment $twig = null)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe passing null should trigger a deprecation warning, so we can remove the boilerplate below on the 4.0 branch again.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds reasonable :) lets see what others think.

Copy link
Member

Choose a reason for hiding this comment

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

No need to "deprecate" that as we are talking about an additional feature.

$template = $this->twig->load($name = $profile->getName());
} catch (\Twig_Error_Loader $e) {
$template = null;
if (null !== $this->twig) {
Copy link
Member

Choose a reason for hiding this comment

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

if (null === $this->twig) {return;}?
about the deprecation, too late IMHO if we want to be strict about the feat freeze

@nicolas-grekas
Copy link
Member

Thank you @ro0NL.

nicolas-grekas added a commit that referenced this pull request Nov 7, 2017
…o0NL)

This PR was squashed before being merged into the 3.4 branch (closes #24851).

Discussion
----------

[TwigBridge] Fix BC break due required twig environment

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes/no
| Fixed tickets | #24236 (comment)
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

See ezsystems/ezplatform-design-engine#12 + silexphp/Silex-WebProfiler#126 + bolt/bolt#7154

Sorry for that :)

cc @fabpot

Commits
-------

243e4b2 [TwigBridge] Fix BC break due required twig environment
@ro0NL ro0NL deleted the patch-1 branch November 7, 2017 13:41
@GwendolenLynch
Copy link
Contributor

Much appreciated @ro0NL 👍

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.

8 participants