tests/Stamina/GridOfFatigueTest.php
Avoid excessively long variable names like $gridOfFatigueWithoutFatigueAtAll. Keep variable name length under 20. Open
Open
$gridOfFatigueWithoutFatigueAtAll = new GridOfFatigue($this->createStamina(0 /* no fatigue */));
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
The method I_can_get_calculated_filled_half_rows_for_given_fatigue_value is not named in camelCase. Open
Open
public function I_can_get_calculated_filled_half_rows_for_given_fatigue_value(): void
{
// limit of fatigues divisible by two (odd)
$fatigueBoundary = $this->createFatigueBoundary(124);
- 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 I_can_get_maximum_of_fatigues_per_row is not named in camelCase. Open
Open
public function I_can_get_maximum_of_fatigues_per_row(): void
{
$fatigueBoundary = $this->createFatigueBoundary(123);
$gridOfFatigueWithoutFatigueAtAll = new GridOfFatigue($this->createStamina(0 /* no fatigue */));
self::assertSame(123, $gridOfFatigueWithoutFatigueAtAll->getFatiguePerRowMaximum($fatigueBoundary));
- 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 I_can_get_number_of_filled_rows is not named in camelCase. Open
Open
public function I_can_get_number_of_filled_rows(): void
{
$fatigueBoundary = $this->createFatigueBoundary(23);
$gridOfFatigue = new GridOfFatigue($this->createStamina(4));
- 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() {
}
}