Re: I would like to write an RFC for the addition of an internal keyword

From: Date: Fri, 01 Mar 2013 06:23:04 +0000
Subject: Re: I would like to write an RFC for the addition of an internal keyword
Groups: php.internals 
Request: Send a blank email to internals+get-66384@lists.php.net to get a copy of this message
> Setting aside difficulty of implementation, I'm coming around to the idea, though I think
> you could simplify it by cordoning off an entire namespace. E.g.:
> 
> A namespace at least two deep (e.g. \A\B\) may be marked 'protected' (by some method
> TBD). Classes and functions declared in a protected namespace can only be accessed from methods or
> functions inside the same namespace, or in ancestor namespaces.
> 
> E.g., if \Foo\Internal\ is protected, access of its classes/functions must originate from
> classes/functions defined in \Foo\, \Foo\Internal\, or \Foo\Internal\*.
> 
> This would allow something like nested classes, but obviously with a lot more flexibility.
> 
> In practice, plugin code sitting in, say, \MyPlugin\ could freely access \Framework\SomeClass,
> but not \Framework\Internal\SomeClass.

This would solve the problem of internal classes, but these are the least interesting part, imho -
The methods and properties are much more interesting, hence my new approach in response to Fabians
response, where I drop the concept of internal classes. Please refer to that.

> 
> I see some value there, but there's tons of questions remaining and how to to implement
> the damn thing...
> 
> Steve Clay

-Jens


Thread (16 messages)

« previous php.internals (#66384) next »