Issues

ZF-9187: Add explanatory note as to why _Abstract, _Interface classnames are no longer valid

Issue Type: Docs: Improvement Created: 2010-02-16T04:02:46.000+0000 Last Updated: 2010-02-23T10:07:17.000+0000 Status: Resolved Fix version(s): - 1.10.2 (24/Feb/10)

Reporter: Richard George (parsingphase) Assignee: Matthew Weier O'Phinney (matthew) Tags: Related issues: Attachments:

Description

http://framework.zend.com/manual/en/…

Add a note explaining that with future namespacing, these classes could be renamed(?) to use reserved words Interface, Abstract. (OR called as such? Not entirely familiar with namespacing plans).

Is it now the case that the last part of ANY classname must not be a reserved word?

Comments

Posted by Matthew Weier O'Phinney (matthew) on 2010-02-16T15:41:40.000+0000

Um... there's already a note saying that they could be renamed in future versions. What more do you feel needs to be added, exactly?

The reason why the last segment cannot be Abstract or Interface is that when we change the following:

<pre class="highlight">
Zend_Controller_Request_Abstract

to use namespaces, a literal change will leave this:

<pre class="highlight">
namespace Zend\Controller\Request;

abstract class Abstract
{
 ...
}

which leaves that last segment as a reserved PHP keyword, leading to parse errors. We decided simply to pre-empt this and start naming new classes appropriately in preparation for a switch to namespaces.

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2010-02-16T16:36:09.000+0000

Matthew, doesn't it make sense if that is what we put in the reference guide? To people who don't know the reasoning behind this, it seems very strange that exactly at this part we deviated from the PEAR standards (this is why this issue was added for).

Posted by Richard George (parsingphase) on 2010-02-16T23:19:00.000+0000

Just a Dolf said; the "what" is specified, the "why" is not. Coders will follow the standard far more happily when they understand the reason behind it. Your explanation here would be ideal as most of us haven't played with namespaces yet.

Posted by Matthew Weier O'Phinney (matthew) on 2010-02-23T10:07:16.000+0000

Explanations added in the manual in trunk and 1.10 release branch.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts