This PR was merged into the 1.15-dev branch.
Discussion
----------
Added a more clear example in the cycle() docs
We've receive a lot of feedback that the examples for the cycle() tag could be better, so I figured I'd contribute one.
The previous example was potentially misleading if you were focussed on the actual numbers (0 is even, not odd! etc.), and 99% of the time you’re going to be passing loop.index0 into cycle, so I felt that should be included in the example.
I realize that this one requires a little additional setup, but I think the fact that it's a real-world example makes it worth it.
Commits
-------
8958565 Added a more clear example in the cycle() docs
The previous one was potentially misleading if you were focussed on the actual numbers (0 is even, not odd! etc.), and 99% of the time you’re going to be passing loop.index0 into cycle, so I felt that should be included in the example.
This PR was merged into the 1.15-dev branch.
Discussion
----------
Improved exception message for accessing object (without ArrayAccess) as array
Commits
-------
770712b Improved exception message for accessing object without ArrayAccess as array
This PR was merged into the 1.15-dev branch.
Discussion
----------
made some minor tweaks to PHPUnit assertions
Commits
-------
e5e2a01 made some minor tweaks to PHPUnit assertions
This PR was merged into the 1.15-dev branch.
Discussion
----------
fixed the conversion of the special '0000-00-00 00:00' date
This PR reverts #1234 and add supports for PHP 5.5 is a simpler way. This also fixes#1241 and closes#1242.
Commits
-------
9b95570 fixed the conversion of the special '0000-00-00 00:00' date
This PR was squashed before being merged into the 1.15-dev branch (closes#1284).
Discussion
----------
Simple enhancement for easy overloading
More consistent algorithm which allow people to easily overload normalize method to their needs.
Commits
-------
87d4f08 Simple enhancement for easy overloading
This PR was merged into the 1.15-dev branch.
Discussion
----------
[Docs] Fix example: space missing between concatenated strings
The expression `'Hello'~'Fabien'` produces `'HelloFabien'`, not `'Hello Fabien'`. I've just added a space after `'Hello'`.
Commits
-------
d6e0357 Fix doc example: space missing between concatenated strings
This PR was squashed before being merged into the 1.15-dev branch (closes#1294).
Discussion
----------
Add HHVM to build matrix
Now that HHVM can run your project, lets keep it that way
Commits
-------
e03b05e Add HHVM to build matrix
This PR was merged into the master branch.
Discussion
----------
Fixed rendering of ``-3``
The missing space between "``-3``" and "(this is just syntactic[...])" led to the ``-3`` being rendered wrong. The parser must've ignored the closing "``" when it was directly followed by a non-space character.
Commits
-------
d8ea1b1 Fixed rendering of ``-3``
The missing space between "``-3``" and "(this is just syntactic[...])" led to the ``-3`` being rendered wrong. The parser must've ignored the closing "``" when it was directly followed by a non-space character.
This PR was merged into the master branch.
Discussion
----------
added an error message when trying to import an undefined block from a trait
Commits
-------
a2c6db7 added an error message when trying to import an undefined block from a trait
This PR was merged into the master branch.
Discussion
----------
Adding ignoreStrictCheck option for call_user_func_array, if throwing exception
Same as #1236 with added unit tests and C extension support (to come).
"I experienced the issue when using FuelPHP's ORM with EAV containers. When I tried to reference a property that was not defined I expected to get null, but instead the whole application stopped because an exception was thrown in the ORM, that no such function is present.
I couldn't find other possible exception that could be thrown when this function is called, so I assumed it's safe to take the ignoreStrictCheck into consideration here."
Commits
-------
1abf5d9 [ext] Mirroring PHP change for call_user_func_array, see #12869ab290b added tests for exceptions thrown in __call()
c711d37 Adding ignoreStrictCheck option for call_user_func_array, if throwing exception
This PR was merged into the master branch.
Discussion
----------
Added min and max function
usefull for pagination
Commits
-------
6aa06de Added min and max function
This PR was merged into the master branch.
Discussion
----------
Corrected description of the "//" operator
The operator was previously described to truncate the the value when it in fact floors the result of the division (which can be seen in https://github.com/fabpot/Twig/blob/master/lib/Twig/Node/Expression/Binary/FloorDiv.php#L20).
By the old description one would think that ``{{ -20 // 7 }}`` would yield -2 (as in ``(int)(-20/7)``) when it actually returns -3 (as in ``floor(-20/7)``). Floor is not truncate (cast to int).
Commits
-------
a360bc0 Corrected description of the "//" operator
This PR was merged into the master branch.
Discussion
----------
added TokenStream::nextIf()
The introduction of `nextIf()` simplified a lot of code.
Commits
-------
0ed7898 added TokenStream::nextIf()
The operator was previously described to truncate the the value when it in fact floors the result of the division (which can be seen in https://github.com/fabpot/Twig/blob/master/lib/Twig/Node/Expression/Binary/FloorDiv.php#L20).
By the old description one would think that ``{{ -20 // 7 }}`` would yield -2 (as in ``(int)(-20/7)``) when it actually returns -3 (as in ``floor(-20/7)``). Floor is not truncate (cast to int).
This PR was merged into the master branch.
Discussion
----------
[Docs] Some minor fixes: Typos, Notations, Formatting
Fixes for:
* Notations: html > HTML; javascript > JavaScript; composer > Composer
* Typos
* Wrong function names: ``escaper`` > ``escape``; ``include`` > ``source`` (in new chapter about ``source``)
* Formatting issues, e.g. remove RST from code blocks, it's not evaluated
* Wording where code sample outputs something: returns > outputs
* ``true`` parameter for ``autoescape`` - not needed any more
Commits
-------
a21df95 [Docs] Some minor fixes: Typos, Notations
This PR was merged into the master branch.
Discussion
----------
Use string instead of large integer
HHVM differs from php-src on large integer parsing (php-src converts
them to floats, HHVM truncates them but leaves them as integers). The
point of this test is to make sure Twig parses it correctly, not the
underlying PHP execution engine.
Commits
-------
d401717 Use string instead of large integer
HHVM differs from php-src on large integer parsing (php-src converts
them to floats, HHVM truncates them but leaves them as integers). The
point of this test is to make sure Twig parses it correctly, not the
underlying PHP execution engine.
This PR was squashed before being merged into the master branch (closes#1269).
Discussion
----------
various cleanups
fix bool -> Boolean for consistency in other parts of twig's code removing
assignment to n as it is never used fix typo and docblock for consistency
remove line break not needed for consistency fix array docblock for
consistency
Commits
-------
cb651e8 various cleanups