Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function getPresentation()
 {
     if (null === $this->option) {
         throw new \BadMethodCallException('The option have not been created yet so you cannot access proxy methods.');
     }
     return $this->option->getPresentation();
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function removeOption(OptionInterface $option)
 {
     $index = $option->getIndex();
     if (isset($this->options[$index])) {
         unset($this->options[$index]);
     }
 }
Пример #3
0
 /**
  * Returns the default value for the specified option.
  *
  * @param  string|OptionInterface $option Name or instance of the option.
  * @return mixed
  */
 public function getDefault($option)
 {
     if ($option instanceof OptionInterface) {
         return $option->getDefault($this);
     }
     $options = $this->getDefaultOptions();
     if (isset($options[$option])) {
         return $options[$option]->getDefault($this);
     }
 }
 /**
  * @covers            ::getValue
  * @expectedException InvalidArgumentException
  * @group             Cart
  */
 public function testValueFailure()
 {
     $this->option->getValue(null);
 }