-
jurgenhaas authoredjurgenhaas authored
BaseHandlerInterface.php 2.66 KiB
<?php
namespace LakeDrops\Component\Composer;
use Composer\Package\PackageInterface;
use Composer\Script\Event;
use Symfony\Component\Console\Input\InputInterface;
/**
* Interface for BaseHandler.
*
* @package LakeDrops\Component\Composer
*/
interface BaseHandlerInterface {
/**
* Provides the cofig Id.
*
* @return string
* The config Id.
*/
public function configId(): string;
/**
* Sets the composer event.
*
* @param \Composer\Script\Event $event
* The composer event.
*
* @return self
* This hanlder.
*/
public function setEvent(Event $event): BaseHandlerInterface;
/**
* Sets the input handler.
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* The input handler.
*
* @return self
* This hanlder.
*/
public function setInput(InputInterface $input): BaseHandlerInterface;
/**
* Look up the Drupal core package object.
*
* @return \Composer\Package\PackageInterface|null
* The Drupal core package.
*/
public function getDrupalCorePackage(): ?PackageInterface;
/**
* Retrieve a package from the current composer process.
*
* @param string $name
* Name of the package to get from the current composer installation.
*
* @return \Composer\Package\PackageInterface|null
* The package.
*/
public function getPackage(string $name): ?PackageInterface;
/**
* Determines if this is running in development mode.
*
* @return bool
* TRUE, if executing in development mode, FALSE otherwise.
*/
public function isDevMode(): bool;
/**
* Determines if this is running in local development mode.
*
* @return bool
* TRUE, if executing in local development mode, FALSE otherwise.
*/
public function isLocalDevMode(): bool;
/**
* Determine if the current process runs in a CI/CD context.
*
* @return bool
* TRUE, if executing in CI/CD context, FALSE otherwise.
*/
public function isCiContext(): bool;
/**
* Wrapper for git command in the root directory.
*
* @param string $command
* Git command name, arguments and/or options.
* @param string|null $path
* Optional path into which to chdir before executing command.
*/
public function git(string $command, string $path = NULL): void;
/**
* Add the given pattern to gitignore if necessary.
*
* @param string $pattern
* The pattern which should be ignored.
*/
public function gitIgnore(string $pattern): void;
/**
* Add the given pattern to git lfs if necessary.
*
* @param string $pattern
* The pattern which should be added.
*/
public function gitLfs(string $pattern): void;
}