I went ahead and merged in the open PR to include Intersection Types in the
draft.  This PR did not indicate anything with regard to order of
precedence, so anything that develops from this ML thread can be added via
a new PR.
CRB
*about.me/ashnazg <http://about.me/ashnazg>*


On Tue, Nov 13, 2018 at 8:09 PM Matthew Brown <matthewmatt...@gmail.com>
wrote:

> I agree that expressions like (A | B) & C should probably not be allowed,
> but I disagree that we should refrain, in principle, from allowing people
> to type their code in docblocks more expressively than PHP allows (in
> supported syntax).
>
> I like that docblocks can go further - it means not having to add runtime
> checks, while having a reasonable degree of confidence (with static
> analysis tools) that your code will work.
>
> On Nov 13, 2018, at 5:48 PM, Miguel Rosales <m.rosales.sue...@gmail.com>
> wrote:
>
> 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 a topic in the
> Google Groups "PHP Framework Interoperability Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/php-fig/W1VyAtoqGQ8/unsubscribe.
> To unsubscribe from this group and all its topics, 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/d6471893-ece3-4fc6-bc9e-672dffe408ca%40googlegroups.com
> <https://groups.google.com/d/msgid/php-fig/d6471893-ece3-4fc6-bc9e-672dffe408ca%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/BCC53CCB-E7D8-4CF8-96D4-6F49F3E97138%40gmail.com
> <https://groups.google.com/d/msgid/php-fig/BCC53CCB-E7D8-4CF8-96D4-6F49F3E97138%40gmail.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/CANsgjnvhwmThx%3D3Eaoy0L3Kpd%2B3BmV_d1j58vJzfeHHyobZt_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to