(sorry, the last line in my previous message was meant to be removed - clumsy guys like me really need editable messages :)
El martes, 13 de noviembre de 2018, 22:48:20 (UTC), Miguel Rosales escribió: > > A bit late to the party, but just wanted to give a big +1 to Larry's > comment above - I don't think this feature should be defined in the docs > when the language itself doesn't allow it, and afaik (may be wrong) there's > no evidence that it will be supported in the future... > > Probably my opinion is influenced by the fact I personally don't like > union/intersection types - I think in many cases you can avoid them using > interfaces and/or a bit of refactoring, and if not, there are other > features that could solve the same problem in better ways (imho anyway) > e.g. method overloading or even "scalar objects". Adding full support for > this in a PSR could definitely influence the community in one direction > that may not the best one... > > As a side note, there was a thread about adding more support to generics > where it was said that that's a language-specific feature out of scope of > the PSR (which makes perfect sense), and this sounds quite similar to me :) > > - I've used the OR | operator a lot, but since PHP7, I always try to rely > less on phpdoc for typing, and more on the language itself, and in may > cases when I need to add an OR, I consider a refactoring instead. > > El viernes, 19 de octubre de 2018, 13:50:34 (UTC+1), Chuck Burgess > escribió: >> >> Hello everyone, >> >> There is a new PR [1] from a contributor, asking for an Intersection Type >> Operator. This appears to simply use `&` akin to how `|` is used for Union >> Types. >> >> Neither Unions nor Intersections are (yet) in the language itself, but >> `string|null` Union Typing in Tags has been in wide usage for a while now. >> In looking over RFCs on attempts to get these two Type Operators into the >> language, it seems likely to me that the Operators chosen will be `|` and >> `&` if they do ever get in. As such, I'm personally good with the choice >> of `&` for Intersection Operator for Typing in Tags. >> >> Please keep discussion on this request on this ML thread. >> >> Chuck Burgess, Editor >> >> [1] -- https://github.com/php-fig/fig-standards/pull/1104 >> > -- 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/b3514baa-9df8-4ea8-ad9f-58d2a169a625%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.