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

Decoded Output download

<?php

final class HeraldAdapterDatasource
  extends PhabricatorTypeaheadDatasource {

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

  public function getPlaceholderText() {
    return pht('Type an adapter name...');
  }

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

  public function loadResults() {
    $results = $this->buildResults();
    return $this->filterResultsAgainstTokens($results);
  }

  protected function renderSpecialTokens(array $values) {
    return $this->renderTokensFromResults($this->buildResults(), $values);
  }

  private function buildResults() {
    $results = array();

    $adapters = HeraldAdapter::getAllAdapters();
    foreach ($adapters as $adapter) {
      $value = $adapter->getAdapterContentType();
      $name = $adapter->getAdapterContentName();

      $result = id(new PhabricatorTypeaheadResult())
        ->setPHID($value)
        ->setName($name);

      $results[$value] = $result;
    }

    return $results;
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class HeraldAdapterDatasource
  extends PhabricatorTypeaheadDatasource {

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

  public function getPlaceholderText() {
    return pht('Type an adapter name...');
  }

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

  public function loadResults() {
    $results = $this->buildResults();
    return $this->filterResultsAgainstTokens($results);
  }

  protected function renderSpecialTokens(array $values) {
    return $this->renderTokensFromResults($this->buildResults(), $values);
  }

  private function buildResults() {
    $results = array();

    $adapters = HeraldAdapter::getAllAdapters();
    foreach ($adapters as $adapter) {
      $value = $adapter->getAdapterContentType();
      $name = $adapter->getAdapterContentName();

      $result = id(new PhabricatorTypeaheadResult())
        ->setPHID($value)
        ->setName($name);

      $results[$value] = $result;
    }

    return $results;
  }

}

Function Calls

None

Variables

None

Stats

MD5 41b79829a25f8323d0ddfc915b7fdbf7
Eval Count 0
Decode Time 115 ms