assertType example


    
    /** * Sets the local identifier * * @param Identifier|StringLiteral $local Local identifier * * @return $this */
    public function setLocal($local)
    {
        $this->assertType($local, array("Identifier", "StringLiteral"));
        $this->local = $local;
        return $this;
    }
}

    
    /** * Sets the initializer * * @param VariableDeclaration|Expression $init Initializer * * @return $this */
    public function setInit($init)
    {
        $this->assertType(
            $init,
            array("VariableDeclaration", "Expression"),
            true
        );
        $this->init = $init;
        return $this;
    }
    
    /** * Returns the test expression * * @return Expression */

    
    /** * Sets the initializer * * @param Expression $init Initializer * * @return $this */
    public function setInit($init)
    {
        $this->assertType($init, "Expression", true);
        $this->init = $init;
        return $this;
    }
}

    
    /** * Sets the attribute name * * @param JSXIdentifier|JSXNamespacedName $name Attribute name * * @return $this */
    public function setName($name)
    {
        $this->assertType($name, array("JSX\\JSXIdentifier", "JSX\\JSXNamespacedName"));
        $this->name = $name;
        return $this;
    }
    
    /** * Returns the attribute value * * @return Node|null */
    public function getValue()
    {
        

    
    /** * Sets the left node of the assignment * * @param Pattern|Expression $left The node to set * * @return $this */
    public function setLeft($left)
    {
        $this->assertType($left, array("Pattern", "Expression"));
        $this->left = $left;
        return $this;
    }
    
    /** * Returns the right node of the assignment * * @return Expression */
    public function getRight()
    {
        

    
    /** * Sets the iteration variable * * @param VariableDeclaration|Expression|Pattern $left Iteration variable * * @return $this */
    public function setLeft($left)
    {
        $this->assertType(
            $left, array("VariableDeclaration", "Expression", "Pattern")
        );
        $this->left = $left;
        return $this;
    }
    
    /** * Returns the iterated object * * @return Expression */
    

    
    /** * Sets the expression's object * * @param JSXMemberExpression|JSXIdentifier $object Object * * @return $this */
    public function setObject($object)
    {
        $this->assertType($object, array("JSX\\JSXMemberExpression", "JSX\\JSXIdentifier"));
        $this->object = $object;
        return $this;
    }
    
    /** * Returns the expression's property * * @return JSXIdentifier */
    public function getProperty()
    {
        

    
    /** * Sets the exported declaration * * @param Declaration $declaration Exported declaration * * @return $this */
    public function setDeclaration($declaration)
    {
        $this->assertType($declaration, "Declaration", true);
        $this->declaration = $declaration;
        return $this;
    }
    
    /** * Return the exported specifiers * * @return ExportSpecifier[] */
    public function getSpecifiers()
    {
        

    
    /** * Sets the statement that is activated if the test expression is true * * @param Statement|FunctionDeclaration $consequent The consequent expression * * @return $this */
    public function setConsequent($consequent)
    {
        $this->assertType(
            $consequent,
            array("Statement", "FunctionDeclaration"),
            true
        );
        $this->consequent = $consequent;
        return $this;
    }
    
    /** * Returns the "else" statement * * @return Statement */
protected $expression = false;
    
    /** * Sets the function body * * @param BlockStatement|Expression $body Function body * * @return $this */
    public function setBody($body)
    {
        $this->assertType($body, array("BlockStatement", "Expression"));
        $this->body = $body;
        return $this;
    }
    
    /** * Returns the expression flag * * @return bool */
    public function getExpression()
    {
        
/** * Sets the wrapped expression * * @param \Peast\Syntax\Node\Expression|JSXEmptyExpression $expression Wrapped * expression * * @return $this */
    public function setExpression($expression)
    {
        $this->assertType(
            $expression,
            array("Expression", "JSX\\JSXEmptyExpression")
        );
        $this->expression = $expression;
        return $this;
    }
}

    
    /** * Sets the closing element node * * @param JSXClosingElement|null $closingElement Closing element node * * @return $this */
    public function setClosingElement($closingElement)
    {
        $this->assertType($closingElement, "JSX\\JSXClosingElement", true);
        $this->closingElement = $closingElement;
        return $this;
    }
}

    
    /** * Sets the property value * * @param Pattern $value Property value * * @return $this */
    public function setValue($value)
    {
        $this->assertType($value, "Pattern");
        $this->value = $value;
        return $this;
    }
    
    /** * Sets the property kind that is one of the kind constants * * @param string $kind Property kind * * @return $this * * @codeCoverageIgnore */

    
    /** * Sets function name * * @param Identifier $id Function name * * @return $this */
    public function setId($id)
    {
        $this->assertType($id, "Identifier", true);
        $this->id = $id;
        return $this;
    }
    
    /** * Returns function parameters array * * @return Pattern[] */
    public function getParams()
    {
        


    /** * Sets the exported name *W * @param Identifier|StringLiteral $exported Exported name * * @return $this */
    public function setExported($exported)
    {
        $this->assertType($exported, array("Identifier", "StringLiteral"), true);
        $this->exported = $exported;
        return $this;
    }
}
Home | Imprint | This part of the site doesn't use cookies.