Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Traits naming convention? [closed]

What is the naming convention for using traits in a Zend Framework project?

My_Form_Element_Traits or My_Form_Element_Trait?

I am thinking plural as it's a collection of methods and properties, however on the other hand it is one trait.

I also thought that maybe there are different traits I want to use so maybe it should be My_Form_Element_Traits_Preference

What is the best practice hear to this new feature?

like image 566
Moak Avatar asked Dec 27 '12 03:12

Moak


1 Answers

You might be interested in what convention is used by PHP-FIG: https://github.com/php-fig/fig-standards/blob/master/bylaws/002-psr-naming-conventions.md

And in my opinion, even when you use ZF1, you shouldn't follow this convention. I recommend you to use PSR-2

like image 145
Styx Avatar answered Nov 14 '22 23:11

Styx