Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CompiledClassMetadataFactory.php

function CompiledClassMetadataFactory::__construct

File

vendor/symfony/serializer/Mapping/Factory/CompiledClassMetadataFactory.php, line 28

Class

CompiledClassMetadataFactory
@author Fabien Bourigault <bourigaultfabien@gmail.com>

Namespace

Symfony\Component\Serializer\Mapping\Factory

Code

public function __construct(string $compiledClassMetadataFile, ClassMetadataFactoryInterface $classMetadataFactory) {
    if (!file_exists($compiledClassMetadataFile)) {
        throw new \RuntimeException("File \"{$compiledClassMetadataFile}\" could not be found.");
    }
    $compiledClassMetadata = (require $compiledClassMetadataFile);
    if (!\is_array($compiledClassMetadata)) {
        throw new \RuntimeException(\sprintf('Compiled metadata must be of the type array, %s given.', \gettype($compiledClassMetadata)));
    }
    $this->compiledClassMetadata = $compiledClassMetadata;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal