for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Patsura Dmitry https://github.com/ovr <[email protected]>
*/
namespace PHPSA\Compiler\Statement;
use PHPSA\CompiledExpression;
use PHPSA\Context;
class WhileSt extends AbstractCompiler
{
protected $name = '\PhpParser\Node\Stmt\While_';
* @param \PhpParser\Node\Stmt\While_ $stmt
* @param Context $context
* @return CompiledExpression
public function compile($stmt, Context $context)
$context->getExpressionCompiler()->compile($stmt->cond);
if (count($stmt->stmts) > 0) {
foreach ($stmt->stmts as $statement) {
\PHPSA\nodeVisitorFactory($statement, $context);
}
} else {
$context->notice('not-implemented-body', 'Missing body', $stmt);