public function __construct(Transformable $inner, array $args = []) { parent::__construct($args); $this->inner = $inner; $this->options()->setNext($inner->options()); $this->meta()->setNext($inner->meta()); }
public function __construct($mixed = []) { if (is_string($mixed)) { $mixed = ['url' => $mixed]; } parent::__construct($mixed); $this->options()->setUnlessExists('verb', 'GET')->setUnlessExists('headers', null)->setUnlessExists('timeout', self::DEFAULT_TIMEOUT)->setUnlessExists('fields', null)->force('url'); }
public function __construct($mixed) { if (is_string($mixed)) { $mixed = ['path' => $mixed]; } if (!is_array($mixed)) { throw new OptionException('invalid constructor parameter'); } parent::__construct($mixed); $this->options()->force('path'); }