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 DivinerBookPHIDType extends PhabricatorPHIDType { const TYPECONST = ..

Decoded Output download

<?php

final class DivinerBookPHIDType extends PhabricatorPHIDType {

  const TYPECONST = 'BOOK';

  public function getTypeName() {
    return pht('Diviner Book');
  }

  public function newObject() {
    return new DivinerLiveBook();
  }

  public function getTypeIcon() {
    return 'fa-book';
  }

  public function getPHIDTypeApplicationClass() {
    return 'PhabricatorDivinerApplication';
  }

  protected function buildQueryForObjects(
    PhabricatorObjectQuery $query,
    array $phids) {

    return id(new DivinerBookQuery())
      ->withPHIDs($phids);
  }

  public function loadHandles(
    PhabricatorHandleQuery $query,
    array $handles,
    array $objects) {

    foreach ($handles as $phid => $handle) {
      $book = $objects[$phid];

      $name = $book->getName();

      $handle
        ->setName($book->getShortTitle())
        ->setFullName($book->getTitle())
        ->setURI("/book/{$name}/");
    }
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class DivinerBookPHIDType extends PhabricatorPHIDType {

  const TYPECONST = 'BOOK';

  public function getTypeName() {
    return pht('Diviner Book');
  }

  public function newObject() {
    return new DivinerLiveBook();
  }

  public function getTypeIcon() {
    return 'fa-book';
  }

  public function getPHIDTypeApplicationClass() {
    return 'PhabricatorDivinerApplication';
  }

  protected function buildQueryForObjects(
    PhabricatorObjectQuery $query,
    array $phids) {

    return id(new DivinerBookQuery())
      ->withPHIDs($phids);
  }

  public function loadHandles(
    PhabricatorHandleQuery $query,
    array $handles,
    array $objects) {

    foreach ($handles as $phid => $handle) {
      $book = $objects[$phid];

      $name = $book->getName();

      $handle
        ->setName($book->getShortTitle())
        ->setFullName($book->getTitle())
        ->setURI("/book/{$name}/");
    }
  }

}

Function Calls

None

Variables

None

Stats

MD5 017a70dfd0035c665dc3cf4afcba051e
Eval Count 0
Decode Time 80 ms