Beispiel #1
0
 /**
  * Set options.
  *
  * @param  array|Traversable|FilesystemOptions $options
  * @return Filesystem
  * @see    getOptions()
  */
 public function setOptions($options)
 {
     if (!$options instanceof FilesystemOptions) {
         $options = new FilesystemOptions($options);
     }
     $this->options = $options;
     $options->setAdapter($this);
     return $this;
 }
Beispiel #2
0
 /**
  * Set options.
  *
  * @param  array|Traversable|FilesystemOptions $options
  * @return Filesystem
  * @see    getOptions()
  */
 public function setOptions($options)
 {
     if (!is_array($options) && !$options instanceof Traversable && !$options instanceof FilesystemOptions) {
         throw new Exception\InvalidArgumentException(sprintf('%s expects an array, a Traversable object, or an FilesystemOptions instance; ' . 'received "%s"', __METHOD__, is_object($options) ? get_class($options) : gettype($options)));
     }
     if (!$options instanceof FilesystemOptions) {
         $options = new FilesystemOptions($options);
     }
     $this->options = $options;
     $options->setAdapter($this);
     return $this;
 }