KeyValueStore icon indicating copy to clipboard operation
KeyValueStore copied to clipboard

ArrayStorage find() deletes entires

Open cvejanovic opened this issue 5 years ago • 1 comments

Looks like the find() method is a copy of the delete() method. It unsets the key rather than returning it.

https://github.com/doctrine/KeyValueStore/blob/master/lib/Doctrine/KeyValueStore/Storage/ArrayStorage.php#L124

`public function find($storageName, $key) { if (!isset($this->data[$storageName])) { throw new NotFoundException(); }

    if (!isset($this->data[$storageName][serialize($key)])) {
        throw new NotFoundException();
    }

    unset($this->data[$storageName][serialize($key)]);
}`

cvejanovic avatar Apr 20 '20 18:04 cvejanovic

Just an FYI that this library hasn't seen any significant development activity over the past years and is not very high on our list of priorities. That said, a PR fixing the issue is highly appreciated!

alcaeus avatar Apr 22 '20 08:04 alcaeus