Method AdjacentCellsProvider
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function AdjacentCellsProvider() : array
{
$battlefield = MockFactory::getBattlefieldMock();
$battlefield->getCellByCoordinate('A2')->setFlags(CellModel::FLAG_DEAD);
Method getAdjacentCells
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getAdjacentCells(string $initCoordinate, array $expectedCoordinates, Battlefield $battlefield, int $levels, int $onlyFlag, int $excludeFlag)
Avoid using static access to class '\EM\Tests\Environment\Factory\MockFactory' in method 'AdjacentCellsProvider'. Open
$battlefield = MockFactory::getBattlefieldMock();
- 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
Avoid using static access to class '\EM\Tests\Environment\Factory\MockFactory' in method 'AdjacentCellsProvider'. Open
MockFactory::getBattlefieldMock(),
- 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
Avoid using static access to class '\EM\Tests\Environment\Factory\MockFactory' in method 'AdjacentCellsProvider'. Open
MockFactory::getBattlefieldMock(),
- 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
Method name "PathProcessorTest::AdjacentCellsProvider" is not in camel caps format Open
public function AdjacentCellsProvider() : array
- Exclude checks
Line exceeds 120 characters; contains 131 characters Open
* extended paths list contains all paths from @see PathProcessor::$primaryPaths and 4 additional paths: (LEFT|RIGHT)-(UP|DOWN)
- Exclude checks
Line exceeds 120 characters; contains 160 characters Open
public function getAdjacentCells(string $initCoordinate, array $expectedCoordinates, Battlefield $battlefield, int $levels, int $onlyFlag, int $excludeFlag)
- Exclude checks
The method AdjacentCellsProvider is not named in camelCase. Open
public function AdjacentCellsProvider() : array
{
$battlefield = MockFactory::getBattlefieldMock();
$battlefield->getCellByCoordinate('A2')->setFlags(CellModel::FLAG_DEAD);
- 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() {
}
}