[ticket/17618] Cure Symfony 7 (and PHP 8.2+) deprecation warnings#6934
[ticket/17618] Cure Symfony 7 (and PHP 8.2+) deprecation warnings#6934iMattPro wants to merge 14 commits intophpbb:masterfrom
Conversation
PHPBB-17618 fix
PHPBB-17618 Fix fix
PHPBB-17618
| #[\AllowDynamicProperties] | ||
| class acp_captcha | ||
| { | ||
| var $u_action; |
There was a problem hiding this comment.
Would be nice to see this things updated to public
There was a problem hiding this comment.
That's beyond the scope of this PR, and also, the ACP probably needs such a massive overhaul, that those sort of things should be saved for that job. The ACP files are basically PHP 4 language-level code 😂
|
|
||
| namespace phpbb\template\twig\node; | ||
|
|
||
| #[\Twig\Attribute\YieldReady] |
There was a problem hiding this comment.
Definitely is not yield ready yet since we're using things like ob_start()
There was a problem hiding this comment.
Made this #[YieldReady]; replaced ob_start()/ob_get_clean() with the CaptureNode pattern:
CoreExtension::captureOutput(...) in echo mode
implode('', iterator_to_array(...)) in yield mode
|
|
||
| namespace phpbb\template\twig\node; | ||
|
|
||
| #[\Twig\Attribute\YieldReady] |
There was a problem hiding this comment.
Made #[YieldReady]
Conditionally emits yield from ->unwrap()->yield() vs ->display() based on $compiler->getEnvironment()->useYield() - same pattern Twig uses internally
|
|
||
| namespace phpbb\template\twig\node; | ||
|
|
||
| #[\Twig\Attribute\YieldReady] |
There was a problem hiding this comment.
Same here, don't just add YieldReady because things need to be YieldReady for twig 4.0
There was a problem hiding this comment.
Can be YieldReady. Produces no template output at all — only adds to an asset bag
|
|
||
| namespace phpbb\template\twig\node; | ||
|
|
||
| #[\Twig\Attribute\YieldReady] |
There was a problem hiding this comment.
Produces no template output — only adds to an asset bag. Needs #[YieldReady] explicitly because PHP attributes aren't inherited
|
|
||
| namespace phpbb\template\twig\node; | ||
|
|
||
| #[\Twig\Attribute\YieldReady] |
There was a problem hiding this comment.
Produces no template output — only adds to an asset bag. Needs #[YieldReady] explicitly because PHP attributes aren't inherited
|
|
||
| namespace phpbb\template\twig\node; | ||
|
|
||
| #[\Twig\Attribute\YieldReady] |
There was a problem hiding this comment.
Already yield-safe (only sets vars, delegates to yield-ready parent \Twig\Node\IncludeNode::compile())
| $only = false; | ||
| $ignoreMissing = false; | ||
|
|
||
| if ($this->parser->getStream()->nextIf(\Twig\Token::NAME_TYPE, 'with')) |
There was a problem hiding this comment.
Use local variable for stream, same as current IncludeTokenParser
There was a problem hiding this comment.
Also, probably nicer to also just put this into a separate function
There was a problem hiding this comment.
Using a local variable for stream now (also found another class that missed using a local variable for stream
PHPBB-17618
|
@marc1706 I went through each of the twig node files, checked them for Yield readiness, and made them Yield ready where necessary. |
Checklist:
Tracker ticket:
https://tracker.phpbb.com/browse/PHPBB-17618