The method getEditItemLink has a boolean flag argument $userSide, which is a certain sign of a Single Responsibility Principle violation. Open
public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=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
The method getEditItemLink has a boolean flag argument $withimage, which is a certain sign of a Single Responsibility Principle violation. Open
public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=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
The method getDeleteItemLink has a boolean flag argument $withimage, which is a certain sign of a Single Responsibility Principle violation. Open
public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=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
The method getEditItemLink has a boolean flag argument $onlyUrl, which is a certain sign of a Single Responsibility Principle violation. Open
public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=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
The method getDeleteItemLink has a boolean flag argument $userSide, which is a certain sign of a Single Responsibility Principle violation. Open
public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=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
The method getDeleteItemLink has a boolean flag argument $onlyUrl, which is a certain sign of a Single Responsibility Principle violation. Open
public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=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 static access to class 'icms_ipf_Handler' in method '__construct'. Open
icms_ipf_Handler::__construct($db, 'blockspadmin', 'id', 'title', 'description', 'system');
- Read upRead up
- 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
Call to undeclared method \SystemBlockspadmin::hideFieldFromForm
Open
$this->hideFieldFromForm('id');
- Exclude checks
Call to undeclared method \SystemBlockspadmin::getVar
Open
$rtn = defined($this->getVar('title')) ? constant($this->getVar('title')) : $this->getVar('title');
- Exclude checks
Reference to undeclared class \icms_view_block_position_Object
Open
return parent::getEditItemLink($onlyUrl, $withimage, $userSide);
- Exclude checks
Call to undeclared method \SystemBlockspadmin::hideFieldFromForm
Open
$this->hideFieldFromForm('block_default');
- Exclude checks
Call to undeclared method \SystemBlockspadmin::hideFieldFromForm
Open
$this->hideFieldFromForm('block_type');
- Exclude checks
Default value for string
$onlyUrl
can't be false
Open
public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {
- Exclude checks
Reference to undeclared property \SystemBlockspadminHandler->db
(Did you mean $db) Open
$this->table = $this->db->prefix('block_positions');
- Exclude checks
Static call to undeclared method icms_ipf_Handler::__construct()
Open
icms_ipf_Handler::__construct($db, 'blockspadmin', 'id', 'title', 'description', 'system');
- Exclude checks
Call to undeclared method \SystemBlockspadmin::getVar
Open
if ($this->getVar('block_default') == 1) return "";
- Exclude checks
Class extends undeclared class \icms_view_block_position_Handler
Open
class SystemBlockspadminHandler extends icms_view_block_position_Handler {
- Exclude checks
Reference to undeclared class \icms_view_block_position_Object
Open
return parent::getDeleteItemLink($onlyUrl, $withimage, $userSide);
- Exclude checks
Parameter $handler
has undeclared type \icms_view_block_position_Handler
Open
public function __construct(& $handler) {
- Exclude checks
Parameter $db
has undeclared type \IcmsDatabase
Open
public function __construct(& $db) {
- Exclude checks
Reference to undeclared class \icms_view_block_position_Object
Open
parent::__construct( $handler );
- Exclude checks
Class extends undeclared class \icms_view_block_position_Object
Open
class SystemBlockspadmin extends icms_view_block_position_Object {
- Exclude checks
Default value for string
$onlyUrl
can't be false
Open
public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {
- Exclude checks
Call to undeclared method \SystemBlockspadmin::getVar
Open
if ($this->getVar('block_default') == 1) return "";
- Exclude checks
Call to method __construct
from undeclared class \icms_ipf_Handler
Open
icms_ipf_Handler::__construct($db, 'blockspadmin', 'id', 'title', 'description', 'system');
- Exclude checks
Reference to undeclared property \SystemBlockspadminHandler->table
Open
$this->table = $this->db->prefix('block_positions');
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class SystemBlockspadminHandler extends icms_view_block_position_Handler {
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class SystemBlockspadmin extends icms_view_block_position_Object {
- Exclude checks
Avoid variables with short names like $db. Configured minimum length is 3. Open
public function __construct(& $db) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Each class must be in a file by itself Open
class SystemBlockspadminHandler extends icms_view_block_position_Handler {
- Exclude checks
Incorrect spacing between default value and equals sign for argument "$onlyUrl"; expected 1 but found 0 Open
public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {
- Exclude checks
Incorrect spacing between argument "$userSide" and equals sign; expected 1 but found 0 Open
public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {
- Exclude checks
Incorrect spacing between default value and equals sign for argument "$onlyUrl"; expected 1 but found 0 Open
public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {
- Exclude checks
Incorrect spacing between argument "$withimage" and equals sign; expected 1 but found 0 Open
public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {
- Exclude checks
Incorrect spacing between default value and equals sign for argument "$withimage"; expected 1 but found 0 Open
public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {
- Exclude checks
Incorrect spacing between argument "$withimage" and equals sign; expected 1 but found 0 Open
public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {
- Exclude checks
The closing brace for the class must go on the next line after the body Open
}
- Exclude checks
Incorrect spacing between default value and equals sign for argument "$userSide"; expected 1 but found 0 Open
public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {
- Exclude checks
Expected 1 blank line at end of file; 2 found Open
}
- Exclude checks
Incorrect spacing between default value and equals sign for argument "$withimage"; expected 1 but found 0 Open
public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {
- Exclude checks
Incorrect spacing between argument "$onlyUrl" and equals sign; expected 1 but found 0 Open
public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {
- Exclude checks
Incorrect spacing between argument "$onlyUrl" and equals sign; expected 1 but found 0 Open
public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {
- Exclude checks
Incorrect spacing between default value and equals sign for argument "$userSide"; expected 1 but found 0 Open
public function getDeleteItemLink($onlyUrl=false, $withimage=true, $userSide=false) {
- Exclude checks
Incorrect spacing between argument "$userSide" and equals sign; expected 1 but found 0 Open
public function getEditItemLink($onlyUrl=false, $withimage=true, $userSide=false) {
- Exclude checks
Inline control structures are not allowed Open
if ($this->getVar('block_default') == 1) return "";
- Exclude checks
Inline control structures are not allowed Open
if ($this->getVar('block_default') == 1) return "";
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
parent::__construct( $handler );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
parent::__construct( $handler );
- Exclude checks