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

Breadcrumb

  1. Drupal Core 11.1.x

OutputCallbackAdapter.php

Namespace

PhpTuf\ComposerStager\Internal\Process\Service

File

vendor/php-tuf/composer-stager/src/Internal/Process/Service/OutputCallbackAdapter.php

View source
<?php

declare (strict_types=1);
namespace PhpTuf\ComposerStager\Internal\Process\Service;

use PhpTuf\ComposerStager\API\Process\Service\OutputCallbackInterface;
use PhpTuf\ComposerStager\API\Process\Value\OutputTypeEnum;
use Symfony\Component\Process\Process as SymfonyProcess;

/**
 * @package Process
 *
 * @internal Don't depend directly on this class. It may be changed or removed at any time without notice.
 */
final class OutputCallbackAdapter implements OutputCallbackAdapterInterface {
    public function __construct(?OutputCallbackInterface $callback = null) {
    }
    public function __invoke(string $type, string $buffer) : void {
        if (!$this->callback instanceof OutputCallbackInterface) {
            return;
        }
        $enumType = $type === SymfonyProcess::OUT ? OutputTypeEnum::OUT : OutputTypeEnum::ERR;
        call_user_func($this->callback, $enumType, $buffer);
    }

}

Classes

Title Deprecated Summary
OutputCallbackAdapter @package Process

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal