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 PhabricatorProjectLockTransaction extends PhabricatorProjectTransacti..

Decoded Output download

<?php

final class PhabricatorProjectLockTransaction
  extends PhabricatorProjectTransactionType {

  const TRANSACTIONTYPE = 'project:locked';

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

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

  public function getTitle() {
    $new = $this->getNewValue();

    if ($new) {
      return pht(
        "%s locked this project's membership.",
        $this->renderAuthor());
    } else {
      return pht(
        "%s unlocked this project's membership.",
        $this->renderAuthor());
    }
  }

  public function getTitleForFeed() {
    $new = $this->getNewValue();

    if ($new) {
      return pht(
        '%s locked %s membership.',
        $this->renderAuthor(),
        $this->renderObject());
    } else {
      return pht(
        '%s unlocked %s membership.',
        $this->renderAuthor(),
        $this->renderObject());
    }
  }

  public function getIcon() {
    $new = $this->getNewValue();

    if ($new) {
      return 'fa-lock';
    } else {
      return 'fa-unlock';
    }
  }

  public function validateTransactions($object, array $xactions) {
    if ($xactions) {
      $this->requireApplicationCapability(
        ProjectCanLockProjectsCapability::CAPABILITY);
    }
    return array();
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhabricatorProjectLockTransaction
  extends PhabricatorProjectTransactionType {

  const TRANSACTIONTYPE = 'project:locked';

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

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

  public function getTitle() {
    $new = $this->getNewValue();

    if ($new) {
      return pht(
        "%s locked this project's membership.",
        $this->renderAuthor());
    } else {
      return pht(
        "%s unlocked this project's membership.",
        $this->renderAuthor());
    }
  }

  public function getTitleForFeed() {
    $new = $this->getNewValue();

    if ($new) {
      return pht(
        '%s locked %s membership.',
        $this->renderAuthor(),
        $this->renderObject());
    } else {
      return pht(
        '%s unlocked %s membership.',
        $this->renderAuthor(),
        $this->renderObject());
    }
  }

  public function getIcon() {
    $new = $this->getNewValue();

    if ($new) {
      return 'fa-lock';
    } else {
      return 'fa-unlock';
    }
  }

  public function validateTransactions($object, array $xactions) {
    if ($xactions) {
      $this->requireApplicationCapability(
        ProjectCanLockProjectsCapability::CAPABILITY);
    }
    return array();
  }

}

Function Calls

None

Variables

None

Stats

MD5 78bc68879087a81670b8a65160ebc40d
Eval Count 0
Decode Time 150 ms