ArrayStorage find() deletes entires #34

Open
opened 2026-01-23 11:34:55 +01:00 by admin · 1 comment
Owner

Originally created by @cvejanovic on GitHub (Apr 20, 2020).

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)]);
}`
Originally created by @cvejanovic on GitHub (Apr 20, 2020). 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)]); }`
admin added the bug label 2026-01-23 11:34:55 +01:00
Author
Owner

@alcaeus commented on GitHub (Apr 22, 2020):

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 commented on GitHub (Apr 22, 2020): 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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/KeyValueStore#34