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

Breadcrumb

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

function PostFileDownloadEvent::__construct

Constructor.

Parameters

string $name The event name:

string|null $fileName The file name:

string|null $checksum The checksum:

string $url The processed url:

string $type The type (package or metadata).:

mixed $context Additional context for the download.:

Overrides Event::__construct

File

vendor/composer/composer/src/Composer/Plugin/PostFileDownloadEvent.php, line 60

Class

PostFileDownloadEvent
The post file download event.

Namespace

Composer\Plugin

Code

public function __construct(string $name, ?string $fileName, ?string $checksum, string $url, string $type, $context = null) {
    
    /** @phpstan-ignore instanceof.alwaysFalse, booleanAnd.alwaysFalse */
    if ($context === null && $type instanceof PackageInterface) {
        $context = $type;
        $type = 'package';
        trigger_error('PostFileDownloadEvent::__construct should receive a $type=package and the package object in $context since Composer 2.1.', E_USER_DEPRECATED);
    }
    parent::__construct($name);
    $this->fileName = $fileName;
    $this->checksum = $checksum;
    $this->url = $url;
    $this->context = $context;
    $this->type = $type;
}
RSS feed
Powered by Drupal