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

Breadcrumb

  1. Drupal Core 11.1.x

ExecutableFinder.php

Same filename in this branch
  1. 11.1.x vendor/php-tuf/composer-stager/src/Internal/Finder/Service/ExecutableFinder.php
  2. 11.1.x vendor/symfony/process/ExecutableFinder.php

Namespace

Drupal\package_manager

File

core/modules/package_manager/src/ExecutableFinder.php

View source
<?php

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

use Drupal\Core\Config\ConfigFactoryInterface;
use PhpTuf\ComposerStager\API\Finder\Service\ExecutableFinderInterface;

/**
 * An executable finder which looks for executable paths in configuration.
 *
 * @internal
 *   This is an internal part of Package Manager and may be changed or removed
 *   at any time without warning. External code should not interact with this
 *   class.
 */
final class ExecutableFinder implements ExecutableFinderInterface {
    public function __construct(ExecutableFinderInterface $decorated, ConfigFactoryInterface $configFactory) {
    }
    
    /**
     * {@inheritdoc}
     */
    public function find(string $name) : string {
        $executables = $this->configFactory
            ->get('package_manager.settings')
            ->get('executables');
        return $executables[$name] ?? $this->decorated
            ->find($name);
    }

}

Classes

Title Deprecated Summary
ExecutableFinder An executable finder which looks for executable paths in configuration.
RSS feed
Powered by Drupal