Example #1
0
 /**
  * Recursively remove all properties that don't belong in the minimal representation of this object
  * @return $this
  */
 public function minimize()
 {
     $this->removeUnprotectedControls();
     $this->removeUnprotectedProperties();
     parent::minimize();
     return $this;
 }
Example #2
0
 /**
  * @param array string $message Human readable error message directed at the end user
  * @param array $properties List of additional error properties to set
  * @param int|float|null $now Timestamp that the error should be marked with, in UNIX or PHP's microtime(true)
  */
 public function __construct($message, array $properties = [], $now = null)
 {
     $this->setMessage($message);
     parent::__construct($properties);
     if (!isset($properties['@time'])) {
         $now || ($now = microtime(true));
         $this->setTime($now);
     }
 }
Example #3
0
 /**
  * Remove all properties that are intended to be human-readable only
  * @return $this
  */
 public function minimize()
 {
     parent::minimize();
     if (isset($this->{'@meta'}) && !get_object_vars($this->{'@meta'})) {
         unset($this->{'@meta'});
     }
     return $this;
 }