Ejemplo n.º 1
0
 /**
  * Retrieves reference on path-selected subset from set for write access.
  *
  * This method is automatically creating selected subset or any containing
  * superordinated subset of set on demand.
  *
  * @throws \UnexpectedValueException on trying to descend into leaf node
  *
  * @param string $path pathname to subset
  * @param mixed $value some value to write (replacing existing content)
  */
 public function write($path, $value)
 {
     if (is_array($value)) {
         $value = $this->filterByType($value, false);
     } else {
         if (!is_null($value) && !$this->isMatchingType($value)) {
             throw new \InvalidArgumentException('invalid type of value');
         }
     }
     parent::write($path, $value);
 }