for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Bavix\Flow;
use Bavix\Exceptions\Invalid;
use Bavix\Helpers\Str;
abstract class Directive
{
/**
* @var Flow
*/
protected $flow;
* @var array
protected $data;
protected $operator;
* Directive constructor.
*
* @param Flow $flow
* @param array $data
* @param array $operator
public function __construct(Flow $flow, array $data, array $operator)
$this->flow = $flow;
$this->data = $data;
$this->operator = $operator;
}
* @return string
protected function randVariable(): string
return '$_' . Str::random(16);
* @codeCoverageIgnore
public function endDirective(): string
throw new Invalid('Undefined directive `' . $this->operator['fragment']);
public function __toString()
return $this->render();
abstract public function render(): string;