/** * @param ElementInterface $element * @param string|null $key */ public function add(ElementInterface $element, $key = null) { if (is_null($key)) { $key = $element->getId(); } $this->elements->set($key, $element); }
/** * @param array $attributes */ public function add(array $attributes) { if (ArrayHelper::isAssoc($attributes)) { $this->attributes->setData($attributes); } else { foreach ($attributes as $attribute) { if (is_array($attribute)) { $this->attributes->setData($attribute); } else { $this->attributes->set($attribute, $attribute); } } } }
/** * @param ElementInterface $element */ protected function add(ElementInterface $element) { $this->elements->set($element->getId(), $element); }
public function testGetStoreSetValue() { $config = new Store(); $config->set('test', 'foo'); $this->assertSame('foo', $config->get('test')); }
/** * @param string $key * @param string $value * * @return Response */ public function setHeader($key, $value) { $this->headers->set($key, $value); return $this; }