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 PhabricatorCountdownEpochTransaction extends PhabricatorCountdownTran..

Decoded Output download

<?php

final class PhabricatorCountdownEpochTransaction
  extends PhabricatorCountdownTransactionType {

  const TRANSACTIONTYPE = 'countdown:epoch';

  public function generateOldValue($object) {
    return (int)$object->getEpoch();
  }

  public function generateNewValue($object, $value) {
    return $value->newPhutilDateTime()
      ->newAbsoluteDateTime()
      ->getEpoch();
  }

  public function applyInternalEffects($object, $value) {
    $object->setEpoch($value);
  }

  public function getTitle() {
    return pht(
      '%s updated the countdown end from %s to %s.',
      $this->renderAuthor(),
      $this->renderOldDate(),
      $this->renderNewDate());
  }

  public function getTitleForFeed() {
    return pht(
      '%s updated the countdown end for %s from %s to %s.',
      $this->renderAuthor(),
      $this->renderObject(),
      $this->renderOldDate(),
      $this->renderNewDate());
  }

  public function validateTransactions($object, array $xactions) {
    $errors = array();

    if (!$object->getEpoch() && !$xactions) {
      $errors[] = $this->newRequiredError(
        pht('You must give the countdown an end date.'));
      return $errors;
    }

    foreach ($xactions as $xaction) {
      $value = $xaction->getNewValue();
      if (!$value->isValid()) {
        $errors[] = $this->newInvalidError(
          pht('You must give the countdown an end date.'));
      }
    }

    return $errors;
  }
}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhabricatorCountdownEpochTransaction
  extends PhabricatorCountdownTransactionType {

  const TRANSACTIONTYPE = 'countdown:epoch';

  public function generateOldValue($object) {
    return (int)$object->getEpoch();
  }

  public function generateNewValue($object, $value) {
    return $value->newPhutilDateTime()
      ->newAbsoluteDateTime()
      ->getEpoch();
  }

  public function applyInternalEffects($object, $value) {
    $object->setEpoch($value);
  }

  public function getTitle() {
    return pht(
      '%s updated the countdown end from %s to %s.',
      $this->renderAuthor(),
      $this->renderOldDate(),
      $this->renderNewDate());
  }

  public function getTitleForFeed() {
    return pht(
      '%s updated the countdown end for %s from %s to %s.',
      $this->renderAuthor(),
      $this->renderObject(),
      $this->renderOldDate(),
      $this->renderNewDate());
  }

  public function validateTransactions($object, array $xactions) {
    $errors = array();

    if (!$object->getEpoch() && !$xactions) {
      $errors[] = $this->newRequiredError(
        pht('You must give the countdown an end date.'));
      return $errors;
    }

    foreach ($xactions as $xaction) {
      $value = $xaction->getNewValue();
      if (!$value->isValid()) {
        $errors[] = $this->newInvalidError(
          pht('You must give the countdown an end date.'));
      }
    }

    return $errors;
  }
}

Function Calls

None

Variables

None

Stats

MD5 24a6ebca354e2565c44b003d704b0cb5
Eval Count 0
Decode Time 97 ms