avoid type juggling in conditions, always use explicit boolean conditions

This commit is contained in:
Dylan K. Taylor
2020-02-05 15:44:06 +00:00
parent b96bb7d824
commit e5a2cfb65f
17 changed files with 43 additions and 43 deletions

View File

@ -144,7 +144,7 @@ class CraftingManager{
*/
public static function sort(Item $i1, Item $i2){
//Use spaceship operator to compare each property, then try the next one if they are equivalent.
($retval = $i1->getId() <=> $i2->getId()) === 0 && ($retval = $i1->getDamage() <=> $i2->getDamage()) === 0 && ($retval = $i1->getCount() <=> $i2->getCount());
($retval = $i1->getId() <=> $i2->getId()) === 0 && ($retval = $i1->getDamage() <=> $i2->getDamage()) === 0 && ($retval = $i1->getCount() <=> $i2->getCount()) === 0;
return $retval;
}