symfony - BooleanGetMethodName warning in phpmd -


i generate entities using doctrine mapping in symfony2, , code:

/**  * active  *  * @return boolean  */ public function getactive() {     return $this->active; } 

using jenkins , pmd plugin, throw booleangetmethodname warnings , suggest because getactive function return boolean, should renamed isactive or hasactive.

i have lot of files have warning. suppress warnings? if yes, how? or should replace functions name returning boolean value in symfony2 entity follow jenkins , pmd rule?

by pmd mean php mess detector?

if so, since have setup jenkins , php mess detector, assume care code smells , readability.

with in mind, advice is: rename of boolean methods follow issomething() or hassomething() conventions.

its important notice though code convention guide follow.

that simple , quick achieve, , give lots of benefits, such as:

  • possible bugs. bugs not wrongly written code. lot of times, poor conditions or bad management of scope can generate pretty hard find bugs.

  • suboptimal code. bad looking code can , dificult read. suboptimal code.

  • overcomplicated expressions

  • unused parameters, methods or properties

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -