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 PhabricatorDashboardQueryPanelLimitTransaction extends PhabricatorDas..

Decoded Output download

<?php

final class PhabricatorDashboardQueryPanelLimitTransaction
  extends PhabricatorDashboardPanelPropertyTransaction {

  const TRANSACTIONTYPE = 'search.limit';

  protected function getPropertyKey() {
    return 'limit';
  }

  public function generateNewValue($object, $value) {
    if (!$value) {
      return null;
    }

    return $value;
  }

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

    $old_value = $object->getProperty($this->getPropertyKey());
    foreach ($xactions as $xaction) {
      $new_value = $xaction->getNewValue();

      if ($new_value === $old_value) {
        continue;
      }

      if ($new_value < 0) {
        $errors[] = $this->newInvalidError(
          pht(
            'Query result limit must be empty, or at least 1.'),
          $xaction);
        continue;
      }
    }

    return $errors;
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhabricatorDashboardQueryPanelLimitTransaction
  extends PhabricatorDashboardPanelPropertyTransaction {

  const TRANSACTIONTYPE = 'search.limit';

  protected function getPropertyKey() {
    return 'limit';
  }

  public function generateNewValue($object, $value) {
    if (!$value) {
      return null;
    }

    return $value;
  }

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

    $old_value = $object->getProperty($this->getPropertyKey());
    foreach ($xactions as $xaction) {
      $new_value = $xaction->getNewValue();

      if ($new_value === $old_value) {
        continue;
      }

      if ($new_value < 0) {
        $errors[] = $this->newInvalidError(
          pht(
            'Query result limit must be empty, or at least 1.'),
          $xaction);
        continue;
      }
    }

    return $errors;
  }

}

Function Calls

None

Variables

None

Stats

MD5 a36aae9b7369b1402d2bcf508d33052a
Eval Count 0
Decode Time 162 ms