public function testReplace() { $bag = new ParameterBag(array('foo' => 'bar')); $bag->replace(array('FOO' => 'BAR')); $this->assertEquals(array('FOO' => 'BAR'), $bag->all(), '->replace() replaces the input with the argument'); $this->assertFalse($bag->has('foo'), '->replace() overrides previously set the input'); }
/** * Sets the Custom Options * @param array $options * @return \Acilia\Component\FragmentCache\Configuration\FragmentCache */ public function setOptions($options) { if (!is_array($options)) { $options = array(); } $this->options->replace($options); return $this; }
/** * @inheritdoc */ public function transform(ParameterBag $item) { if (!$this->field) { // expand root-level attributes $item->replace($this->expand($item->all())); return; } // proceed only when the field exists and is an array $value = $item->get($this->field); if (!is_array($value)) { return; } $item->set($this->field, $this->expand($value)); }
/** * @inheritdoc */ public function transform(ParameterBag $item) { $parameters = $item->all(); $this->trimValues($parameters); $item->replace($parameters); }
/** * @inheritdoc */ public function transform(ParameterBag $item) { $parameters = $item->all(); $this->stripKeysPunctuation($parameters); $item->replace($parameters); }
/** * @inheritdoc */ public function transform(ParameterBag $item) { $parameters = $item->all(); $this->lowercaseKeys($parameters); $item->replace($parameters); }