Пример #1
0
 /**
  * Build the command and execute it.
  *
  * @param null|string $branchOrTreeIsh Name of the branch or tree.
  *
  * @param null|       $path            Path to which check out.
  *
  * @param null|string $_               More optional arguments to append to the command.
  *
  * @return mixed
  *
  * @SuppressWarnings(PHPMD.ShortVariableName)
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  * @SuppressWarnings(PHPMD.CamelCaseParameterName)
  */
 public function execute($branchOrTreeIsh = null, $path = null, $_ = null)
 {
     if ($branchOrTreeIsh) {
         $this->processBuilder->add($branchOrTreeIsh);
     }
     $paths = func_get_args();
     array_shift($paths);
     if (count($paths)) {
         $this->processBuilder->add('--');
         foreach ($paths as $path) {
             $this->processBuilder->add($path);
         }
     }
     return parent::run();
 }
Пример #2
0
 /**
  * Build the command and execute it.
  *
  * @param string      $repository Name of the remote to use (Defaults to origin).
  *
  * @param null|string $refspec    Refspec to fetch.
  *
  * @param null|string $_          More optional refspecs to commit.
  *
  * @return string
  *
  * @SuppressWarnings(PHPMD.ShortVariableName)
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  * @SuppressWarnings(PHPMD.CamelCaseParameterName)
  */
 public function execute($repository = 'origin', $refspec = null, $_ = null)
 {
     $this->processBuilder->add($repository);
     $refspecs = func_get_args();
     array_shift($refspecs);
     foreach ($refspecs as $refspec) {
         $this->processBuilder->add($refspec);
     }
     return parent::run();
 }
Пример #3
0
 /**
  * Build the command and execute it.
  *
  * @param null|string $pathspec Path spec.
  *
  * @param null|string $_        More optional path specs.
  *
  * @return string
  *
  * @SuppressWarnings(PHPMD.ShortVariableName)
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  * @SuppressWarnings(PHPMD.CamelCaseParameterName)
  */
 public function execute($pathspec = null, $_ = null)
 {
     $args = func_get_args();
     if (count($args)) {
         $this->processBuilder->add('--');
         foreach ($args as $pathspec) {
             $this->processBuilder->add($pathspec);
         }
     }
     return parent::run();
 }
Пример #4
0
 /**
  * Execute the command and return the output.
  *
  * @return string
  */
 public function execute()
 {
     $this->processBuilder->add($this->repository->getRepositoryPath());
     return parent::run();
 }
Пример #5
0
 /**
  * Build the command and execute it.
  *
  * @param null|string $name       Pass name of setting here to perform a basic get or set operation.
  *
  * @param null|string $value      Pass a value for the setting to turn this into a set command.
  *
  * @param null|string $valueRegex Pass a regex to limit changing of a multi-value setting to certain settings.
  *
  * @return mixed
  *
  * @SuppressWarnings(PHPMD.ShortVariableName)
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  * @SuppressWarnings(PHPMD.CamelCaseParameterName)
  */
 public function execute($name = null, $value = null, $valueRegex = null)
 {
     if ($name !== null) {
         $this->processBuilder->add($name);
         if ($value !== null) {
             $this->processBuilder->add($value);
             if ($valueRegex !== null) {
                 $this->processBuilder->add($valueRegex);
             }
         }
     }
     return parent::run();
 }
Пример #6
0
 /**
  * Build the command and execute it.
  *
  * @param string      $tagName Name of the tag.
  *
  * @param null|string $commit  Commit hash to tag.
  *
  * @return string
  *
  * @SuppressWarnings(PHPMD.ShortVariableName)
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  * @SuppressWarnings(PHPMD.CamelCaseParameterName)
  */
 public function execute($tagName, $commit = null)
 {
     if (!$this->signIsset && $this->repository->getConfig()->isSignTagsEnabled()) {
         $this->sign()->localUser($this->repository->getConfig()->getSignCommitUser());
     } else {
         if ($this->signIsset && !$this->localUserIsset && $this->repository->getConfig()->isSignTagsEnabled()) {
             $this->localUser($this->repository->getConfig()->getSignCommitUser());
         }
     }
     $this->processBuilder->add($tagName);
     if ($commit) {
         $this->processBuilder->add($commit);
     }
     return parent::run();
 }
 /**
  * Clone command
  */
 public function __clone()
 {
     parent::__clone();
     $commandList = array();
     foreach ($this->commandList as $command) {
         $commandList[] = clone $command;
     }
     $this->commandList = $commandList;
 }
Пример #8
0
 /**
  * Build the command and execute it.
  *
  * @param null|string $path Path to reset.
  *
  * @param null|string $_    More optional pathes to reset.
  *
  * @return string
  *
  * @SuppressWarnings(PHPMD.ShortVariableName)
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  * @SuppressWarnings(PHPMD.CamelCaseParameterName)
  */
 public function execute($path = null, $_ = null)
 {
     $this->processBuilder->add('--');
     foreach (func_get_args() as $path) {
         $this->processBuilder->add($path);
     }
     return parent::run();
 }
Пример #9
0
 /**
  * Build the command and execute it.
  *
  * @param null|       $pathspec Path to commit.
  *
  * @param null|string $_        More optional pathes to commit.
  *
  * @return string
  *
  * @SuppressWarnings(PHPMD.ShortVariableName)
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  * @SuppressWarnings(PHPMD.CamelCaseParameterName)
  */
 public function execute($pathspec = null, $_ = null)
 {
     // prevent launching the editor
     $this->processBuilder->add('--no-edit');
     if (!$this->gpgSignIsset && $this->repository->getConfig()->isSignCommitsEnabled()) {
         $this->gpgSign($this->repository->getConfig()->getSignCommitUser());
     }
     $args = func_get_args();
     if (count($args)) {
         $this->processBuilder->add('--');
         foreach ($args as $pathspec) {
             $this->processBuilder->add($pathspec);
         }
     }
     return parent::run();
 }
Пример #10
0
 /**
  * Execute the command and return the result.
  *
  * @param string $commit The commit to describe (defaults to HEAD).
  *
  * @return string
  */
 public function execute($commit = 'HEAD')
 {
     $this->processBuilder->add($commit);
     return parent::run();
 }
Пример #11
0
 /**
  * Build the command and execute it.
  *
  * @param string $object Name of the object to show.
  *
  * @return string
  *
  * @SuppressWarnings(PHPMD.ShortVariableName)
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  * @SuppressWarnings(PHPMD.CamelCaseParameterName)
  */
 public function execute($object)
 {
     $this->processBuilder->add($object);
     return parent::run();
 }
Пример #12
0
 /**
  * Execute the command and return the result.
  *
  * @param null|string $branchName Optionally the branch name on which to work on.
  *
  * @return string
  */
 public function execute($branchName = null)
 {
     if ($branchName) {
         $this->processBuilder->add($branchName);
     }
     return parent::run();
 }
Пример #13
0
 /**
  * Build the command and execute it.
  *
  * @param null|string $arg Optional additional argument.
  *
  * @param null|string $_   More optional arguments.
  *
  * @return string
  *
  * @SuppressWarnings(PHPMD.ShortVariableName)
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  * @SuppressWarnings(PHPMD.CamelCaseParameterName)
  */
 public function execute($arg = null, $_ = null)
 {
     foreach (func_get_args() as $arg) {
         $this->processBuilder->add($arg);
     }
     return parent::run();
 }