Hello Pedro, On Mon, Jan 2, 2017 at 5:08 PM, Pedro Cordeiro <[email protected]> wrote:
> Hi, very quick question. Couldn't find anything on either the spec or the > meta doc. > > The `set` and `setMultiple` methods define that an > `InvalidArgumentException` MUST be thrown if $key is not a legal string > value. However, shouldn't these methods specify that an > InvalidArgumentException MUST also be thrown if the provided $ttl is > neither an integer or a \DateInterval? The spec says a TTL is **normally** > defined by either an amount of seconds or a \DateInterval object. However, > if we let implementations dictate what TTLs can be, we can end up with > incompatible implementations. > > Implementation A only allows integers, where B only allows DateIntervals. > C only allows some custom wrapper for a TTL value. A, B and C are now > incompatible amongst themselves, and we have less INTEROPERABILITY (which > is kind of the point of this standard). > > Was this discussed? > Invalid is primarily decided by the backend that is being used at the time. PSR-16 doesn't define what is or it not a valid TTL (yes we have said INT or DateInterval), however in the context of if it only wants INT or DateInterval only, that's not for us to decide. The PSR-16 standard says that in the event of an invalid passed TTL then this is the specific class typehint that will be thrown. Does this make more sense now? Many thanks, Paul > > -- > 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/dd2e5055-a45e-4cd9-afb7-196769e588fc%40googlegroups.com > <https://groups.google.com/d/msgid/php-fig/dd2e5055-a45e-4cd9-afb7-196769e588fc%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAKxcST_A%3D9xS7RxvSmeX_tU-cqbpuj_vaSfJ1C%3DABBG8NZXV8A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
