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 /** * Configurable test object for implementing Policy unit tests. */ final class..

Decoded Output download

<?php

/**
 * Configurable test object for implementing Policy unit tests.
 */
final class PhabricatorPolicyTestObject
  extends Phobject
  implements
    PhabricatorPolicyInterface,
    PhabricatorExtendedPolicyInterface {

  private $phid;
  private $capabilities = array();
  private $policies = array();
  private $automaticCapabilities = array();
  private $extendedPolicies = array();

  public function setPHID($phid) {
    $this->phid = $phid;
    return $this;
  }

  public function getPHID() {
    return $this->phid;
  }

  public function getCapabilities() {
    return $this->capabilities;
  }

  public function getPolicy($capability) {
    return idx($this->policies, $capability);
  }

  public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
    $auto = idx($this->automaticCapabilities, $capability, array());
    return idx($auto, $viewer->getPHID());
  }

  public function setCapabilities(array $capabilities) {
    $this->capabilities = $capabilities;
    return $this;
  }

  public function setPolicies(array $policy_map) {
    $this->policies = $policy_map;
    return $this;
  }

  public function setAutomaticCapabilities(array $auto_map) {
    $this->automaticCapabilities = $auto_map;
    return $this;
  }

  public function setExtendedPolicies(array $extended_policies) {
    $this->extendedPolicies = $extended_policies;
    return $this;
  }

  public function getExtendedPolicy($capability, PhabricatorUser $viewer) {
    return idx($this->extendedPolicies, $capability, array());
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

/**
 * Configurable test object for implementing Policy unit tests.
 */
final class PhabricatorPolicyTestObject
  extends Phobject
  implements
    PhabricatorPolicyInterface,
    PhabricatorExtendedPolicyInterface {

  private $phid;
  private $capabilities = array();
  private $policies = array();
  private $automaticCapabilities = array();
  private $extendedPolicies = array();

  public function setPHID($phid) {
    $this->phid = $phid;
    return $this;
  }

  public function getPHID() {
    return $this->phid;
  }

  public function getCapabilities() {
    return $this->capabilities;
  }

  public function getPolicy($capability) {
    return idx($this->policies, $capability);
  }

  public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
    $auto = idx($this->automaticCapabilities, $capability, array());
    return idx($auto, $viewer->getPHID());
  }

  public function setCapabilities(array $capabilities) {
    $this->capabilities = $capabilities;
    return $this;
  }

  public function setPolicies(array $policy_map) {
    $this->policies = $policy_map;
    return $this;
  }

  public function setAutomaticCapabilities(array $auto_map) {
    $this->automaticCapabilities = $auto_map;
    return $this;
  }

  public function setExtendedPolicies(array $extended_policies) {
    $this->extendedPolicies = $extended_policies;
    return $this;
  }

  public function getExtendedPolicy($capability, PhabricatorUser $viewer) {
    return idx($this->extendedPolicies, $capability, array());
  }

}

Function Calls

None

Variables

None

Stats

MD5 6127b80481c972350be84deaffd0b0fa
Eval Count 0
Decode Time 86 ms