core/GlobalComponent.php
Avoid using static access to class 'Zend_Registry' in method 'getLogger'. Open
Open
return Zend_Registry::get('logger');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class MIDAS_GlobalComponent extends Zend_Controller_Action_Helper_Abstract
- Create a ticketCreate a ticket
- Exclude checks
The class MIDAS_GlobalComponent is not named in CamelCase. Open
Open
class MIDAS_GlobalComponent extends Zend_Controller_Action_Helper_Abstract
{
/**
* Fetch the logger from the Zend registry.
*
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Class name "MIDAS_GlobalComponent" is not in camel caps format Open
Open
class MIDAS_GlobalComponent extends Zend_Controller_Action_Helper_Abstract
- Create a ticketCreate a ticket
- Exclude checks