WowPress-Tailwind/theme/vendor/illuminate/view/Compilers/Concerns/CompilesInjections.php

24 lines
505 B
PHP
Raw Permalink Normal View History

2024-04-15 23:07:29 +02:00
<?php
namespace Illuminate\View\Compilers\Concerns;
trait CompilesInjections
{
/**
* Compile the inject statements into valid PHP.
*
* @param string $expression
* @return string
*/
protected function compileInject($expression)
{
$segments = explode(',', preg_replace("/[\(\)]/", '', $expression));
$variable = trim($segments[0], " '\"");
$service = trim($segments[1]);
return "<?php \${$variable} = app({$service}); ?>";
}
}