src/Metadata/Property/Factory/ExtractorPropertyMetadataFactory.php
private function createSubresourceMetadata($subresource, PropertyMetadata $propertyMetadata): ?SubresourceMetadata
    {
        if (!$subresource) {
            return null;
        }

        $type = $propertyMetadata->getType();
        $maxDepth = \is_array($subresource) ? $subresource['maxDepth'] ?? null : null;

        if (null !== $type) {
            $isCollection = $type->isCollection();
            $resourceClass = $isCollection && ($collectionValueType = $type->getCollectionValueType()) ? $collectionValueType->getClassName() : $type->getClassName();
        } elseif (\is_array($subresource) && isset($subresource['resourceClass'])) {
            $resourceClass = $subresource['resourceClass'];
            $isCollection = $subresource['collection'] ?? true;
        } else {
            return null;
        }

        return new SubresourceMetadata($resourceClass, $isCollection, $maxDepth);
    }
private function createSubresourceMetadata($subresource, PropertyMetadata $propertyMetadata): ?SubresourceMetadata
    {
        if (!$subresource) {
            return null;
        }

        $type = $propertyMetadata->getType();
        $maxDepth = \is_array($subresource) ? $subresource['maxDepth'] ?? null : null;

        if (null !== $type) {
            $isCollection = $type->isCollection();
            $resourceClass = $isCollection && ($collectionValueType = $type->getCollectionValueType()) ? $collectionValueType->getClassName() : $type->getClassName();
        } elseif (\is_array($subresource) && isset($subresource['resourceClass'])) {
            $resourceClass = $subresource['resourceClass'];
            $isCollection = $subresource['collection'] ?? true;
        } else {
            return null;
        }

        return new SubresourceMetadata($resourceClass, $isCollection, $maxDepth);
    }
private function createSubresourceMetadata ( $ subresource , PropertyMetadata $ propertyMetadata ) : ? SubresourceMetadata { if ( ! $ subresource ) { return null ; } $ type = $ propertyMetadata -> getType ( ) ; $ maxDepth = \ is_array ( $ subresource ) ? $ subresource [ 'maxDepth' ] ?? null : null ; if ( null !== $ type ) { $ isCollection = $ type -> isCollection ( ) ; $ resourceClass = $ isCollection && ( $ collectionValueType = $ type -> getCollectionValueType ( ) ) ? $ collectionValueType -> getClassName ( ) : $ type -> getClassName ( ) ; } elseif ( \ is_array ( $ subresource ) && isset ( $ subresource [ 'resourceClass' ] ) ) { $ resourceClass = $ subresource [ 'resourceClass' ] ; $ isCollection = $ subresource [ 'collection' ] ?? true ; } else { return null ; } return new SubresourceMetadata ( $ resourceClass , $ isCollection , $ maxDepth ) ; }
Creates a SubresourceMetadata.

@param bool|array|null  $subresource      the subresource metadata coming from XML or YAML
@param PropertyMetadata $propertyMetadata the current property metadata
Creates a SubresourceMetadata .