PHPSA\Analyzer\Pass\Expression\FunctionCall\UseCast::pass PHP Method

pass() public method

public pass ( PhpParser\Node\Expr\FuncCall $funcCall, Context $context )
$funcCall PhpParser\Node\Expr\FuncCall
$context PHPSA\Context
    public function pass(FuncCall $funcCall, Context $context)
    {
        $functionName = $this->resolveFunctionName($funcCall, $context);
        if ($functionName && isset($this->map[$functionName])) {
            /**
             * Exclusion via intval with 2 args intval($number, int $base = 10);
             */
            if ($functionName == 'intval' && count($funcCall->args) > 1) {
                return;
            }
            $context->notice('fcall.cast', sprintf('Please use (%s) cast instead of function call.', $this->map[$functionName]), $funcCall);
        }
    }
UseCast