Showing 14 of 14 total issues
Avoid using static access to class '\Granam\Integer\Tools\ToInteger' in method 'sub'. Open
$this->getValue() - ToInteger::toInteger($value) // current addition is injected as second parameter
- Read upRead up
- Exclude checks
Avoid using static access to class '\Granam\Scalar\Tools\ToString' in method '__construct'. Open
$parts = $this->parseParts(ToString::toString($difficultyAdditionByRealmsNotation));
- Read upRead up
- Exclude checks
Avoid using static access to class '\Granam\Integer\Tools\ToInteger' in method 'sanitizeRealms'. Open
return ToInteger::toPositiveInteger($realmIncrement);
- Read upRead up
- Exclude checks
Avoid using static access to class '\Granam\Tools\ValueDescriber' in method 'sanitizeAddition'. Open
'Expected integer for addition by realm, got ' . ValueDescriber::describe($addition)
- Read upRead up
- Exclude checks
Avoid using static access to class '\Granam\Tools\ValueDescriber' in method '__construct'. Open
. ValueDescriber::describe($difficultyAdditionByRealmsNotation)
- Read upRead up
- Exclude checks
Avoid using static access to class '\Granam\Integer\Tools\ToInteger' in method 'add'. Open
$this->getValue() + ToInteger::toInteger($value) // current addition is injected as second parameter
- Read upRead up
- Exclude checks
The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else { throw new Exceptions\InvalidFormatOfAdditionByRealmsNotation( "Expected addition by realms in format 'number' or 'number=number', got " . ValueDescriber::describe($difficultyAdditionByRealmsNotation) );
- Read upRead up
- Exclude checks
Avoid using static access to class '\Granam\Tools\ValueDescriber' in method 'sanitizeRealms'. Open
'Expected positive integer for realms increment , got ' . ValueDescriber::describe($realmIncrement)
- Read upRead up
- Exclude checks
Avoid using static access to class '\Granam\Integer\Tools\ToInteger' in method 'sanitizeAddition'. Open
return ToInteger::toInteger($addition);
- Read upRead up
- Exclude checks
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function __construct($difficultyAdditionByRealmsNotation, int $currentAddition = null) { $parts = $this->parseParts(ToString::toString($difficultyAdditionByRealmsNotation)); if (\count($parts) === 1 && \array_keys($parts) === [0]) { $this->realmsChangePerAdditionStep = 1;
- Read upRead up
Avoid excessively long variable names like $realmsChangePerAdditionStep. Keep variable name length under 20. Open
private $realmsChangePerAdditionStep;
- Read upRead up
- Exclude checks
Avoid excessively long variable names like $difficultyAdditionPerStep. Keep variable name length under 20. Open
private $difficultyAdditionPerStep;
- Read upRead up
- Exclude checks
Avoid excessively long variable names like $difficultyAdditionByRealmsNotation. Keep variable name length under 20. Open
public function __construct($difficultyAdditionByRealmsNotation, int $currentAddition = null)
- Read upRead up
- Exclude checks
Avoid excessively long variable names like $additionByRealmNotation. Keep variable name length under 20. Open
private function parseParts(string $additionByRealmNotation): array
- Read upRead up
- Exclude checks