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 PhabricatorPasteLanguageTransaction extends PhabricatorPasteTransacti..

Decoded Output download

<?php

final class PhabricatorPasteLanguageTransaction
  extends PhabricatorPasteTransactionType {

  const TRANSACTIONTYPE = 'paste.language';

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

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

  private function renderLanguageValue($value) {
    if (!strlen($value)) {
      return $this->renderValue(pht('autodetect'));
    } else {
      return $this->renderValue($value);
    }
  }

  public function getTitle() {
    return pht(
      "%s updated the paste's language from %s to %s.",
      $this->renderAuthor(),
      $this->renderLanguageValue($this->getOldValue()),
      $this->renderLanguageValue($this->getNewValue()));
  }

  public function getTitleForFeed() {
    return pht(
      '%s updated the language for %s from %s to %s.',
      $this->renderAuthor(),
      $this->renderObject(),
      $this->renderLanguageValue($this->getOldValue()),
      $this->renderLanguageValue($this->getNewValue()));
  }

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

    foreach ($xactions as $xaction) {
      $new = $xaction->getNewValue();

      if ($new !== null && !strlen($new)) {
        $errors[] = $this->newInvalidError(
          pht('Paste language must be null or a nonempty string.'),
          $xaction);
      }
    }

    return $errors;
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhabricatorPasteLanguageTransaction
  extends PhabricatorPasteTransactionType {

  const TRANSACTIONTYPE = 'paste.language';

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

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

  private function renderLanguageValue($value) {
    if (!strlen($value)) {
      return $this->renderValue(pht('autodetect'));
    } else {
      return $this->renderValue($value);
    }
  }

  public function getTitle() {
    return pht(
      "%s updated the paste's language from %s to %s.",
      $this->renderAuthor(),
      $this->renderLanguageValue($this->getOldValue()),
      $this->renderLanguageValue($this->getNewValue()));
  }

  public function getTitleForFeed() {
    return pht(
      '%s updated the language for %s from %s to %s.',
      $this->renderAuthor(),
      $this->renderObject(),
      $this->renderLanguageValue($this->getOldValue()),
      $this->renderLanguageValue($this->getNewValue()));
  }

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

    foreach ($xactions as $xaction) {
      $new = $xaction->getNewValue();

      if ($new !== null && !strlen($new)) {
        $errors[] = $this->newInvalidError(
          pht('Paste language must be null or a nonempty string.'),
          $xaction);
      }
    }

    return $errors;
  }

}

Function Calls

None

Variables

None

Stats

MD5 557485512f025c989152d60a4a90b5ac
Eval Count 0
Decode Time 117 ms