for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Xoco70\KendoTournaments\TreeGen;
use Illuminate\Support\Collection;
use Xoco70\KendoTournaments\Models\Championship;
class DirectEliminationTreeGen extends TreeGen
{
/**
* Calculate the Byes need to fill the Championship Tree.
* @param Championship $championship
* @return Collection
*/
protected function getByeGroup(Championship $championship, $fighters)
$championship
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$fighterCount = $fighters->count();
$preliminaryGroupSize = 2;
$treeSize = $this->getTreeSize($fighterCount, $preliminaryGroupSize);
$byeCount = $treeSize - $fighterCount;
return $this->createNullsGroup($byeCount);
}
* Create empty groups for direct Elimination Tree
* @param $numFighters
public function pushEmptyGroupsToTree($numFighters)
// We calculate how much rounds we will have
$numFightersEliminatory = $numFighters;
$numRounds = intval(log($numFightersEliminatory, 2));
$this->pushGroups($numRounds, $numFightersEliminatory, $shuffle = 1);
$shuffle = 1
integer
boolean
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.