[PSR-13] Fix for breaking bug

62 views
Skip to first unread message

Larry Garfield

unread,
Feb 14, 2021, 2:25:41 PM2/14/21
to PHP-FIG
Michael Babker on Twitter recently alerted me to a bug in the new PSR-13 release. Specifically, it typed withAttribute(string $name, string $value), which is what the docblock had, but the spec said more than just strings were allowed for $value. In particular, arrays and bool are called out specifically. This is an API break.

After discussing with implementers (mainly Symfony) to verify existing behavior, I offer this second errata with fixes to the spec.

https://github.com/php-fig/fig-standards/pull/1222

The PR there includes links to the package updates.

As an errata this would require another Core Committee vote, which I will call in two weeks unless there are any objections before then, or if enough of the CC says to just go ahead and vote sooner. (The two week discussion period is encouraged but not strictly required, so I'm willing to save time if everyone else is.)

Also, please check and make sure there were no other issues introduced that we missed. I'd hate to have to have another bug fix release. :-(

--
Larry Garfield
la...@garfieldtech.com

Larry Garfield

unread,
Feb 21, 2021, 2:53:01 PM2/21/21
to PHP-FIG
Core Committee members, any feedback here? Good, bad, or otherwise?

--Larry Garfield

Enrico Zimuel

unread,
Feb 22, 2021, 3:09:17 AM2/22/21
to php...@googlegroups.com
Hi Larry,

I did a review of the PR and it looks good.
+1 for me.

Regards,
Enrico Zimuel


--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/a6824371-d0be-4ea5-8da2-7c1af4bc9c12%40www.fastmail.com.

Ben Edmunds

unread,
Feb 22, 2021, 10:55:29 AM2/22/21
to PHP Framework Interoperability Group
+1

Matthew Weier O'Phinney

unread,
Feb 22, 2021, 5:50:15 PM2/22/21
to php...@googlegroups.com
No additional feedback from me; I'm good with the proposed changes. 

--
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+u...@googlegroups.com.

Woody Gilk

unread,
Feb 23, 2021, 10:15:20 AM2/23/21
to php...@googlegroups.com
I’m good with these changes, though I wish the type was more strict. 

Sent from my iPhone

On Feb 22, 2021, at 4:50 PM, Matthew Weier O'Phinney <mweiero...@gmail.com> wrote:



Larry Garfield

unread,
Feb 23, 2021, 10:20:59 AM2/23/21
to PHP-FIG
On Tue, Feb 23, 2021, at 9:15 AM, Woody Gilk wrote:
> I’m good with these changes, though I wish the type was more strict.

I'm always for tighter typing where possible, but in this situation I don't think it could be stricter. int and float are both needed. String is needed. The spec text explicitly says that Stringable is allowed, and that arrays are allowed and have a particular meaning. We kinda need all of them.

--Larry Garfield
Reply all
Reply to author
Forward
0 new messages