/**
  * @param OptionsResolver $resolver
  */
 protected function setDefaultOptions(OptionsResolver $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setRequired(array('images_root_dir', 'images_output_dir', 'baseurl'));
     $resolver->setDefaults(array('forcesave' => false));
     $resolver->setAllowedTypes('forcesave', 'bool');
     $resolver->setAllowedTypes('images_root_dir', 'string');
     $resolver->setAllowedTypes('images_output_dir', 'string');
     $resolver->setAllowedTypes('baseurl', 'string');
 }
예제 #2
0
 /**
  * Domyślne opcje
  * @param OptionsResolver $resolver
  */
 protected function setDefaultOptions(OptionsResolver $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setRequired(array('document', 'trans_closure'));
     $resolver->setAllowedTypes('document', 'object');
     $that = $this;
     $resolver->setNormalizer('document', function (Options $options, $value) use($that) {
         $that->compareOptionType('document', $value, 'vSymfo\\Component\\Document\\Interfaces\\DocumentInterface');
         return $value;
     });
     $resolver->setNormalizer('trans_closure', function (Options $options, $value) use($that) {
         $that->compareOptionType('trans_closure', $value, '\\Closure');
         return $value;
     });
 }
 /**
  * @param OptionsResolver $resolver
  */
 protected function setDefaultOptions(OptionsResolver $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setRequired(array('baseurl', 'resources'));
     $resolver->setDefaults(array('name' => '', 'combine' => false, 'async' => true));
     $resolver->setAllowedTypes('baseurl', 'string');
     $resolver->setAllowedTypes('name', 'string');
     $resolver->setAllowedTypes('combine', 'bool');
     $resolver->setAllowedTypes('async', 'bool');
     $resolver->setAllowedTypes('resources', 'object');
     $that = $this;
     $resolver->setNormalizer('resources', function (Options $options, $value) use($that) {
         $that->compareOptionType('resources', $value, 'vSymfo\\Component\\Document\\Resources\\Interfaces\\ResourceManagerInterface');
         return $value;
     });
 }