Exemple #1
0
 /**
  * @return NodeCollection
  */
 public function getOptionalParameters()
 {
     return $this->parameters->children(Filter::isInstanceOf('\\Pharborist\\ParameterNode'))->filter(function (ParameterNode $parameter) {
         $value = $parameter->getValue();
         return isset($value);
     });
 }
Exemple #2
0
 public function visitCommaListNode(CommaListNode $node)
 {
     if ($node->isEmpty()) {
         return;
     }
     $keep_wrap = $this->config['list_keep_wrap'];
     if (!$keep_wrap) {
         $keep_wrap = $node->parent() instanceof ArrayNode;
     }
     if ($keep_wrap) {
         $has_wrap = $node->children(Filter::isNewline())->isNotEmpty();
         $this->nodeData[$node] = $has_wrap;
     }
     foreach ($node->children(Filter::isTokenType(',')) as $comma_node) {
         $this->removeSpaceBefore($comma_node);
         $this->spaceAfter($comma_node);
     }
 }