Clue\React\Buzz\Browser::withOptions PHP Метод

withOptions() публичный Метод

public withOptions ( array $options )
$options array
    public function withOptions(array $options)
    {
        $browser = clone $this;
        // merge all options, but remove those explicitly assigned a null value
        $browser->options = array_filter($options + $this->options, function ($value) {
            return $value !== null;
        });
        return $browser;
    }

Usage Example

Пример #1
0
 public function __construct(LoopInterface $loop, Browser $browser = null)
 {
     if ($browser === null) {
         $b = new Browser($loop);
         $browser = $b->withOptions(array('followRedirects' => true, 'maxRedirects' => 10, 'obeySuccessCode' => false));
     }
     $this->loop = $loop;
     $this->browser = $browser;
 }
All Usage Examples Of Clue\React\Buzz\Browser::withOptions