protected function assertViewVariableName($name)
    {
        if (!is_string($name)) {
            $type = (is_object($name) ? get_class($name) . ' ' : '') . gettype($name);
            throw new \InvalidArgumentException("Expected name to be a string, not a $type");
        }

        if (!preg_match('/^[a-z]\w*$/i', $name)) {
            throw new \InvalidArgumentException("Invalid name '$name'");
        }
    }
protected function assertViewVariableName($name)
    {
        if (!is_string($name)) {
            $type = (is_object($name) ? get_class($name) . ' ' : '') . gettype($name);
            throw new \InvalidArgumentException("Expected name to be a string, not a $type");
        }

        if (!preg_match('/^[a-z]\w*$/i', $name)) {
            throw new \InvalidArgumentException("Invalid name '$name'");
        }
    }
protected function assertViewVariableName ( $ name ) { if ( ! is_string ( $ name ) ) { $ type = ( is_object ( $ name ) ? get_class ( $ name ) . ' ' : '' ) . gettype ( $ name ) ; throw new \ InvalidArgumentException ( "Expected name to be a string, not a $type" ) ; } if ( ! preg_match ( '/^[a-z]\w*$/i' , $ name ) ) { throw new \ InvalidArgumentException ( "Invalid name '$name'" ) ; } }
Assert valid variable, function and filter name

@param string $name
@throws \InvalidArgumentException
Assert valid variable function and filter name