I want to disable the PHP syntax

I want to disable the PHP syntax. Front-end developers can make things worse if they use the PHP grammar to handle things in their views.

Volt files are always transpiled to raw php, the engine probably doesn't even know about those PHP tags.

I don't think it's possible with the vanila engine.

The only solution I see here is using static code analyzer tools or so. So scan the files after they push their branch modificatons, and make sure no PHP code is present.

But as usual - lecture from the team lead will suffice - asking politely FE devs not to use raw PHP but only Volt syntax.

Maybe you could override Volt's rendering method to search the target template for <? and strip out anything between <? and ?> ? That's a brutal way to do it because likely the rest of the template needs the result of the raw PHP code. Maybe you could just die if <? is found and output a nicer "Something's wrong with the template" or "Raw PHP code found" error message instead of the rendered template?