rector: instanceOf, earlyReturn, strictBooleans

This commit is contained in:
Jens True 2024-02-21 14:02:35 +00:00
parent 0184d0432b
commit c781540aa6
4 changed files with 10 additions and 8 deletions

@ -14,7 +14,7 @@ return RectorConfig::configure()
])
// uncomment to reach your current PHP version
->withPhpSets()
->withPreparedSets(deadCode: true, codeQuality: true, codingStyle: true, typeDeclarations : true)
->withPreparedSets(deadCode: true, codeQuality: true, codingStyle: true, typeDeclarations : true, privatization: true, naming: false, instanceOf: true, earlyReturn: true, strictBooleans: true)
->withSkip([
LocallyCalledStaticMethodToNonStaticRector::class,
LocallyCalledStaticMethodToNonStaticRector::class
]);;

@ -301,9 +301,8 @@ class Matrix
if ($isEven) {
return $this->getMinorMatrix($rowToRemove, $columnToRemove)->getDeterminant();
} else {
return -1.0 * $this->getMinorMatrix($rowToRemove, $columnToRemove)->getDeterminant();
}
return -1.0 * $this->getMinorMatrix($rowToRemove, $columnToRemove)->getDeterminant();
}
public function equals(Matrix $otherMatrix): bool

@ -13,7 +13,7 @@ class PartialPlay
// HACK to get around bug near 0
$smallestPercentage = 0.0001;
if ($partialPlayPercentage < $smallestPercentage) {
$partialPlayPercentage = $smallestPercentage;
return $smallestPercentage;
}
return $partialPlayPercentage;

@ -9,10 +9,13 @@ class Team extends RatingContainer
public function __construct(Player $player = NULL, Rating $rating = NULL)
{
parent::__construct();
if ($player && $rating) {
$this->addPlayer($player, $rating);
if (!$player instanceof \DNW\Skills\Player) {
return;
}
if (!$rating instanceof \DNW\Skills\Rating) {
return;
}
$this->addPlayer($player, $rating);
}
public function addPlayer(Player $player, Rating $rating): self