Skip to content
Snippets Groups Projects
BaseHandlerInterface.php 1.53 KiB
<?php

namespace LakeDrops\Component\Composer;

use Composer\Script\Event;
use Symfony\Component\Console\Input\InputInterface;

/**
 * Interface for BaseHandler.
 *
 * @package LakeDrops\Component\Composer
 */
interface BaseHandlerInterface {

  /**
   * @param \Composer\Script\Event $event
   */
  public function setEvent(Event $event);

  /**
   * @param \Symfony\Component\Console\Input\InputInterface $input
   */
  public function setInput(InputInterface $input);

  /**
   * Look up the Drupal core package object.
   *
   * @return \Composer\Package\PackageInterface
   *   The Drupal core package.
   */
  public function getDrupalCorePackage();

  /**
   * 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
   *   The package.
   */
  public function getPackage($name);

  /**
   * @return bool
   */
  public function isDevMode();

  /**
   * @return bool
   */
  public function isLocalDevMode();

  /**
   * Determine if the current process runs in a CI/CD context.
   *
   * @return bool
   */
  public function isCiContext();

  /**
   * Wrapper for git command in the root directory.
   *
   * @param string $command
   *   Git command name, arguments and/or options.
   */
  public function git($command);

  /**
   * Add the given pattern to gitignore if necessary.
   *
   * @param string $pattern
   *   The pattern which should be ignored.
   */
  public function gitIgnore($pattern);

}