Пример #1
0
 public function __construct(Application $app, array $options)
 {
     if (!isset($options['colorspaces'])) {
         throw new \InvalidArgumentException('Missing "colorspaces" options');
     }
     $this->colorspaces = array_map('strtolower', (array) $options['colorspaces']);
     parent::__construct($app);
 }
Пример #2
0
 public function __construct(Application $app, array $options)
 {
     if (!isset($options['mediatypes'])) {
         throw new \InvalidArgumentException('Missing "mediatypes" options');
     }
     $this->mediaTypes = (array) $options['mediatypes'];
     parent::__construct($app);
 }
Пример #3
0
 /**
  * Constructor
  *
  * @param Application $app
  * @param array       $options An array of options. available : 'sensitive' (false by default)
  */
 public function __construct(Application $app, array $options = [])
 {
     if (!isset($options['sensitive'])) {
         $options['sensitive'] = false;
     }
     $this->sensitive = (bool) $options['sensitive'];
     parent::__construct($app);
 }
Пример #4
0
 public function __construct(Application $app, array $options)
 {
     if (!isset($options['width'])) {
         throw new \InvalidArgumentException('Missing "width" option');
     }
     if (!isset($options['height']) || null === $options['height']) {
         $options['height'] = $options['width'];
     }
     if ((int) $options['height'] <= 0 || (int) $options['width'] <= 0) {
         throw new \InvalidArgumentException('Dimensions should be greater than 0');
     }
     $this->width = $options['width'];
     $this->height = $options['height'];
     parent::__construct($app);
 }
Пример #5
0
 public function __construct(Application $app)
 {
     parent::__construct($app);
 }
Пример #6
0
 /**
  * @dataProvider getDataboxAndCollection
  * @expectedException  \InvalidArgumentException
  */
 public function testInvalidCollection($databox, $collection)
 {
     $this->object->restrictToCollections($databox);
 }