/** * @see \Ableron\Lib\Storage\AbstractStorage::performDelete() */ protected function performDelete(string $storageKey) { // delete storage item if exists $this->arrayStorage->removeByKey($storageKey); // indicate that storage item has been deleted successfully return true; }
/** * @see \Ableron\Core\Form\FormElementInterface::removeLabelAttribute() */ public function removeLabelAttribute($attributeName) { $this->labelAttributes->removeByKey($attributeName); return $this; }
/** * Tests whether removeByKey() works as expected with non-existing key. * * @return void */ public function testRemoveByKeyWithNonExistingKey() { $map = new OrderedMap(array('foo' => 'bar', 'bar' => 'bar', 'baz' => 'bar', 'foobar' => 'foobarbaz')); $this->assertSame(array('foo' => 'bar', 'bar' => 'bar', 'baz' => 'bar', 'foobar' => 'foobarbaz'), $map->toArray()); $map->removeByKey('123'); $this->assertSame(array('foo' => 'bar', 'bar' => 'bar', 'baz' => 'bar', 'foobar' => 'foobarbaz'), $map->toArray()); }