Files
pterodactyl-panel/app/Services/Extensions/ExtensionActionExtender.php
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

30 lines
741 B
PHP

<?php
declare(strict_types=1);
namespace Pterodactyl\Services\Extensions;
/**
* The single container extender installed for a wrapped action contract. It carries no
* decorators of its own: every resolution asks the registry which ones currently apply.
*
* @template TContract of object
*/
final readonly class ExtensionActionExtender
{
/** @param class-string<TContract> $contract */
public function __construct(
private ExtensionActionDecorators $decorators,
private string $contract,
) {}
/**
* @param TContract $action
* @return TContract
*/
public function __invoke(object $action): object
{
return $this->decorators->decorate($this->contract, $action);
}
}