Re: Call it: allow reserved words in a class or not?
| From: | troels knak-nielsen | Date: | Thu, 06 Nov 2008 09:50:14 +0000 |
| Subject: | Re: Call it: allow reserved words in a class or not? | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-41708@lists.php.net to get a copy of this message | ||
On Thu, Nov 6, 2008 at 10:35 AM, Dan <iammrdan@googlemail.com> wrote:
> What if you want to provide a set of helper/wrapper classes, appropriately
> namespaced, something along the lines of:
> MyFramework\Helpers\Array
> MyFramework\Helpers\Database
> MyFramework\Helpers\Session
> etc.
>
> If I want to use that naming convention, I don't want to have to name some
> of my classes differently just because PHP can't deal with it. It may not be
> trivial to fix, but to the end-developer, it's a trivial problem and it's
> something that should just work.
I think the point is the same as with Zend_Validate_Interface ; While
MyFramework\Helpers is a fair namespace, Array is a bad classname. You
should use something like MyFramework\Helpers\ArrayHelper
FWIW Zend_Validate_Interface looks odd to me today already, for that
reason exactly. I read two namespaces and a classname, and that
classname doesn't make much sense.
--
troels