Пример #1
0
 /**
  * Creates a new FalseNode.
  *
  * @param boolean $boolean
  *   Parameter is ignored.
  *
  * @return FalseNode
  */
 public static function create($boolean = FALSE)
 {
     $is_upper = FormatterFactory::getDefaultFormatter()->getConfig('boolean_null_upper');
     $node = new FalseNode();
     $node->addChild(NameNode::create($is_upper ? 'FALSE' : 'false'), 'constantName');
     return $node;
 }
Пример #2
0
 /**
  * Creates a BooleanNode.
  *
  * @param mixed $boolean
  *  The boolean to create. Pass a truthy value for TrueNode, falsy for FalseNode.
  *
  * @return BooleanNode
  */
 public static function create($boolean)
 {
     if ($boolean) {
         return TrueNode::create();
     } else {
         return FalseNode::create();
     }
 }