You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1018 B
64 lines
1018 B
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Dom;
|
|
|
|
/**
|
|
* Node in a document that represents a function call with a value.
|
|
*
|
|
* @author Adam Pippin <hello@adampippin.ca>
|
|
*/
|
|
class NodeFunctionValue extends NodeFunction
|
|
{
|
|
/**
|
|
* Value this node holds (parameter to the function).
|
|
*
|
|
* @var scalar
|
|
*/
|
|
protected $value;
|
|
|
|
/**
|
|
* Create a new function node which directly contains a value.
|
|
*
|
|
* @param ?Node $parent
|
|
* @param ?string $name
|
|
* @param scalar $value
|
|
*/
|
|
public function __construct(?Node $parent, ?string $name, $value)
|
|
{
|
|
parent::__construct($parent, $name);
|
|
$this->value = $value;
|
|
}
|
|
|
|
/**
|
|
* Set the value of this node.
|
|
*
|
|
* @param scalar $value
|
|
* @return void
|
|
*/
|
|
public function setValue($value): void
|
|
{
|
|
$this->value = $value;
|
|
}
|
|
|
|
/**
|
|
* Get the value of this node.
|
|
*
|
|
* @return scalar
|
|
*/
|
|
public function getValue()
|
|
{
|
|
return $this->value;
|
|
}
|
|
|
|
public function isMap(): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public function isArray(): bool
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|