for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace RulerZ\Target\Operators;
class OperatorTools
{
public static function inlineMixedInstructions(array $instructions, $operator = null)
$elements = [];
foreach ($instructions as $instruction) {
if ($instruction instanceof RuntimeOperator) {
$elements[] = $instruction->format(false);
} else if ($instruction instanceof CompileTimeOperator) {
$elements[] = sprintf('%s', $instruction->format(false));
} else {
$elements[] = sprintf('%s', $instruction);
}
if (null === $operator) {
return join('', $elements);
return join(' '.$operator.' ', $elements);