mirror of
https://github.com/furyfire/trueskill.git
synced 2025-01-15 17:37:39 +00:00
rector: instanceOf, earlyReturn, strictBooleans
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user