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'); }
public function scent() { return $this->inner()->scent() . "\n" . parent::scent(); }