class ComposerNotReadyException

Exception thrown if we cannot reliably use Composer.

Should not be thrown by external code.

Hierarchy

Expanded class hierarchy of ComposerNotReadyException

See also

\Drupal\package_manager\ComposerInspector::validate()

2 files declare their use of ComposerNotReadyException
ComposerInspector.php in core/modules/package_manager/src/ComposerInspector.php
ComposerInspectorTest.php in core/modules/package_manager/tests/src/Kernel/ComposerInspectorTest.php

File

core/modules/package_manager/src/Exception/ComposerNotReadyException.php, line 14

Namespace

Drupal\package_manager\Exception
View source
final class ComposerNotReadyException extends \RuntimeException {
    
    /**
     * Constructs a ComposerNotReadyException object.
     *
     * @param string|null $workingDir
     *   The directory where Composer was run, or NULL if the errors are related
     *   to the Composer executable itself.
     * @param array $messages
     *   An array of messages explaining why Composer cannot be run correctly.
     * @param int $code
     *   (optional) The exception code. Defaults to 0.
     * @param \Throwable|null $previous
     *   (optional) The previous exception, for exception chaining.
     */
    public function __construct(?string $workingDir, array $messages, int $code = 0, ?\Throwable $previous = NULL) {
        parent::__construct(implode("\n", $messages), $code, $previous);
    }

}

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