class LoggingBeginner

Same name in this branch
  1. 11.x core/modules/package_manager/src/LoggingBeginner.php \Drupal\package_manager\LoggingBeginner

A composer-stager Beginner decorator that adds logging.

@internal

Hierarchy

Expanded class hierarchy of LoggingBeginner

1 file declares its use of LoggingBeginner
StageBaseTest.php in core/modules/package_manager/tests/src/Kernel/StageBaseTest.php

File

core/modules/package_manager/tests/modules/package_manager_bypass/src/LoggingBeginner.php, line 19

Namespace

Drupal\package_manager_bypass
View source
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);
    }

}

Members

Title Sort descending Modifiers Object type Summary
ComposerStagerExceptionTrait::setException public static function Sets an exception to be thrown.
ComposerStagerExceptionTrait::throwExceptionIfSet private function Throws the exception if set.
LoggingBeginner::$inner private property The decorated service.
LoggingBeginner::begin public function
LoggingBeginner::__construct public function Constructs a Beginner object.
LoggingDecoratorTrait::$state private property The state service.
LoggingDecoratorTrait::getInvocationArguments public function Returns the arguments from every invocation of the main class method.
LoggingDecoratorTrait::saveInvocationArguments private function Records the arguments from an invocation of the main class method.

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