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

Breadcrumb

  1. Drupal Core 11.1.x

StagingDirDoesNotExist.php

Namespace

PhpTuf\ComposerStager\Internal\Precondition\Service

File

vendor/php-tuf/composer-stager/src/Internal/Precondition/Service/StagingDirDoesNotExist.php

View source
<?php

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

use PhpTuf\ComposerStager\API\Environment\Service\EnvironmentInterface;
use PhpTuf\ComposerStager\API\Exception\PreconditionException;
use PhpTuf\ComposerStager\API\Filesystem\Service\FilesystemInterface;
use PhpTuf\ComposerStager\API\Path\Value\PathInterface;
use PhpTuf\ComposerStager\API\Path\Value\PathListInterface;
use PhpTuf\ComposerStager\API\Precondition\Service\StagingDirDoesNotExistInterface;
use PhpTuf\ComposerStager\API\Process\Service\ProcessInterface;
use PhpTuf\ComposerStager\API\Translation\Factory\TranslatableFactoryInterface;
use PhpTuf\ComposerStager\API\Translation\Value\TranslatableInterface;

/**
 * @package Precondition
 *
 * @internal Don't depend directly on this class. It may be changed or removed at any time without notice.
 */
final class StagingDirDoesNotExist extends AbstractPrecondition implements StagingDirDoesNotExistInterface {
    public function __construct(EnvironmentInterface $environment, FilesystemInterface $filesystem, TranslatableFactoryInterface $translatableFactory) {
        parent::__construct($environment, $translatableFactory);
    }
    public function getName() : TranslatableInterface {
        return $this->t('Staging directory does not exist');
    }
    public function getDescription() : TranslatableInterface {
        return $this->t('The staging directory must not already exist before beginning the staging process.');
    }
    protected function getFulfilledStatusMessage() : TranslatableInterface {
        return $this->t('The staging directory does not already exist.');
    }
    protected function doAssertIsFulfilled(PathInterface $activeDir, PathInterface $stagingDir, ?PathListInterface $exclusions = null, int $timeout = ProcessInterface::DEFAULT_TIMEOUT) : void {
        if ($this->filesystem
            ->fileExists($stagingDir)) {
            throw new PreconditionException($this, $this->t('The staging directory already exists.', null, $this->d()
                ->exceptions()));
        }
    }

}

Classes

Title Deprecated Summary
StagingDirDoesNotExist @package Precondition

API Navigation

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