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
|
// uncomment to reach your current PHP version
|
||||||
->withPhpSets()
|
->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([
|
->withSkip([
|
||||||
LocallyCalledStaticMethodToNonStaticRector::class,
|
LocallyCalledStaticMethodToNonStaticRector::class
|
||||||
]);;
|
]);;
|
||||||
|
@ -301,9 +301,8 @@ class Matrix
|
|||||||
|
|
||||||
if ($isEven) {
|
if ($isEven) {
|
||||||
return $this->getMinorMatrix($rowToRemove, $columnToRemove)->getDeterminant();
|
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
|
public function equals(Matrix $otherMatrix): bool
|
||||||
|
@ -13,7 +13,7 @@ class PartialPlay
|
|||||||
// HACK to get around bug near 0
|
// HACK to get around bug near 0
|
||||||
$smallestPercentage = 0.0001;
|
$smallestPercentage = 0.0001;
|
||||||
if ($partialPlayPercentage < $smallestPercentage) {
|
if ($partialPlayPercentage < $smallestPercentage) {
|
||||||
$partialPlayPercentage = $smallestPercentage;
|
return $smallestPercentage;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $partialPlayPercentage;
|
return $partialPlayPercentage;
|
||||||
|
@ -9,10 +9,13 @@ class Team extends RatingContainer
|
|||||||
public function __construct(Player $player = NULL, Rating $rating = NULL)
|
public function __construct(Player $player = NULL, Rating $rating = NULL)
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
if (!$player instanceof \DNW\Skills\Player) {
|
||||||
if ($player && $rating) {
|
return;
|
||||||
$this->addPlayer($player, $rating);
|
|
||||||
}
|
}
|
||||||
|
if (!$rating instanceof \DNW\Skills\Rating) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$this->addPlayer($player, $rating);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addPlayer(Player $player, Rating $rating): self
|
public function addPlayer(Player $player, Rating $rating): self
|
||||||
|
Reference in New Issue
Block a user