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 PhabricatorOwnersPackageNameTransaction extends PhabricatorOwnersPack..

Decoded Output download

<?php

final class PhabricatorOwnersPackageNameTransaction
  extends PhabricatorOwnersPackageTransactionType {

  const TRANSACTIONTYPE = 'owners.name';

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

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

    $missing = $this->isEmptyTextTransaction(
      $object->getName(),
      $xactions);

    if ($missing) {
      $errors[] = $this->newRequiredError(
        pht('Package name is required.'),
        nonempty(last($xactions), null));
    }

    foreach ($xactions as $xaction) {
      $new = $xaction->getNewValue();
      if (preg_match('([,!])', $new)) {
        $errors[] = $this->newInvalidError(
          pht(
            'Package names may not contain commas (",") or exclamation '.
            'marks ("!"). These characters are ambiguous when package '.
            'names are parsed from the command line.'),
          $xaction);
      }
    }

    return $errors;
  }

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

  public function getTitle() {
    return pht(
      '%s renamed this package from %s to %s.',
      $this->renderAuthor(),
      $this->renderOldValue(),
      $this->renderNewValue());
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhabricatorOwnersPackageNameTransaction
  extends PhabricatorOwnersPackageTransactionType {

  const TRANSACTIONTYPE = 'owners.name';

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

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

    $missing = $this->isEmptyTextTransaction(
      $object->getName(),
      $xactions);

    if ($missing) {
      $errors[] = $this->newRequiredError(
        pht('Package name is required.'),
        nonempty(last($xactions), null));
    }

    foreach ($xactions as $xaction) {
      $new = $xaction->getNewValue();
      if (preg_match('([,!])', $new)) {
        $errors[] = $this->newInvalidError(
          pht(
            'Package names may not contain commas (",") or exclamation '.
            'marks ("!"). These characters are ambiguous when package '.
            'names are parsed from the command line.'),
          $xaction);
      }
    }

    return $errors;
  }

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

  public function getTitle() {
    return pht(
      '%s renamed this package from %s to %s.',
      $this->renderAuthor(),
      $this->renderOldValue(),
      $this->renderNewValue());
  }

}

Function Calls

None

Variables

None

Stats

MD5 0ea06c181e028b78dfa2eaa52b81d59f
Eval Count 0
Decode Time 95 ms