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 PhabricatorPackagesPackageSearchEngine extends PhabricatorApplication..

Decoded Output download

<?php

final class PhabricatorPackagesPackageSearchEngine
  extends PhabricatorApplicationSearchEngine {

  public function getResultTypeDescription() {
    return pht('Packages');
  }

  public function getApplicationClassName() {
    return 'PhabricatorPackagesApplication';
  }

  public function newQuery() {
    return id(new PhabricatorPackagesPackageQuery());
  }

  public function canUseInPanelContext() {
    return false;
  }

  protected function buildQueryFromParameters(array $map) {
    $query = $this->newQuery();

    if ($map['match'] !== null) {
      $query->withNameNgrams($map['match']);
    }

    if ($map['publisherPHIDs']) {
      $query->withPublisherPHIDs($map['publisherPHIDs']);
    }

    return $query;
  }

  protected function buildCustomSearchFields() {
    return array(
      id(new PhabricatorSearchTextField())
        ->setLabel(pht('Name Contains'))
        ->setKey('match')
        ->setDescription(pht('Search for packages by name substring.')),
      id(new PhabricatorSearchDatasourceField())
        ->setLabel(pht('Publishers'))
        ->setKey('publisherPHIDs')
        ->setAliases(array('publisherPHID', 'publisher', 'publishers'))
        ->setDatasource(new PhabricatorPackagesPublisherDatasource())
        ->setDescription(pht('Search for packages by publisher.')),
    );
  }

  protected function getURI($path) {
    return '/packages/package/'.$path;
  }

  protected function getBuiltinQueryNames() {
    $names = array(
      'all' => pht('All Packages'),
    );

    return $names;
  }

  public function buildSavedQueryFromBuiltin($query_key) {
    $query = $this->newSavedQuery();
    $query->setQueryKey($query_key);

    switch ($query_key) {
      case 'all':
        return $query;
    }

    return parent::buildSavedQueryFromBuiltin($query_key);
  }

  protected function renderResultList(
    array $packages,
    PhabricatorSavedQuery $query,
    array $handles) {

    assert_instances_of($packages, 'PhabricatorPackagesPackage');
    $viewer = $this->requireViewer();

    $list = id(new PhabricatorPackagesPackageListView())
      ->setViewer($viewer)
      ->setPackages($packages)
      ->newListView();

    return id(new PhabricatorApplicationSearchResultView())
      ->setObjectList($list)
      ->setNoDataString(pht('No packages found.'));
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhabricatorPackagesPackageSearchEngine
  extends PhabricatorApplicationSearchEngine {

  public function getResultTypeDescription() {
    return pht('Packages');
  }

  public function getApplicationClassName() {
    return 'PhabricatorPackagesApplication';
  }

  public function newQuery() {
    return id(new PhabricatorPackagesPackageQuery());
  }

  public function canUseInPanelContext() {
    return false;
  }

  protected function buildQueryFromParameters(array $map) {
    $query = $this->newQuery();

    if ($map['match'] !== null) {
      $query->withNameNgrams($map['match']);
    }

    if ($map['publisherPHIDs']) {
      $query->withPublisherPHIDs($map['publisherPHIDs']);
    }

    return $query;
  }

  protected function buildCustomSearchFields() {
    return array(
      id(new PhabricatorSearchTextField())
        ->setLabel(pht('Name Contains'))
        ->setKey('match')
        ->setDescription(pht('Search for packages by name substring.')),
      id(new PhabricatorSearchDatasourceField())
        ->setLabel(pht('Publishers'))
        ->setKey('publisherPHIDs')
        ->setAliases(array('publisherPHID', 'publisher', 'publishers'))
        ->setDatasource(new PhabricatorPackagesPublisherDatasource())
        ->setDescription(pht('Search for packages by publisher.')),
    );
  }

  protected function getURI($path) {
    return '/packages/package/'.$path;
  }

  protected function getBuiltinQueryNames() {
    $names = array(
      'all' => pht('All Packages'),
    );

    return $names;
  }

  public function buildSavedQueryFromBuiltin($query_key) {
    $query = $this->newSavedQuery();
    $query->setQueryKey($query_key);

    switch ($query_key) {
      case 'all':
        return $query;
    }

    return parent::buildSavedQueryFromBuiltin($query_key);
  }

  protected function renderResultList(
    array $packages,
    PhabricatorSavedQuery $query,
    array $handles) {

    assert_instances_of($packages, 'PhabricatorPackagesPackage');
    $viewer = $this->requireViewer();

    $list = id(new PhabricatorPackagesPackageListView())
      ->setViewer($viewer)
      ->setPackages($packages)
      ->newListView();

    return id(new PhabricatorApplicationSearchResultView())
      ->setObjectList($list)
      ->setNoDataString(pht('No packages found.'));
  }

}

Function Calls

None

Variables

None

Stats

MD5 5e46ee8f9913193492834200287ca58c
Eval Count 0
Decode Time 88 ms