Skip to content

Where to add "#[YieldReady]"? #4428

Closed Answered by fabpot
RobbieLePommie asked this question in Q&A
Discussion options

You must be logged in to vote

It should be:

namespace Common\General\Site\TwigDebugger;

use jblond\TwigTrans\TransNode;
use Twig\Attribute\YieldReady;

#[YieldReady]
class TransNodeDebug extends TransNode
{
    #[YieldReady]
    protected function getTransFunction(bool $plural): string
    {
        return $plural ? 'ngettext' : 'gettextDebug';
    }
}

Notice the missing use statement: use Twig\Attribute\YieldReady;

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by RobbieLePommie
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants