original_string: private function convertTypeDefinitionSpecificData(array $data, MutableTypeDefinitionInterface $typeDefinition)
      {
          if ($typeDefinition instanceof MutableDocumentTypeDefinitionInterface) {
              if (!empty($data[JSONConstants::JSON_TYPE_CONTENTSTREAM_ALLOWED])) {
                  $data[JSONConstants::JSON_TYPE_CONTENTSTREAM_ALLOWED] = ContentStreamAllowed::cast(
                      $data[JSONConstants::JSON_TYPE_CONTENTSTREAM_ALLOWED]
                  );
              }
          } elseif ($typeDefinition instanceof MutableRelationshipTypeDefinitionInterface) {
  
              $data[JSONConstants::JSON_TYPE_ALLOWED_SOURCE_TYPES] = array_map(
                  'strval',
                  array_filter(
                      $data[JSONConstants::JSON_TYPE_ALLOWED_SOURCE_TYPES] ?? [],
                      function ($item) { return !empty($item); }
                  )
              );
              $data[JSONConstants::JSON_TYPE_ALLOWED_SOURCE_TYPES] = array_map(
                  'strval',
                  array_filter(
                      $data[JSONConstants::JSON_TYPE_ALLOWED_SOURCE_TYPES] ?? [],
                      function ($item) { return !empty($item); }
                  )
              );
              $data[JSONConstants::JSON_TYPE_ALLOWED_TARGET_TYPES] = array_map(
                  'strval',
                  array_filter(
                      $data[JSONConstants::JSON_TYPE_ALLOWED_TARGET_TYPES] ?? [],
                      function ($item) { return !empty($item); }
                  )
              );
  
          }
  
          return $data;
      }
code: private function convertTypeDefinitionSpecificData(array $data, MutableTypeDefinitionInterface $typeDefinition)
      {
          if ($typeDefinition instanceof MutableDocumentTypeDefinitionInterface) {
              if (!empty($data[JSONConstants::JSON_TYPE_CONTENTSTREAM_ALLOWED])) {
                  $data[JSONConstants::JSON_TYPE_CONTENTSTREAM_ALLOWED] = ContentStreamAllowed::cast(
                      $data[JSONConstants::JSON_TYPE_CONTENTSTREAM_ALLOWED]
                  );
              }
          } elseif ($typeDefinition instanceof MutableRelationshipTypeDefinitionInterface) {
  
              $data[JSONConstants::JSON_TYPE_ALLOWED_SOURCE_TYPES] = array_map(
                  'strval',
                  array_filter(
                      $data[JSONConstants::JSON_TYPE_ALLOWED_SOURCE_TYPES] ?? [],
                      function ($item) { return !empty($item); }
                  )
              );
              $data[JSONConstants::JSON_TYPE_ALLOWED_SOURCE_TYPES] = array_map(
                  'strval',
                  array_filter(
                      $data[JSONConstants::JSON_TYPE_ALLOWED_SOURCE_TYPES] ?? [],
                      function ($item) { return !empty($item); }
                  )
              );
              $data[JSONConstants::JSON_TYPE_ALLOWED_TARGET_TYPES] = array_map(
                  'strval',
                  array_filter(
                      $data[JSONConstants::JSON_TYPE_ALLOWED_TARGET_TYPES] ?? [],
                      function ($item) { return !empty($item); }
                  )
              );
  
          }
  
          return $data;
      }
code_tokens: private function convertTypeDefinitionSpecificData ( array $ data , MutableTypeDefinitionInterface $ typeDefinition ) { if ( $ typeDefinition instanceof MutableDocumentTypeDefinitionInterface ) { if ( ! empty ( $ data [ JSONConstants :: JSON_TYPE_CONTENTSTREAM_ALLOWED ] ) ) { $ data [ JSONConstants :: JSON_TYPE_CONTENTSTREAM_ALLOWED ] = ContentStreamAllowed :: cast ( $ data [ JSONConstants :: JSON_TYPE_CONTENTSTREAM_ALLOWED ] ) ; } } elseif ( $ typeDefinition instanceof MutableRelationshipTypeDefinitionInterface ) { $ data [ JSONConstants :: JSON_TYPE_ALLOWED_SOURCE_TYPES ] = array_map ( 'strval' , array_filter ( $ data [ JSONConstants :: JSON_TYPE_ALLOWED_SOURCE_TYPES ] ?? [ ] , function ( $ item ) { return ! empty ( $ item ) ; } ) ) ; $ data [ JSONConstants :: JSON_TYPE_ALLOWED_SOURCE_TYPES ] = array_map ( 'strval' , array_filter ( $ data [ JSONConstants :: JSON_TYPE_ALLOWED_SOURCE_TYPES ] ?? [ ] , function ( $ item ) { return ! empty ( $ item ) ; } ) ) ; $ data [ JSONConstants :: JSON_TYPE_ALLOWED_TARGET_TYPES ] = array_map ( 'strval' , array_filter ( $ data [ JSONConstants :: JSON_TYPE_ALLOWED_TARGET_TYPES ] ?? [ ] , function ( $ item ) { return ! empty ( $ item ) ; } ) ) ; } return $ data ; }
docstring: Convert specific type definition data so it can be populated to the type definition
  
  @param MutableTypeDefinitionInterface $typeDefinition The type definition to set the data to
  @param array $data The data that contains the values that should be applied to the object
  @return MutableTypeDefinitionInterface The type definition with the specific data applied
docstring_tokens: Convert specific type definition data so it can be populated to the type definition