[PHP] Prevent users of library from using internal classes
- Date: Tue, 1 Sep 2015 13:11:04 +1000
- From: Jesse Schalken <me@xxxxxxxxxxxxxxxxx>
- Subject: [PHP] Prevent users of library from using internal classes
How can I prevent users of a PHP library from using classes defined in the
library which are not supposed to be used outside of it?
It would be nice if PHP had some concept of package or namespace
visibility, so I could create private classes, but it doesn't.
The only thing I can think of is to put all the internal classes in a
dedicated sub-namespace like \Vendor\Project\_Internal\Class, to make it
Is there a better approach?