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 DrydockBlueprintDatasource extends PhabricatorTypeaheadDatasource { ..

Decoded Output download

<?php

final class DrydockBlueprintDatasource
  extends PhabricatorTypeaheadDatasource {

  public function getPlaceholderText() {
    return pht('Type a blueprint name...');
  }

  public function getBrowseTitle() {
    return pht('Browse Blueprints');
  }

  public function getDatasourceApplicationClass() {
    return 'PhabricatorDrydockApplication';
  }

  public function loadResults() {
    $viewer = $this->getViewer();
    $raw_query = $this->getRawQuery();

    $blueprints = id(new DrydockBlueprintQuery())
      ->setViewer($viewer)
      ->withDatasourceQuery($raw_query)
      ->execute();

    $handles = id(new PhabricatorHandleQuery())
      ->setViewer($viewer)
      ->withPHIDs(mpull($blueprints, 'getPHID'))
      ->execute();

    $results = array();
    foreach ($blueprints as $blueprint) {
      $handle = $handles[$blueprint->getPHID()];

      $result = id(new PhabricatorTypeaheadResult())
        ->setName($handle->getFullName())
        ->setPHID($handle->getPHID());

      if ($blueprint->getIsDisabled()) {
        $result->setClosed(pht('Disabled'));
      }

      $result->addAttribute(
        $blueprint->getImplementation()->getBlueprintName());

      $results[] = $result;
    }

    return $results;
  }
}
 ?>

Did this file decode correctly?

Original Code

<?php

final class DrydockBlueprintDatasource
  extends PhabricatorTypeaheadDatasource {

  public function getPlaceholderText() {
    return pht('Type a blueprint name...');
  }

  public function getBrowseTitle() {
    return pht('Browse Blueprints');
  }

  public function getDatasourceApplicationClass() {
    return 'PhabricatorDrydockApplication';
  }

  public function loadResults() {
    $viewer = $this->getViewer();
    $raw_query = $this->getRawQuery();

    $blueprints = id(new DrydockBlueprintQuery())
      ->setViewer($viewer)
      ->withDatasourceQuery($raw_query)
      ->execute();

    $handles = id(new PhabricatorHandleQuery())
      ->setViewer($viewer)
      ->withPHIDs(mpull($blueprints, 'getPHID'))
      ->execute();

    $results = array();
    foreach ($blueprints as $blueprint) {
      $handle = $handles[$blueprint->getPHID()];

      $result = id(new PhabricatorTypeaheadResult())
        ->setName($handle->getFullName())
        ->setPHID($handle->getPHID());

      if ($blueprint->getIsDisabled()) {
        $result->setClosed(pht('Disabled'));
      }

      $result->addAttribute(
        $blueprint->getImplementation()->getBlueprintName());

      $results[] = $result;
    }

    return $results;
  }
}

Function Calls

None

Variables

None

Stats

MD5 7b0b3be0667ab048bf54166bcc50edd2
Eval Count 0
Decode Time 89 ms