Ejemplo n.º 1
0
 /**
  * Constructor, accepts values then sets the object as immutable
  * @param array $input
  */
 public function __construct(array $input = [])
 {
     if ($this->immutable === false) {
         parent::__construct($input);
         $this->immutable = true;
     } else {
         $this->throwException();
     }
 }
Ejemplo n.º 2
0
 /**
  * Constructor, add an array of key => value pairs on instantiation
  * @param array $input
  */
 public function __construct(array $input = [])
 {
     parent::__construct($input);
 }
Ejemplo n.º 3
0
 public function __construct(array $input)
 {
     $defaults = ['value' => '', 'domain' => null, 'path' => null, 'expires' => null, 'secure' => false, 'httponly' => false];
     $values = array_replace($defaults, $input);
     parent::__construct($values);
 }