original_string: public function appendCollectionAttributes(
          array $data,
          ErrorCollection $error,
          string $format,
          array $context
      ): array {
          $innerError = new ErrorResource(
              $error->getMessage(),
              $error->getReason(),
              $error->getPath(),
              $error->getAttributes(),
              $error->getIdentifier()
          );
  
          foreach ($error->getRelations() as $relation) {
              $innerError->addRelation($relation);
          }
  
          $normalizedInnerError = $this->normalizer->normalize($innerError, $format, $context);
  
          return array_merge($normalizedInnerError, $data);
      }
code: public function appendCollectionAttributes(
          array $data,
          ErrorCollection $error,
          string $format,
          array $context
      ): array {
          $innerError = new ErrorResource(
              $error->getMessage(),
              $error->getReason(),
              $error->getPath(),
              $error->getAttributes(),
              $error->getIdentifier()
          );
  
          foreach ($error->getRelations() as $relation) {
              $innerError->addRelation($relation);
          }
  
          $normalizedInnerError = $this->normalizer->normalize($innerError, $format, $context);
  
          return array_merge($normalizedInnerError, $data);
      }
code_tokens: public function appendCollectionAttributes ( array $ data , ErrorCollection $ error , string $ format , array $ context ) : array { $ innerError = new ErrorResource ( $ error -> getMessage ( ) , $ error -> getReason ( ) , $ error -> getPath ( ) , $ error -> getAttributes ( ) , $ error -> getIdentifier ( ) ) ; foreach ( $ error -> getRelations ( ) as $ relation ) { $ innerError -> addRelation ( $ relation ) ; } $ normalizedInnerError = $ this -> normalizer -> normalize ( $ innerError , $ format , $ context ) ; return array_merge ( $ normalizedInnerError , $ data ) ; }
docstring: Append collection attributes to
  
  @param array           $data
  @param ErrorCollection $error
  @param string          $format
  @param array           $context
  
  @return array
docstring_tokens: Append collection attributes to