LightnCandy\Validator::blockBegin PHP Method

blockBegin() protected static method

validate block begin token
protected static blockBegin ( array\arraystring | integer> &$context, arrayinteger | string | array> $vars ) : boolean
$context array\arraystring | integer>
$vars arrayinteger | string | array>
return boolean Return true always
    protected static function blockBegin(&$context, $vars)
    {
        switch (isset($vars[0][0]) && is_string($vars[0][0]) ? $vars[0][0] : null) {
            case 'with':
                return static::with($context, $vars);
            case 'each':
                return static::section($context, $vars, true);
            case 'unless':
                return static::unless($context, $vars);
            case 'if':
                return static::doIf($context, $vars);
            default:
                return static::section($context, $vars);
        }
    }