Thanks for the answer Jordi,

I fine with your answers! Just a few notes:


IMO this kinda goes in the simplicity category, which is why I still think
> enforcing an array return value vs a traversable would also be simpler.
>

Understood.

Then I'd like to suggest to add a second `$default = null` argument to
getMultiple(). That would be consistent with get(), and allow detecting
cache misses if really required, by e.g. providing an object there and
check the resulting values identities.



> - returning `array` for `getMultiple` is not consistent with PSR-6
>> `getItems` which returns `array|Traversable`
>>
>
> See 2 points above. I think array only would be best. If it's wrapping a
> PSR-6 pool it can just normalize that with iterator_to_array()
>

No strong opinion on this on my side.


- what should happen when $key already exists in the storage but is not
>> "incrementable/integer"? (Redis INCR fails, I didn't check apcu) =>
>> return false? throw? erase and store $step? other?
>>
>
> That's a backend error which is usually suppressed as if there was a cache
> miss, but here people are going to expect a number back so not sure if
> returning false is great (c.f strpos-style common mistakes..). It is a kind
> of misuse so maybe throwing here is better?
>

I think throwing here is fine, because it would really mean that the app
messed up with its cache keys.



> couldn't all these new interfaces move in the Psr\Cache namespace (thus
>> releasing them as psr/cache 1.1 on packagist?)
>>
>
> That's an interesting idea, but also kinda confusing for users because
> Psr\Cache would suddenly contain a Psr\Cache\Cache which sounds like the
> thing to use, but also the Pool.. So maybe best to just duplicate the
> InvalidArgumentException/CacheException into SimpleCache namespace.
>

May I suggest to name it Psr\Cache\SimpleCacheInterface (and release it as
psr/cache 1.1?)
This would make the most sense to me.

Cheers,
Nicolas

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/CAOWwgp%3Dwq7u7SQUreqSQ8jHra8SgikX%2B-v10j90woJQLU0Xotw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to