Replies: 1 comment 3 replies
-
@javaDeveloperKid, this has been discussed and even implemented in the past php/php-src#947. Later there was an RFC for sealed classes, which is a similar concept https://wiki.php.net/rfc/sealed_classes. Not sure if anyone is currently interested in reviving this idea as the RFC above failed to pass voting. Meanwhile, |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, at his talk on LARACON EU, Roman Pronskiy asked to throw ideas here.
My idea is to have a visibility for classes like it is in languages such as Java or C#. I think this would result in better and safer code that doesn't end up as spaghetti monolith. Let's protect developers from themselves. Right now one has to depend on other developer programming ethic which is a very naive approach 😄
The
private
visibility would be the default.However I have no idea how this can be introduce with the PHP namespaces. Which namespace would be a root one and as such considered "a module"? Would it be configurable somehow and all the subnamespaces will be considered the part of this "package"/"module"?
Beta Was this translation helpful? Give feedback.
All reactions