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

Harden the debugging of Twig filters and functions #22994

Merged
merged 1 commit into from May 31, 2017

Conversation

Projects
None yet
4 participants
@stof
Copy link
Member

commented May 31, 2017

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

Removing the environment and context arguments is now based on Twig metadata rather than on some wild guessing which might go wrong:

  • the environment argument may not be typehinted
  • the context argument may not be named $context
  • an argument may be named $context without being the special context argument
Harden the debugging of Twig filters and functions
Removing the environment and context arguments is now based on Twig metadata
rather than on some wild guessing which might go wrong.
return !$param->getClass() || $param->getClass()->getName() !== 'Twig_Environment';
});
if ($type === 'filters') {

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas May 31, 2017

Member

let's use yoda-style then :)

This comment has been minimized.

Copy link
@stof

stof May 31, 2017

Author Member

none of the conditions in this class are using yoda-style actually

@nicolas-grekas nicolas-grekas added this to the 2.7 milestone May 31, 2017

@fabpot

This comment has been minimized.

Copy link
Member

commented May 31, 2017

Thank you @stof.

@fabpot fabpot merged commit 63a8aff into symfony:2.7 May 31, 2017

2 of 3 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details

fabpot added a commit that referenced this pull request May 31, 2017

bug #22994 Harden the debugging of Twig filters and functions (stof)
This PR was merged into the 2.7 branch.

Discussion
----------

Harden the debugging of Twig filters and functions

| 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

Removing the environment and context arguments is now based on Twig metadata rather than on some wild guessing which might go wrong:

- the environment argument may not be typehinted
- the context argument may not be named `$context`
- an argument may be named `$context` without being the special context argument

Commits
-------

63a8aff Harden the debugging of Twig filters and functions

@stof stof deleted the stof:clean_twig_debug branch May 31, 2017

This was referenced Jun 5, 2017

@fabpot fabpot referenced this pull request Jul 4, 2017

Merged

Release v3.2.10 #23368

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.