コード例 #1
0
 /**
  * Finalizes any cleanup operations that need to occur regardless of
  * whether the command succeeded or failed.
  */
 public function finalize()
 {
     // TODO: Remove this once ArcanistBaseWorkflow is gone.
     if ($this instanceof ArcanistBaseWorkflow) {
         phutil_deprecated('ArcanistBaseWorkflow', 'You should extend from `ArcanistWorkflow` instead.');
     }
     $this->finalizeWorkingCopy();
 }
コード例 #2
0
 public final function setWorkingCopy(ArcanistWorkingCopyIdentity $working_copy)
 {
     // TODO: Remove this once ArcanistBaseUnitTestEngine is gone.
     if ($this instanceof ArcanistBaseUnitTestEngine) {
         phutil_deprecated('ArcanistBaseUnitTestEngine', 'You should extend from `ArcanistUnitTestEngine` instead.');
     }
     $this->workingCopy = $working_copy;
     return $this;
 }
コード例 #3
0
 /**
  * TODO: This should be abstract, but is not for historical reasons.
  */
 public function getName()
 {
     phutil_deprecated('Automatic naming of `PhabricatorApplication` classes.', 'You should override the `getName` method.');
     $match = null;
     $regex = '/^PhabricatorApplication([A-Z][a-zA-Z]*)$/';
     if (preg_match($regex, get_class($this), $match)) {
         return $match[1];
     }
     throw new PhutilMethodNotImplementedException();
 }
コード例 #4
0
 /**
  * Deprecated. See @{method:getUserPHID}.
  *
  * @deprecated
  */
 public final function getUserGUID()
 {
     phutil_deprecated('ArcanistBaseWorkflow::getUserGUID', 'This method has been renamed to getUserPHID().');
     return $this->getUserPHID();
 }
コード例 #5
0
 public function setLinterConfigurationValue($key, $value)
 {
     switch ($key) {
         case 'interpreter':
             $working_copy = $this->getEngine()->getWorkingCopy();
             $root = $working_copy->getProjectRoot();
             foreach ((array) $value as $path) {
                 if (Filesystem::binaryExists($path)) {
                     $this->setInterpreter($path);
                     return;
                 }
                 $path = Filesystem::resolvePath($path, $root);
                 if (Filesystem::binaryExists($path)) {
                     $this->setInterpreter($path);
                     return;
                 }
             }
             throw new Exception(pht('None of the configured interpreters can be located.'));
         case 'bin':
             $is_script = $this->shouldUseInterpreter();
             $working_copy = $this->getEngine()->getWorkingCopy();
             $root = $working_copy->getProjectRoot();
             foreach ((array) $value as $path) {
                 if (!$is_script && Filesystem::binaryExists($path)) {
                     $this->setBinary($path);
                     return;
                 }
                 $path = Filesystem::resolvePath($path, $root);
                 if (!$is_script && Filesystem::binaryExists($path) || $is_script && Filesystem::pathExists($path)) {
                     $this->setBinary($path);
                     return;
                 }
             }
             throw new Exception(pht('None of the configured binaries can be located.'));
         case 'flags':
             if (!is_array($value)) {
                 phutil_deprecated('String support for flags.', 'You should use list<string> instead.');
                 $value = (array) $value;
             }
             $this->setFlags($value);
             return;
     }
     return parent::setLinterConfigurationValue($key, $value);
 }