1: <?php
2: namespace Pharborist\Types;
3:
4: use Pharborist\Constants\ConstantNode;
5: use Pharborist\FormatterFactory;
6: use Pharborist\Namespaces\NameNode;
7:
8: 9: 10:
11: class NullNode extends ConstantNode implements ScalarNode {
12: 13: 14: 15: 16: 17: 18: 19:
20: public static function create($name = 'null') {
21: $is_upper = FormatterFactory::getDefaultFormatter()->getConfig('boolean_null_upper');
22: $node = new NullNode();
23: $node->addChild(NameNode::create($is_upper ? 'NULL' : 'null'), 'constantName');
24: return $node;
25: }
26:
27: 28: 29:
30: public function toValue() {
31: return NULL;
32: }
33: }
34: