The method Ajde_Crud_Options::display() calls the typical debug function var_dump() which is mostly only used during development. Open
var_dump($this->_stack);
- Read upRead up
- Exclude checks
DevelopmentCodeFragment
Since: 2.3.0
Functions like vardump(), printr() etc. are normally only used during development and therefore such calls in production code are a good indicator that they were just forgotten.
Example
class SuspectCode {
public function doSomething(array $items)
{
foreach ($items as $i => $item) {
// …
if ('qafoo' == $item) var_dump($i);
// …
}
}
}
Source https://phpmd.org/rules/design.html#developmentcodefragment
The method up has a boolean flag argument $obj, which is a certain sign of a Single Responsibility Principle violation. Open
public function up($obj = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Avoid using short method names like Ajde_Crud_Options::up(). The configured minimum method name length is 3. Open
public function up($obj = false)
{
if (!$obj) {
$obj = $this;
}
- Read upRead up
- Exclude checks
ShortMethodName
Since: 0.2
Detects when very short method names are used.
Example
class ShortMethod {
public function a( $index ) { // Violation
}
}
Source https://phpmd.org/rules/naming.html#shortmethodname
The property $_parent is not named in camelCase. Open
class Ajde_Crud_Options extends Ajde_Object_Standard
{
protected $_key;
/**
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The class Ajde_Crud_Options is not named in CamelCase. Open
class Ajde_Crud_Options extends Ajde_Object_Standard
{
protected $_key;
/**
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
The property $_key is not named in camelCase. Open
class Ajde_Crud_Options extends Ajde_Object_Standard
{
protected $_key;
/**
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $_stack is not named in camelCase. Open
class Ajde_Crud_Options extends Ajde_Object_Standard
{
protected $_key;
/**
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The method _select is not named in camelCase. Open
protected function _select($name, $key = null)
{
$key = isset($key) ? $key : $name;
// Get new active object
$className = get_class($this).'_'.ucfirst($name);
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method _set is not named in camelCase. Open
protected function _set($key, $value)
{
parent::_set($key, $value);
return $this;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}