illuminatech / config

Manage Laravel configuration by persistent storage
Other
150 stars 14 forks source link

`PersistentRepository::synchronize()` does not respects custom item ID #7

Closed klimov-paul closed 5 years ago

klimov-paul commented 5 years ago

What steps will reproduce the problem?

Configure persistent repository with the item, which id does not match its key, set new value to this item and invoke synchronize():

$persistentRepository = new PersistentRepository(/* ... */);
$persistentRepository->setItems([
     'custom.id' => [
        'id' => 'custom_id',
    ],
]);

$persistentRepository->set('custom.id', 'new value')

$persistentRepository->synchronize();

What is the expected result?

New value is saved inside the persistent storage.

What do you get instead?

New value is ignored.

Additional info

Q A
This Package Version 1.0.3
Laravel Framework Version 5.8.*
PHP version 7.2.*
Operating system *
klimov-paul commented 5 years ago

Resolved by commit bf7e996aa4f3abe095b0328e4ee7babbf424cb95