On Thu, Jul 28, 2016 at 5:28 PM, Larry Garfield <la...@garfieldtech.com>
wrote:

> Hm.  I would be open to this.  We can include the sample code to
> copy-paste in the errata, and include it in the utlis package.
>
> Does anyone object to this recommendation for the errata?  Paul and Robert
> especially?
>
> --Larry Garfield
>

Hey Larry,

Can you ping me on twitter or something when you need my attention, I'm not
checking every thread message. You should ping Robert manually too as I
doubt he's noticed this, his input will be of value.

I agree with the rejection of non DateTime|DateTimeImmutable parameters to
CacheItemInterface::expiresAt($expiration).

I'm happy with the trigger_error() approach that Brent Shaffer provided as
a way to mimic PHP5 and PHP7 invalid type handling.

Many thanks,
Paul


>
>
> On 07/28/2016 11:19 AM, Brent Shaffer wrote:
>
> If we want to mimic a type error, we could do the following:
>
>     $error = sprintf('Argument 1 passed to %s::expiresAt() must be an
> instance of DateTime, string given', get_class($this));
>     if (class_exists('TypeError')) {
>         throw new \TypeError($error);
>     }
>     trigger_error($error, E_USER_ERROR);
>
> It's verbose but it's the closest we can get to native handling while
> still obeying the spec.
>
> - Brent
>
> On Wednesday, July 27, 2016 at 11:21:30 AM UTC-7, Brent Shaffer wrote:
>>
>> Unfortunately, there is no way to trigger an E_RECOVERABLE_ERROR. You can
>> only trigger user-level errors, so E_USER_ERROR is the closest you can get.
>> E_USER_ERROR is catchable via set_error_handler(), so this should be
>> approximately the same.
>>
>> - Brent
>>
> --
> 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 php-fig+unsubscr...@googlegroups.com.
> To post to this group, send email to php-fig@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/php-fig/b38673aa-3cac-4c29-bbc3-69030036dfbf%40googlegroups.com
> <https://groups.google.com/d/msgid/php-fig/b38673aa-3cac-4c29-bbc3-69030036dfbf%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 php-fig+unsubscr...@googlegroups.com.
> To post to this group, send email to php-fig@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/php-fig/9e949206-2349-1392-35d8-658dc91a0e0a%40garfieldtech.com
> <https://groups.google.com/d/msgid/php-fig/9e949206-2349-1392-35d8-658dc91a0e0a%40garfieldtech.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 php-fig+unsubscr...@googlegroups.com.
To post to this group, send email to php-fig@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/CAKxcST-qoRDod75XumXZTzhDZHjOdNseiUOzqYwdVekNcfXgRg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to