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

Breadcrumb

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

function FilesystemRepository::__construct

Initializes filesystem repository.

Parameters

JsonFile $repositoryFile repository json file:

?RootPackageInterface $rootPackage Must be provided if $dumpVersions is true:

Overrides ArrayRepository::__construct

File

vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php, line 52

Class

FilesystemRepository
Filesystem repository.

Namespace

Composer\Repository

Code

public function __construct(JsonFile $repositoryFile, bool $dumpVersions = false, ?RootPackageInterface $rootPackage = null, ?Filesystem $filesystem = null) {
    parent::__construct();
    $this->file = $repositoryFile;
    $this->dumpVersions = $dumpVersions;
    $this->rootPackage = $rootPackage;
    $this->filesystem = $filesystem ?: new Filesystem();
    if ($dumpVersions && !$rootPackage) {
        throw new \InvalidArgumentException('Expected a root package instance if $dumpVersions is true');
    }
}
RSS feed
Powered by Drupal