clean install

This commit is contained in:
matze committed 2024-12-10 15:08:16 +01:00
commit e14eb2d8fd
31193 files changed
+3555714

No files matched your search

@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
namespace DrupalCodeGenerator\Event;
use DrupalCodeGenerator\Asset\AssetCollection;
/**
* Fired after dumped assets.
*/
final class AssetPostProcess {
/**
* Constructs the event object.
*/
public function __construct(
public AssetCollection $assets,
// Unlike PreProcessEvent::$destination this one is readonly as there is no
// point in modifying it after dumping the assets.
public readonly string $destination,
public readonly string $commandName,
public readonly bool $isDry,
) {}
}
@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace DrupalCodeGenerator\Event;
use DrupalCodeGenerator\Asset\AssetCollection;
/**
* Fired before dumping assets.
*/
final class AssetPreProcess {
/**
* Constructs the event object.
*/
public function __construct(
public AssetCollection $assets,
public string $destination,
public readonly string $commandName,
public readonly bool $isDry,
) {}
}
@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
namespace DrupalCodeGenerator\Event;
use Symfony\Component\Console\Command\Command;
/**
* Fired when registering generators.
*/
final class GeneratorInfo {
/**
* @psalm-param list<\Symfony\Component\Console\Command\Command> $generators
*/
private array $generators = [];
/**
* Constructs the generator info object.
*
* The generators are passed by reference as there are no getters for them.
* That isolates data from listeners.
*
* @psalm-param list<\Symfony\Component\Console\Command\Command> $generators
*/
public function __construct(array &$generators) {
$this->generators = &$generators;
}
/**
* Adds generators.
*/
public function addGenerators(Command ...$generators): void {
$this->generators = \array_merge($this->generators, $generators);
}
}
@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace DrupalCodeGenerator\Event;
/**
* Fired when altering registered generators.
*/
final class GeneratorInfoAlter {
/**
* @psalm-param list<\Symfony\Component\Console\Command\Command> $generators
*/
public array $generators = [];
/**
* Constructs the event object.
*
* @psalm-param list<\Symfony\Component\Console\Command\Command> $generators
*/
public function __construct(array $generators) {
// Index generators by name to ease access.
foreach ($generators as $generator) {
/** @psalm-suppress PossiblyNullArrayOffset */
$this->generators[$generator->getName()] = $generator;
}
}
}