original_string: public function validateByParent($nodeType, NodeInterface $parent = null)
      {
          if (!$nodeType) {
              return true;
          }
  
          $config = $this->getNodeTypeConfig($nodeType);
          if (null === $config) {
              return false;
          }
  
          if ((null !== $parent) && $parent->getType()) {
              return in_array($parent->getType(), $config->getParentTypes());
          }
  
          return false;
      }
code: public function validateByParent($nodeType, NodeInterface $parent = null)
      {
          if (!$nodeType) {
              return true;
          }
  
          $config = $this->getNodeTypeConfig($nodeType);
          if (null === $config) {
              return false;
          }
  
          if ((null !== $parent) && $parent->getType()) {
              return in_array($parent->getType(), $config->getParentTypes());
          }
  
          return false;
      }
code_tokens: public function validateByParent ( $ nodeType , NodeInterface $ parent = null ) { if ( ! $ nodeType ) { return true ; } $ config = $ this -> getNodeTypeConfig ( $ nodeType ) ; if ( null === $ config ) { return false ; } if ( ( null !== $ parent ) && $ parent -> getType ( ) ) { return in_array ( $ parent -> getType ( ) , $ config -> getParentTypes ( ) ) ; } return false ; }
docstring: Validate by parent.
  
  @param string $nodeType
  @param NodeInterface $parent
  
  @return bool
docstring_tokens: Validate by parent .