Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php final class DiffusionInternalAncestorsConduitAPIMethod extends DiffusionQueryCond..

Decoded Output download

<?php

final class DiffusionInternalAncestorsConduitAPIMethod
  extends DiffusionQueryConduitAPIMethod {

  public function isInternalAPI() {
    return true;
  }

  public function getAPIMethodName() {
    return 'diffusion.internal.ancestors';
  }

  public function getMethodDescription() {
    return pht('Internal method for filtering ref ancestors.');
  }

  protected function defineReturnType() {
    return 'list<string>';
  }

  protected function defineCustomParamTypes() {
    return array(
      'ref' => 'required string',
      'commits' => 'required list<string>',
    );
  }

  protected function getResult(ConduitAPIRequest $request) {
    $drequest = $this->getDiffusionRequest();
    $repository = $drequest->getRepository();

    $commits = $request->getValue('commits');
    $ref = $request->getValue('ref');

    $graph = new PhabricatorGitGraphStream($repository, $ref);

    $keep = array();
    foreach ($commits as $identifier) {
      try {
        $graph->getCommitDate($identifier);
        $keep[] = $identifier;
      } catch (Exception $ex) {
        // Not an ancestor.
      }
    }

    return $keep;
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class DiffusionInternalAncestorsConduitAPIMethod
  extends DiffusionQueryConduitAPIMethod {

  public function isInternalAPI() {
    return true;
  }

  public function getAPIMethodName() {
    return 'diffusion.internal.ancestors';
  }

  public function getMethodDescription() {
    return pht('Internal method for filtering ref ancestors.');
  }

  protected function defineReturnType() {
    return 'list<string>';
  }

  protected function defineCustomParamTypes() {
    return array(
      'ref' => 'required string',
      'commits' => 'required list<string>',
    );
  }

  protected function getResult(ConduitAPIRequest $request) {
    $drequest = $this->getDiffusionRequest();
    $repository = $drequest->getRepository();

    $commits = $request->getValue('commits');
    $ref = $request->getValue('ref');

    $graph = new PhabricatorGitGraphStream($repository, $ref);

    $keep = array();
    foreach ($commits as $identifier) {
      try {
        $graph->getCommitDate($identifier);
        $keep[] = $identifier;
      } catch (Exception $ex) {
        // Not an ancestor.
      }
    }

    return $keep;
  }

}

Function Calls

None

Variables

None

Stats

MD5 cd3949644c5010b561d947b3a39f2f0b
Eval Count 0
Decode Time 77 ms