for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace LegalThings\DataEnricher\Processor;
use LegalThings\DataEnricher;
use LegalThings\DataEnricher\Node;
use LegalThings\DataEnricher\Processor;
use Mustache_Engine;
/**
* Process string as Mustache template
*/
class Mustache implements Processor
{
use Processor\Implementation;
* @var object
protected $source;
* Class constructor
*
* @param DataEnricher $invoker
* @param string $property Property key which should trigger the processor
public function __construct(DataEnricher $invoker, $property)
$this->source = $invoker->getSource();
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
$a = "a"; $ab = "ab"; $abc = "abc";
will produce issues in the first and second line, while this second example
will produce no issues.
$this->property = $property;
}
* Apply processing to a single node
* @param Node $node
protected function applyToNode(Node $node)
$template = $node->getInstruction($this);
$result = $this->parse($template);
$node->setResult($result);
* Parse as mustache template
* @param string $template
protected function parse($template)
$mustache = new Mustache_Engine();
return $mustache->render($template, $this->source);
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.