[TYPO3-core] Coding Guidelines about PHP Namespaces
Jigal van Hemert
jigal.van.hemert at typo3.org
Sun Mar 24 13:32:11 CET 2013
Hi,
On 24-3-2013 11:32, Benjamin Mack wrote:
> I also checked with FLOW how they handle it, and they use "as".
>
> use TYPO3\Flow\Annotations as Flow;
>
> Otherwise they don't use "use".
This looks highly confusing. Why is a class called "Annotations" if you
use it in the code as "Flow".
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication as DataHandler;
DataHandler::start()
...
TYPO3\CMS\Core\DataHandling\DataHandler::start($record, '');
(Bad example, but both classes have a method "start")
PHP probably wouldn't mind, but it can become very confusing what is
meant by some pieces of code.
If we make meaningful class names as we currently do in 6.x the use of
aliases should be discouraged IMO.
--
Jigal van Hemert
TYPO3 CMS Core Team member
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the TYPO3-team-core
mailing list