third_party/MX/Controller.php
Avoid using undefined variables such as '$registry' which will lead to PHP notices. Open
Open
Modules::$registry[strtolower($class)] = $this;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Call to undeclared function \load_class()
Open
Open
$this->load = clone load_class('Loader');
- Exclude checks
Reference to undeclared property \MX_Controller->load
Open
Open
$this->load = clone load_class('Loader');
- Exclude checks
Saw unextractable annotation for comment '* @param [type] $class [description]'
Open
Open
* @param [type] $class [description]
- Exclude checks
Call to undeclared function \log_message()
Open
Open
log_message('debug', $class.' MX_Controller Initialized');
- Exclude checks
The phpdoc comment for @method
cannot occur on a method
Open
Open
* @method __get
- Exclude checks
The phpdoc comment for @method
cannot occur on a method
Open
Open
* @method __construct
- Exclude checks
Saw unextractable annotation for comment '* @return [type] [description]'
Open
Open
* @return [type] [description]
- Exclude checks
Saw unextractable annotation for comment '* @method __construct'
Open
Open
* @method __construct
- Exclude checks
Reference to undeclared property \CI->config
Open
Open
$class = str_replace(CI::$APP->config->item('controller_suffix'), '', get_class($this));
- Exclude checks
Saw unextractable annotation for comment '* @method __get'
Open
Open
* @method __get
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class MX_Controller
- Exclude checks
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 39 and the first side effect is on line 1. Open
Open
<?php defined('BASEPATH') or exit('No direct script access allowed');
- Exclude checks
The class MX_Controller is not named in CamelCase. Open
Open
class MX_Controller
{
public $autoload = [];
/**
- 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
Class name "MX_Controller" is not in camel caps format Open
Open
class MX_Controller
- Exclude checks