Exemplo n.º 1
0
 /**
  * get a string of CLI-formatted subjects
  *
  * @throws \RuntimeException
  * @return string The subjects string
  */
 private function getCLISubjects()
 {
     $command = '';
     if (!is_null($this->commandSubject)) {
         $command .= ' ';
         if ($this->commandSubject instanceof SubCommandCommand) {
             $command .= $this->commandSubject->getCommand();
         } else {
             if (is_array($this->commandSubject)) {
                 $command .= implode(' ', array_map('escapeshellarg', $this->commandSubject));
             } else {
                 $command .= escapeshellarg($this->commandSubject);
             }
         }
     }
     if (!is_null($this->commandSubject2)) {
         $command .= ' ';
         if ($this->commandSubject2 instanceof SubCommandCommand) {
             $command .= $this->commandSubject2->getCommand();
         } else {
             if (is_array($this->commandSubject2)) {
                 $command .= implode(' ', array_map('escapeshellarg', $this->commandSubject2));
             } else {
                 $command .= escapeshellarg($this->commandSubject2);
             }
         }
     }
     return $command;
 }
Exemplo n.º 2
0
 /**
  * get a string of CLI-formatted subjects
  *
  * @throws \RuntimeException
  * @return string The subjects string
  */
 private function getCLISubjects()
 {
     $command = '';
     if (!is_null($this->commandSubject)) {
         $command .= ' ';
         if ($this->commandSubject instanceof SubCommandCommand) {
             $command .= $this->commandSubject->getCommand();
         } else {
             $command .= escapeshellarg($this->commandSubject);
         }
     }
     if (!is_null($this->commandSubject2)) {
         $command .= ' ';
         if ($this->commandSubject2 instanceof SubCommandCommand) {
             $command .= $this->commandSubject2->getCommand();
         } else {
             $command .= escapeshellarg($this->commandSubject2);
         }
     }
     return $command;
 }
Exemplo n.º 3
0
 /**
  * constructor
  *
  * @param \GitElephant\Repository $repo The repository object this command 
  *                                      will interact with
  */
 public function __construct(Repository $repo = null)
 {
     parent::__construct($repo);
 }