Re: [PHP-DEV] [RFC] is_trusted - was is_literal

2021-06-22 Thread Moritz Friedrich
> Am 22.06.2021 um 20:38 schrieb Stephen Reay : > > It took me about a minute to think of this: > > "select * from customer_purchases where {$column} = :value”. > > The developer inadvertently passes the same “trusted value” in as the > `$column` substitute and the value parameter. It must be

Re: [PHP-DEV] Re: [RFC] is_literal

2021-06-17 Thread Moritz Friedrich
> Am 16.06.2021 um 23:01 schrieb Craig Francis : >> Throwing in another idea: is_hard_coded() > I’d be a little hesitant on the name ‘is_hard_coded’, if we allow integers, > that means that it’s no longer strictly hard coded, and might get confusing. Has `is_trusted` been considered yet? That

Re: [PHP-DEV] Disable interactive mode (-a) if readline not available

2021-05-12 Thread Moritz Friedrich
> Am 12.05.2021 um 10:12 schrieb Nikita Popov : > > Hi internals, > > If the readline extension is enabled, PHP provides an interactive shell > under -a. If it is not enabled, it falls back to an "interactive mode" > (yes, the difference between "interactive shell" and "interactive mode" is >

Re: [PHP-DEV] Add __toString() to DateInterval

2021-03-18 Thread Moritz Friedrich
> Would a reasonable way forward be to have such a named method, and have it > throw an exception if the instance is not representable in that form? > > That way, you'd be guaranteed that new > DateInterval($period->toIsoPeriodString()) would result in an equivalent > object, rather than

Re: [PHP-DEV] Add __toString() to DateInterval

2021-03-16 Thread Moritz Friedrich
> I already showed you that: "next weekday". It can either be +1 days, +2 > days, or +3 days. …depending on the time of execution, yes. The moment a developer consciously decides to transform an interval to an ISO string representation, they obviously accept the premise of anchoring the

Re: [PHP-DEV] Add __toString() to DateInterval

2021-03-16 Thread Moritz Friedrich
> I also don't understand what you're trying to say. You can't round trip > every interval as encoded in a DateInterval object through an ISO > interval string, so we shouldn't attempt to do that. I think you do know what I’m trying to say, but choose to disagree with me. ISO interval

Re: [PHP-DEV] Add __toString() to DateInterval

2021-03-15 Thread Moritz Friedrich
ieb Derick Rethans : > > On Wed, 3 Mar 2021, Moritz Friedrich wrote: > >> I would like to propose adding a `__toString()` method to the >> `DateInterval` class that should return a valid ISO8601 interval >> (https://en.wikipedia.org/wiki/ISO_8601#Time_intervals

Re: [PHP-DEV] Add __toString() to DateInterval

2021-03-03 Thread Moritz Friedrich
> Am 03.03.2021 um 14:01 schrieb Andreas Heigl : > > I'd rather see those classes as ValueObjects that should not have to > take care about their external representation. And a custom Formatter > that handles all the weird edge cases as a separate entity would be a > much easier to maintain

Re: [PHP-DEV] Add __toString() to DateInterval

2021-03-03 Thread Moritz Friedrich
Am 03.03.2021 um 11:53 schrieb Pierre : > > Le 03/03/2021 à 11:37, Moritz Friedrich a écrit : >> Hi internals, >> I’ve been active in the PHP ecosystem as @Radiergummi for quite a while now, >> but not on internals yet, so: nice to meet you all! >> >

[PHP-DEV] Add __toString() to DateInterval

2021-03-03 Thread Moritz Friedrich
Hi internals, I’ve been active in the PHP ecosystem as @Radiergummi for quite a while now, but not on internals yet, so: nice to meet you all! I would like to propose adding a `__toString()` method to the `DateInterval` class that should return a valid ISO8601 interval