LoggingBeginner.php

Same filename in this branch
  1. 11.x core/modules/package_manager/src/LoggingBeginner.php

Namespace

Drupal\package_manager_bypass

File

core/modules/package_manager/tests/modules/package_manager_bypass/src/LoggingBeginner.php

View source
<?php

declare (strict_types=1);
namespace Drupal\package_manager_bypass;

use Drupal\Core\State\StateInterface;
use PhpTuf\ComposerStager\API\Core\BeginnerInterface;
use PhpTuf\ComposerStager\API\Path\Value\PathInterface;
use PhpTuf\ComposerStager\API\Path\Value\PathListInterface;
use PhpTuf\ComposerStager\API\Process\Service\OutputCallbackInterface;
use PhpTuf\ComposerStager\API\Process\Service\ProcessInterface;

/**
 * A composer-stager Beginner decorator that adds logging.
 *
 * @internal
 */
final class LoggingBeginner implements BeginnerInterface {
    use ComposerStagerExceptionTrait;
    use LoggingDecoratorTrait;
    
    /**
     * The decorated service.
     *
     * @var \PhpTuf\ComposerStager\API\Core\BeginnerInterface
     */
    private $inner;
    
    /**
     * Constructs a Beginner object.
     *
     * @param \Drupal\Core\State\StateInterface $state
     *   The state service.
     * @param \PhpTuf\ComposerStager\API\Core\BeginnerInterface $inner
     *   The decorated beginner service.
     */
    public function __construct(StateInterface $state, BeginnerInterface $inner) {
        $this->state = $state;
        $this->inner = $inner;
    }
    
    /**
     * {@inheritdoc}
     */
    public function begin(PathInterface $activeDir, PathInterface $stagingDir, ?PathListInterface $exclusions = NULL, ?OutputCallbackInterface $callback = NULL, ?int $timeout = ProcessInterface::DEFAULT_TIMEOUT) : void {
        $this->saveInvocationArguments($activeDir, $stagingDir, $exclusions?->getAll(), $timeout);
        $this->throwExceptionIfSet();
        $this->inner
            ->begin($activeDir, $stagingDir, $exclusions, $callback, $timeout);
    }

}

Classes

Title Deprecated Summary
LoggingBeginner A composer-stager Beginner decorator that adds logging.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.