original_string: public function convertTypeDescendants(array $data = null)
      {
          $result = [];
  
          if (empty($data)) {
              return $result;
          }
  
          foreach (array_filter($data, 'is_array') as $itemData) {
  
              $container = new TypeDefinitionContainer();
  
              $typeDefinition = $this->convertTypeDefinition($itemData[JSONConstants::JSON_TYPESCONTAINER_TYPE] ?? []);
              if ($typeDefinition !== null) {
                  $container->setTypeDefinition($typeDefinition);
              }
  
              $container->setChildren(
                  $this->convertTypeDescendants($itemData[JSONConstants::JSON_TYPESCONTAINER_CHILDREN] ?? [])
              );
  
              $container->setExtensions($this->convertExtension($data, JSONConstants::getTypesContainerKeys()));
  
              $result[] = $container;
          }
  
          return $result;
      }
code: public function convertTypeDescendants(array $data = null)
      {
          $result = [];
  
          if (empty($data)) {
              return $result;
          }
  
          foreach (array_filter($data, 'is_array') as $itemData) {
  
              $container = new TypeDefinitionContainer();
  
              $typeDefinition = $this->convertTypeDefinition($itemData[JSONConstants::JSON_TYPESCONTAINER_TYPE] ?? []);
              if ($typeDefinition !== null) {
                  $container->setTypeDefinition($typeDefinition);
              }
  
              $container->setChildren(
                  $this->convertTypeDescendants($itemData[JSONConstants::JSON_TYPESCONTAINER_CHILDREN] ?? [])
              );
  
              $container->setExtensions($this->convertExtension($data, JSONConstants::getTypesContainerKeys()));
  
              $result[] = $container;
          }
  
          return $result;
      }
code_tokens: public function convertTypeDescendants ( array $ data = null ) { $ result = [ ] ; if ( empty ( $ data ) ) { return $ result ; } foreach ( array_filter ( $ data , 'is_array' ) as $ itemData ) { $ container = new TypeDefinitionContainer ( ) ; $ typeDefinition = $ this -> convertTypeDefinition ( $ itemData [ JSONConstants :: JSON_TYPESCONTAINER_TYPE ] ?? [ ] ) ; if ( $ typeDefinition !== null ) { $ container -> setTypeDefinition ( $ typeDefinition ) ; } $ container -> setChildren ( $ this -> convertTypeDescendants ( $ itemData [ JSONConstants :: JSON_TYPESCONTAINER_CHILDREN ] ?? [ ] ) ) ; $ container -> setExtensions ( $ this -> convertExtension ( $ data , JSONConstants :: getTypesContainerKeys ( ) ) ) ; $ result [ ] = $ container ; } return $ result ; }
docstring: Convert given input data to a TypeDescendants object
  
  @param array|null $data
  @return TypeDefinitionContainerInterface[] Returns an array of TypeDefinitionContainerInterface objects
docstring_tokens: Convert given input data to a TypeDescendants object