original_string: protected function validate_after_order() {
          $nodearray = $this->nodes;
          foreach ($this->nodes as $node) {
              $after = $node->after;
              if (!empty($after)) {
                  if (empty($nodearray[$after])) {
                      throw new \coding_exception('node {$node->name} specified contains invalid \'after\' property');
                  } else {
                      // Valid node found.
                      $afternode = $nodearray[$after];
                      $beforecontent = $node->content;
                      $aftercontent = $afternode->content;
  
                      if ((empty($beforecontent) && !empty($aftercontent)) || (!empty($beforecontent) && empty($aftercontent))) {
                          // Only node with content are allowed after content nodes. Same goes for no content nodes.
                          throw new \coding_exception('node {$node->name} specified contains invalid \'after\' property');
                      }
                  }
              }
          }
      }
code: protected function validate_after_order() {
          $nodearray = $this->nodes;
          foreach ($this->nodes as $node) {
              $after = $node->after;
              if (!empty($after)) {
                  if (empty($nodearray[$after])) {
                      throw new \coding_exception('node {$node->name} specified contains invalid \'after\' property');
                  } else {
                      // Valid node found.
                      $afternode = $nodearray[$after];
                      $beforecontent = $node->content;
                      $aftercontent = $afternode->content;
  
                      if ((empty($beforecontent) && !empty($aftercontent)) || (!empty($beforecontent) && empty($aftercontent))) {
                          // Only node with content are allowed after content nodes. Same goes for no content nodes.
                          throw new \coding_exception('node {$node->name} specified contains invalid \'after\' property');
                      }
                  }
              }
          }
      }
code_tokens: protected function validate_after_order ( ) { $ nodearray = $ this -> nodes ; foreach ( $ this -> nodes as $ node ) { $ after = $ node -> after ; if ( ! empty ( $ after ) ) { if ( empty ( $ nodearray [ $ after ] ) ) { throw new \ coding_exception ( 'node {$node->name} specified contains invalid \'after\' property' ) ; } else { // Valid node found. $ afternode = $ nodearray [ $ after ] ; $ beforecontent = $ node -> content ; $ aftercontent = $ afternode -> content ; if ( ( empty ( $ beforecontent ) && ! empty ( $ aftercontent ) ) || ( ! empty ( $ beforecontent ) && empty ( $ aftercontent ) ) ) { // Only node with content are allowed after content nodes. Same goes for no content nodes. throw new \ coding_exception ( 'node {$node->name} specified contains invalid \'after\' property' ) ; } } } } }
docstring: Verifies that node with content can come after node with content only . Also verifies the same thing for nodes without
  content.
  @throws \coding_exception
docstring_tokens: Verifies that node with content can come after node with content only . Also verifies the same thing for nodes without content .