Re: Re: [RFC] Namespace-scoped declares, again
| From: | Lynn | Date: | Tue, 30 Jul 2019 08:20:30 +0000 |
| Subject: | Re: Re: [RFC] Namespace-scoped declares, again | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-106336@lists.php.net to get a copy of this message | ||
On Tue, Jul 30, 2019 at 10:12 AM Michał Brzuchalski <michal@brzuchalski.com>
wrote:
> IMO this would create a lot of problems cause name in Composer Package
> doesn't reflect used namespace declared in autoload, for eg.
>
> Composer package name => used namespace
> ---
> ocramius/package-version => PackageVersions\
> doctrine/collections => Doctrine\Common\Collections\
> symfony/console => Symfony\Component\Console\
>
> --
> regards / pozdrawiam,
> --
> Michał Brzuchalski
>
Hi,
This might also cause issues in scenarios where packages would register
autoloading of a conflicting namespace. If for some reason the namespace
clashes with a vendor, or vica versa, or a vendor package "hides" an
additional namespace in the package and overrides the declares that way, it
could cause a lot of problems.
Would it be an idea to first establish the concept of a package within PHP,
rather than deducting it based off a namespace? If packages would be a
thing in PHP, other than just a namespace, package private could also be
implemented as visibility modifier for inheritance and class visibility.
Regards,
Lynn van der Berg