Initial Drupal 11 with DDEV setup
This commit is contained in:
99
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXAttribute.php
vendored
Normal file
99
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXAttribute.php
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Peast package
|
||||
*
|
||||
* (c) Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information refer to the LICENSE file
|
||||
* distributed with this source code
|
||||
*/
|
||||
namespace Peast\Syntax\Node\JSX;
|
||||
|
||||
use Peast\Syntax\Node\Node;
|
||||
|
||||
/**
|
||||
* A node that represents a JSX attribute.
|
||||
*
|
||||
* @author Marco Marchiò <marco.mm89@gmail.com>
|
||||
*/
|
||||
class JSXAttribute extends Node
|
||||
{
|
||||
/**
|
||||
* Map of node properties
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $propertiesMap = array(
|
||||
"name" => true,
|
||||
"value" => true
|
||||
);
|
||||
|
||||
/**
|
||||
* Attribute name
|
||||
*
|
||||
* @var JSXIdentifier|JSXNamespacedName
|
||||
*/
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* Attribute value
|
||||
*
|
||||
* @var Node|null
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* Returns the attribute name
|
||||
*
|
||||
* @return Node
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the attribute value
|
||||
*
|
||||
* @param Node|null $value Attribute value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->assertType(
|
||||
$value,
|
||||
array(
|
||||
"Literal", "JSX\\JSXExpressionContainer",
|
||||
"JSX\\JSXElement", "JSX\\JSXFragment"
|
||||
),
|
||||
true
|
||||
);
|
||||
$this->value = $value;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
66
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXBoundaryElement.php
vendored
Normal file
66
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXBoundaryElement.php
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Peast package
|
||||
*
|
||||
* (c) Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information refer to the LICENSE file
|
||||
* distributed with this source code
|
||||
*/
|
||||
namespace Peast\Syntax\Node\JSX;
|
||||
|
||||
use Peast\Syntax\Node\Node;
|
||||
|
||||
/**
|
||||
* A base class for boundary elements.
|
||||
*
|
||||
* @author Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* @abstract
|
||||
*/
|
||||
abstract class JSXBoundaryElement extends Node
|
||||
{
|
||||
/**
|
||||
* Map of node properties
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $propertiesMap = array(
|
||||
"name" => true
|
||||
);
|
||||
|
||||
/**
|
||||
* Element name
|
||||
*
|
||||
* @var JSXIdentifier|JSXMemberExpression|JSXNamespacedName
|
||||
*/
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* Returns the element name
|
||||
*
|
||||
* @return JSXIdentifier|JSXMemberExpression|JSXNamespacedName
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the element name
|
||||
*
|
||||
* @param JSXIdentifier|JSXMemberExpression|JSXNamespacedName $name Element
|
||||
* name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->assertType(
|
||||
$name,
|
||||
array("JSX\\JSXIdentifier", "JSX\\JSXMemberExpression", "JSX\\JSXNamespacedName")
|
||||
);
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
19
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXClosingElement.php
vendored
Normal file
19
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXClosingElement.php
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Peast package
|
||||
*
|
||||
* (c) Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information refer to the LICENSE file
|
||||
* distributed with this source code
|
||||
*/
|
||||
namespace Peast\Syntax\Node\JSX;
|
||||
|
||||
/**
|
||||
* A node that represents a JSX closing element tag.
|
||||
*
|
||||
* @author Marco Marchiò <marco.mm89@gmail.com>
|
||||
*/
|
||||
class JSXClosingElement extends JSXBoundaryElement
|
||||
{
|
||||
}
|
||||
21
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXClosingFragment.php
vendored
Normal file
21
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXClosingFragment.php
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Peast package
|
||||
*
|
||||
* (c) Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information refer to the LICENSE file
|
||||
* distributed with this source code
|
||||
*/
|
||||
namespace Peast\Syntax\Node\JSX;
|
||||
|
||||
use Peast\Syntax\Node\Node;
|
||||
|
||||
/**
|
||||
* A node that represents a JSX closing fragment tag.
|
||||
*
|
||||
* @author Marco Marchiò <marco.mm89@gmail.com>
|
||||
*/
|
||||
class JSXClosingFragment extends Node
|
||||
{
|
||||
}
|
||||
127
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXElement.php
vendored
Normal file
127
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXElement.php
vendored
Normal file
@ -0,0 +1,127 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Peast package
|
||||
*
|
||||
* (c) Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information refer to the LICENSE file
|
||||
* distributed with this source code
|
||||
*/
|
||||
namespace Peast\Syntax\Node\JSX;
|
||||
|
||||
use Peast\Syntax\Node\Node;
|
||||
use Peast\Syntax\Node\Expression;
|
||||
|
||||
/**
|
||||
* A node that represents a JSX element.
|
||||
*
|
||||
* @author Marco Marchiò <marco.mm89@gmail.com>
|
||||
*/
|
||||
class JSXElement extends Node implements Expression
|
||||
{
|
||||
/**
|
||||
* Map of node properties
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $propertiesMap = array(
|
||||
"openingElement" => true,
|
||||
"children" => true,
|
||||
"closingElement" => true
|
||||
);
|
||||
|
||||
/**
|
||||
* Opening element node
|
||||
*
|
||||
* @var JSXOpeningElement
|
||||
*/
|
||||
protected $openingElement;
|
||||
|
||||
/**
|
||||
* Children nodes array
|
||||
*
|
||||
* @var Node[]
|
||||
*/
|
||||
protected $children = array();
|
||||
|
||||
/**
|
||||
* Closing element node
|
||||
*
|
||||
* @var JSXClosingElement|null
|
||||
*/
|
||||
protected $closingElement;
|
||||
|
||||
/**
|
||||
* Returns the opening element node
|
||||
*
|
||||
* @return JSXOpeningElement
|
||||
*/
|
||||
public function getOpeningElement()
|
||||
{
|
||||
return $this->openingElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the opening element node
|
||||
*
|
||||
* @param JSXOpeningElement $openingElement Opening element node
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOpeningElement(JSXOpeningElement $openingElement)
|
||||
{
|
||||
$this->openingElement = $openingElement;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the children nodes array
|
||||
*
|
||||
* @return Node[]
|
||||
*/
|
||||
public function getChildren()
|
||||
{
|
||||
return $this->children;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the children nodes array
|
||||
*
|
||||
* @param Node[] $children Children nodes array
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setChildren($children)
|
||||
{
|
||||
$this->assertArrayOf($children, array(
|
||||
"JSX\\JSXText", "JSX\\JSXExpressionContainer", "JSX\\JSXSpreadChild",
|
||||
"JSX\\JSXElement", "JSX\\JSXFragment"
|
||||
));
|
||||
$this->children = $children;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the closing element node
|
||||
*
|
||||
* @return JSXClosingElement|null
|
||||
*/
|
||||
public function getClosingElement()
|
||||
{
|
||||
return $this->closingElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
21
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXEmptyExpression.php
vendored
Normal file
21
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXEmptyExpression.php
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Peast package
|
||||
*
|
||||
* (c) Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information refer to the LICENSE file
|
||||
* distributed with this source code
|
||||
*/
|
||||
namespace Peast\Syntax\Node\JSX;
|
||||
|
||||
use Peast\Syntax\Node\Node;
|
||||
|
||||
/**
|
||||
* A node that represents a JSX empty expression.
|
||||
*
|
||||
* @author Marco Marchiò <marco.mm89@gmail.com>
|
||||
*/
|
||||
class JSXEmptyExpression extends Node
|
||||
{
|
||||
}
|
||||
64
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXExpressionContainer.php
vendored
Normal file
64
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXExpressionContainer.php
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Peast package
|
||||
*
|
||||
* (c) Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information refer to the LICENSE file
|
||||
* distributed with this source code
|
||||
*/
|
||||
namespace Peast\Syntax\Node\JSX;
|
||||
|
||||
use Peast\Syntax\Node\Node;
|
||||
|
||||
/**
|
||||
* A node that represents an expression container in JSX.
|
||||
*
|
||||
* @author Marco Marchiò <marco.mm89@gmail.com>
|
||||
*/
|
||||
class JSXExpressionContainer extends Node
|
||||
{
|
||||
/**
|
||||
* Map of node properties
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $propertiesMap = array(
|
||||
"expression" => true
|
||||
);
|
||||
|
||||
/**
|
||||
* The wrapped expression
|
||||
*
|
||||
* @var \Peast\Syntax\Node\Expression|JSXEmptyExpression
|
||||
*/
|
||||
protected $expression;
|
||||
|
||||
/**
|
||||
* Returns the wrapped expression
|
||||
*
|
||||
* @return \Peast\Syntax\Node\Expression|JSXEmptyExpression
|
||||
*/
|
||||
public function getExpression()
|
||||
{
|
||||
return $this->expression;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
126
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXFragment.php
vendored
Normal file
126
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXFragment.php
vendored
Normal file
@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Peast package
|
||||
*
|
||||
* (c) Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information refer to the LICENSE file
|
||||
* distributed with this source code
|
||||
*/
|
||||
namespace Peast\Syntax\Node\JSX;
|
||||
|
||||
use Peast\Syntax\Node\Node;
|
||||
use Peast\Syntax\Node\Expression;
|
||||
|
||||
/**
|
||||
* A node that represents a JSX fragment.
|
||||
*
|
||||
* @author Marco Marchiò <marco.mm89@gmail.com>
|
||||
*/
|
||||
class JSXFragment extends Node implements Expression
|
||||
{
|
||||
/**
|
||||
* Map of node properties
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $propertiesMap = array(
|
||||
"openingFragment" => true,
|
||||
"children" => true,
|
||||
"closingFragment" => true
|
||||
);
|
||||
|
||||
/**
|
||||
* Opening fragment node
|
||||
*
|
||||
* @var JSXOpeningFragment
|
||||
*/
|
||||
protected $openingFragment;
|
||||
|
||||
/**
|
||||
* Children nodes array
|
||||
*
|
||||
* @var Node[]
|
||||
*/
|
||||
protected $children = array();
|
||||
|
||||
/**
|
||||
* Closing fragment node
|
||||
*
|
||||
* @var JSXClosingFragment
|
||||
*/
|
||||
protected $closingFragment;
|
||||
|
||||
/**
|
||||
* Returns the opening fragment node
|
||||
*
|
||||
* @return JSXOpeningFragment
|
||||
*/
|
||||
public function getOpeningFragment()
|
||||
{
|
||||
return $this->openingFragment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the opening fragment node
|
||||
*
|
||||
* @param JSXOpeningFragment $openingFragment Opening fragment node
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setOpeningFragment(JSXOpeningFragment $openingFragment)
|
||||
{
|
||||
$this->openingFragment = $openingFragment;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the children nodes array
|
||||
*
|
||||
* @return Node[]
|
||||
*/
|
||||
public function getChildren()
|
||||
{
|
||||
return $this->children;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the children nodes array
|
||||
*
|
||||
* @param Node[] $children Children nodes array
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setChildren($children)
|
||||
{
|
||||
$this->assertArrayOf($children, array(
|
||||
"JSX\\JSXText", "JSX\\JSXExpressionContainer", "JSX\\JSXSpreadChild",
|
||||
"JSX\\JSXElement", "JSX\\JSXFragment"
|
||||
));
|
||||
$this->children = $children;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the closing fragment node
|
||||
*
|
||||
* @return JSXClosingFragment
|
||||
*/
|
||||
public function getClosingFragment()
|
||||
{
|
||||
return $this->closingFragment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the closing fragment node
|
||||
*
|
||||
* @param JSXClosingFragment $closingFragment Closing fragment node
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setClosingFragment(JSXClosingFragment $closingFragment)
|
||||
{
|
||||
$this->closingFragment = $closingFragment;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
21
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXIdentifier.php
vendored
Normal file
21
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXIdentifier.php
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Peast package
|
||||
*
|
||||
* (c) Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information refer to the LICENSE file
|
||||
* distributed with this source code
|
||||
*/
|
||||
namespace Peast\Syntax\Node\JSX;
|
||||
|
||||
use Peast\Syntax\Node\Identifier;
|
||||
|
||||
/**
|
||||
* A node that represents a JSX identifier.
|
||||
*
|
||||
* @author Marco Marchiò <marco.mm89@gmail.com>
|
||||
*/
|
||||
class JSXIdentifier extends Identifier
|
||||
{
|
||||
}
|
||||
92
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXMemberExpression.php
vendored
Normal file
92
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXMemberExpression.php
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Peast package
|
||||
*
|
||||
* (c) Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information refer to the LICENSE file
|
||||
* distributed with this source code
|
||||
*/
|
||||
namespace Peast\Syntax\Node\JSX;
|
||||
|
||||
use Peast\Syntax\Node\Node;
|
||||
use Peast\Syntax\Node\Expression;
|
||||
|
||||
/**
|
||||
* A node that represents a JSX member expression.
|
||||
*
|
||||
* @author Marco Marchiò <marco.mm89@gmail.com>
|
||||
*/
|
||||
class JSXMemberExpression extends Node implements Expression
|
||||
{
|
||||
/**
|
||||
* Map of node properties
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $propertiesMap = array(
|
||||
"object" => true,
|
||||
"property" => true
|
||||
);
|
||||
|
||||
/**
|
||||
* Expression's object
|
||||
*
|
||||
* @var JSXMemberExpression|JSXIdentifier
|
||||
*/
|
||||
protected $object;
|
||||
|
||||
/**
|
||||
* Expression's property
|
||||
*
|
||||
* @var JSXIdentifier
|
||||
*/
|
||||
protected $property;
|
||||
|
||||
/**
|
||||
* Returns the expression's object
|
||||
*
|
||||
* @return JSXMemberExpression|JSXIdentifier
|
||||
*/
|
||||
public function getObject()
|
||||
{
|
||||
return $this->object;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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()
|
||||
{
|
||||
return $this->property;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the expression's property
|
||||
*
|
||||
* @param JSXIdentifier $property Property
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setProperty(JSXIdentifier $property)
|
||||
{
|
||||
$this->property = $property;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
91
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXNamespacedName.php
vendored
Normal file
91
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXNamespacedName.php
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Peast package
|
||||
*
|
||||
* (c) Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information refer to the LICENSE file
|
||||
* distributed with this source code
|
||||
*/
|
||||
namespace Peast\Syntax\Node\JSX;
|
||||
|
||||
use Peast\Syntax\Node\Node;
|
||||
use Peast\Syntax\Node\Expression;
|
||||
|
||||
/**
|
||||
* A node that represents a JSX namespaced name.
|
||||
*
|
||||
* @author Marco Marchiò <marco.mm89@gmail.com>
|
||||
*/
|
||||
class JSXNamespacedName extends Node implements Expression
|
||||
{
|
||||
/**
|
||||
* Map of node properties
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $propertiesMap = array(
|
||||
"namespace" => false,
|
||||
"name" => false
|
||||
);
|
||||
|
||||
/**
|
||||
* Node's namespace
|
||||
*
|
||||
* @var JSXIdentifier
|
||||
*/
|
||||
protected $namespace;
|
||||
|
||||
/**
|
||||
* Node's name
|
||||
*
|
||||
* @var JSXIdentifier
|
||||
*/
|
||||
protected $name;
|
||||
|
||||
/**
|
||||
* Returns node's namespace
|
||||
*
|
||||
* @return JSXIdentifier
|
||||
*/
|
||||
public function getNamespace()
|
||||
{
|
||||
return $this->namespace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets node's namespace
|
||||
*
|
||||
* @param JSXIdentifier $namespace Namespace
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNamespace($namespace)
|
||||
{
|
||||
$this->namespace = $namespace;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return node's name
|
||||
*
|
||||
* @return JSXIdentifier
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets node's name
|
||||
*
|
||||
* @param JSXIdentifier $name Name
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
92
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXOpeningElement.php
vendored
Normal file
92
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXOpeningElement.php
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Peast package
|
||||
*
|
||||
* (c) Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information refer to the LICENSE file
|
||||
* distributed with this source code
|
||||
*/
|
||||
namespace Peast\Syntax\Node\JSX;
|
||||
|
||||
/**
|
||||
* A node that represents a JSX opening element tag.
|
||||
*
|
||||
* @author Marco Marchiò <marco.mm89@gmail.com>
|
||||
*/
|
||||
class JSXOpeningElement extends JSXBoundaryElement
|
||||
{
|
||||
/**
|
||||
* Map of node properties
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $propertiesMap = array(
|
||||
"attributes" => true,
|
||||
"selfClosing" => false
|
||||
);
|
||||
|
||||
/**
|
||||
* Children nodes array
|
||||
*
|
||||
* @var JSXAttribute[]|JSXSpreadAttribute[]
|
||||
*/
|
||||
protected $attributes = array();
|
||||
|
||||
/**
|
||||
* Self closing tag mode
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $selfClosing = false;
|
||||
|
||||
/**
|
||||
* Returns the children attributes array
|
||||
*
|
||||
* @return JSXAttribute[]|JSXSpreadAttribute[]
|
||||
*/
|
||||
public function getAttributes()
|
||||
{
|
||||
return $this->attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the attributes nodes array
|
||||
*
|
||||
* @param JSXAttribute[]|JSXSpreadAttribute[] $attributes Attributes nodes
|
||||
* array
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAttributes($attributes)
|
||||
{
|
||||
$this->assertArrayOf($attributes, array(
|
||||
"JSX\\JSXAttribute", "JSX\\JSXSpreadAttribute"
|
||||
));
|
||||
$this->attributes = $attributes;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the self closing tag mode
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getSelfClosing()
|
||||
{
|
||||
return $this->selfClosing;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the self closing tag mode
|
||||
*
|
||||
* @param bool $selfClosing Self closing tag mode
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setSelfClosing($selfClosing)
|
||||
{
|
||||
$this->selfClosing = (bool) $selfClosing;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
21
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXOpeningFragment.php
vendored
Normal file
21
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXOpeningFragment.php
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Peast package
|
||||
*
|
||||
* (c) Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information refer to the LICENSE file
|
||||
* distributed with this source code
|
||||
*/
|
||||
namespace Peast\Syntax\Node\JSX;
|
||||
|
||||
use Peast\Syntax\Node\Node;
|
||||
|
||||
/**
|
||||
* A node that represents a JSX opening fragment tag.
|
||||
*
|
||||
* @author Marco Marchiò <marco.mm89@gmail.com>
|
||||
*/
|
||||
class JSXOpeningFragment extends Node
|
||||
{
|
||||
}
|
||||
21
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXSpreadAttribute.php
vendored
Normal file
21
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXSpreadAttribute.php
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Peast package
|
||||
*
|
||||
* (c) Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information refer to the LICENSE file
|
||||
* distributed with this source code
|
||||
*/
|
||||
namespace Peast\Syntax\Node\JSX;
|
||||
|
||||
use Peast\Syntax\Node\SpreadElement;
|
||||
|
||||
/**
|
||||
* A node that represents a JSX spread attribute.
|
||||
*
|
||||
* @author Marco Marchiò <marco.mm89@gmail.com>
|
||||
*/
|
||||
class JSXSpreadAttribute extends SpreadElement
|
||||
{
|
||||
}
|
||||
60
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXSpreadChild.php
vendored
Normal file
60
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXSpreadChild.php
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Peast package
|
||||
*
|
||||
* (c) Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information refer to the LICENSE file
|
||||
* distributed with this source code
|
||||
*/
|
||||
namespace Peast\Syntax\Node\JSX;
|
||||
|
||||
use Peast\Syntax\Node\Node;
|
||||
use Peast\Syntax\Node\Expression;
|
||||
|
||||
/**
|
||||
* A node that represents a spread child expression in JSX.
|
||||
*
|
||||
* @author Marco Marchiò <marco.mm89@gmail.com>
|
||||
*/
|
||||
class JSXSpreadChild extends Node
|
||||
{
|
||||
/**
|
||||
* Map of node properties
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $propertiesMap = array(
|
||||
"expression" => true
|
||||
);
|
||||
|
||||
/**
|
||||
* The wrapped expression
|
||||
*
|
||||
* @var Expression
|
||||
*/
|
||||
protected $expression;
|
||||
|
||||
/**
|
||||
* Returns the wrapped expression
|
||||
*
|
||||
* @return Expression
|
||||
*/
|
||||
public function getExpression()
|
||||
{
|
||||
return $this->expression;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the wrapped expression
|
||||
*
|
||||
* @param Expression $expression Wrapped expression
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setExpression(Expression $expression)
|
||||
{
|
||||
$this->expression = $expression;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
90
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXText.php
vendored
Normal file
90
vendor/mck89/peast/lib/Peast/Syntax/Node/JSX/JSXText.php
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of the Peast package
|
||||
*
|
||||
* (c) Marco Marchiò <marco.mm89@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information refer to the LICENSE file
|
||||
* distributed with this source code
|
||||
*/
|
||||
namespace Peast\Syntax\Node\JSX;
|
||||
|
||||
use Peast\Syntax\Node\Node;
|
||||
|
||||
/**
|
||||
* A node that represents a JSX closing fragment tag.
|
||||
*
|
||||
* @author Marco Marchiò <marco.mm89@gmail.com>
|
||||
*/
|
||||
class JSXText extends Node
|
||||
{
|
||||
/**
|
||||
* Map of node properties
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $propertiesMap = array(
|
||||
"value" => false,
|
||||
"raw" => false
|
||||
);
|
||||
|
||||
/**
|
||||
* Node's value
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* Node's raw value
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $raw;
|
||||
|
||||
/**
|
||||
* Returns node's value
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets node's value
|
||||
*
|
||||
* @param mixed $value Value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->value = $value;
|
||||
$this->raw = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return node's raw value
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRaw()
|
||||
{
|
||||
return $this->raw;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets node's raw value
|
||||
*
|
||||
* @param mixed $raw Raw value
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRaw($raw)
|
||||
{
|
||||
return $this->setValue($raw);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user