Avoid assigning values to variables in if clauses and the like (line '64', column '17'). Open
protected function _setup()
{
// The list of containers that will be added to the composite container
$containers = $this->_createAddCapableList();
// The composite container - the container for this modular module
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid variables with short names like $c. Configured minimum length is 3. Open
protected function _run(ContainerInterface $c = null)
- 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
The variable $_module is not named in camelCase. Open
protected function _setup()
{
// The list of containers that will be added to the composite container
$containers = $this->_createAddCapableList();
// The composite container - the container for this modular module
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_moduleContainer is not named in camelCase. Open
protected function _setup()
{
// The list of containers that will be added to the composite container
$containers = $this->_createAddCapableList();
// The composite container - the container for this modular module
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_module is not named in camelCase. Open
protected function _setup()
{
// The list of containers that will be added to the composite container
$containers = $this->_createAddCapableList();
// The composite container - the container for this modular module
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_container is not named in camelCase. Open
protected function _setup()
{
// The list of containers that will be added to the composite container
$containers = $this->_createAddCapableList();
// The composite container - the container for this modular module
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_container is not named in camelCase. Open
protected function _setup()
{
// The list of containers that will be added to the composite container
$containers = $this->_createAddCapableList();
// The composite container - the container for this modular module
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_moduleContainer is not named in camelCase. Open
protected function _setup()
{
// The list of containers that will be added to the composite container
$containers = $this->_createAddCapableList();
// The composite container - the container for this modular module
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_module is not named in camelCase. Open
protected function _setup()
{
// The list of containers that will be added to the composite container
$containers = $this->_createAddCapableList();
// The composite container - the container for this modular module
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_module is not named in camelCase. Open
protected function _run(ContainerInterface $c = null)
{
foreach ($this->modules as $_module) {
$_module->run($c);
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_module is not named in camelCase. Open
protected function _run(ContainerInterface $c = null)
{
foreach ($this->modules as $_module) {
$_module->run($c);
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_module is not named in camelCase. Open
protected function _setup()
{
// The list of containers that will be added to the composite container
$containers = $this->_createAddCapableList();
// The composite container - the container for this modular module
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The method _setup is not named in camelCase. Open
protected function _setup()
{
// The list of containers that will be added to the composite container
$containers = $this->_createAddCapableList();
// The composite container - the container for this modular module
- 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 _run is not named in camelCase. Open
protected function _run(ContainerInterface $c = null)
{
foreach ($this->modules as $_module) {
$_module->run($c);
}
- 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 _createContainer is not named in camelCase. Open
abstract protected function _createContainer($definitions = [], ContainerInterface $parent = null);
- 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 _getInitialContainer is not named in camelCase. Open
abstract protected function _getInitialContainer(ContainerInterface $parent = null);
- 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 _createCompositeContainer is not named in camelCase. Open
abstract protected function _createCompositeContainer($containers);
- 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 _getModules is not named in camelCase. Open
abstract protected function _getModules(ContainerInterface $container = null);
- 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 _createAddCapableList is not named in camelCase. Open
abstract protected function _createAddCapableList();
- 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 _getModuleServiceKey is not named in camelCase. Open
abstract protected function _getModuleServiceKey(ModuleInterface $module);
- 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() {
}
}