diff --git a/database/factories/ChampionshipSettingsFactory.php b/database/factories/ChampionshipSettingsFactory.php
index 85f4169..d487d98 100644
--- a/database/factories/ChampionshipSettingsFactory.php
+++ b/database/factories/ChampionshipSettingsFactory.php
@@ -7,7 +7,8 @@
$factory->define(ChampionshipSettings::class, function (Faker\Generator $faker) use ($factory) {
$tcs = Championship::all()->pluck('id')->toArray();
- $fightingAreas = [1,2,4,8];
+ $fightingAreas = [1, 2, 4, 8];
+
return [
'championship_id' => $faker->randomElement($tcs),
'treeType' => $faker->numberBetween(0, 1),
diff --git a/src/TreeController.php b/src/TreeController.php
index 1b7358a..8f114d9 100644
--- a/src/TreeController.php
+++ b/src/TreeController.php
@@ -81,16 +81,16 @@ protected function provisionObjects(Request $request, $isTeam, $numFighters)
{
if ($isTeam) {
$championship = Championship::find(2);
- factory(Team::class, (int)$numFighters)->create(['championship_id' => $championship->id]);
+ factory(Team::class, (int) $numFighters)->create(['championship_id' => $championship->id]);
} else {
$championship = Championship::find(1);
- $users = factory(User::class, (int)$numFighters)->create();
+ $users = factory(User::class, (int) $numFighters)->create();
foreach ($users as $user) {
factory(Competitor::class)->create(
['championship_id' => $championship->id,
- 'user_id' => $user->id,
- 'confirmed' => 1,
- 'short_id' => $user->id,
+ 'user_id' => $user->id,
+ 'confirmed' => 1,
+ 'short_id' => $user->id,
]
);
}
@@ -133,11 +133,11 @@ public function update(Request $request, Championship $championship)
$fight->save();
}
}
+
return back();
}
-
- function getWinnerId($fighters, $scores, $numFighter)
+ public function getWinnerId($fighters, $scores, $numFighter)
{
return $scores[$numFighter] != null ? $fighters[$numFighter] : null;
}
diff --git a/src/TreeGen/CreateSingleEliminationTree.php b/src/TreeGen/CreateSingleEliminationTree.php
index c8e8ee4..86bd7ec 100644
--- a/src/TreeGen/CreateSingleEliminationTree.php
+++ b/src/TreeGen/CreateSingleEliminationTree.php
@@ -113,7 +113,8 @@ private function assignPositions()
}
/**
- * returns titles depending of number of rounds
+ * returns titles depending of number of rounds.
+ *
* @return array
*/
public function getRoundTitles()
@@ -139,11 +140,13 @@ public function getRoundTitles()
//The minus 3 is to ignore the final, semi final and quarter final rounds
for ($i = 0; $i < $noRounds - 3; $i++) {
- $tempRounds[] = 'Last ' . $noTeamsInFirstRound;
+ $tempRounds[] = 'Last '.$noTeamsInFirstRound;
$noTeamsInFirstRound /= 2;
}
+
return array_merge($tempRounds, $roundTitles);
}
+
return $roundTitle[$this->numFighters];
}
@@ -159,7 +162,7 @@ public function printRoundTitles()
foreach ($roundTitles as $key => $roundTitle) {
$left = $key * ($this->matchWrapperWidth + $this->roundSpacing - 1);
- echo '
' . $roundTitle . '
';
+ echo ''.$roundTitle.'
';
}
echo '';
}
@@ -172,7 +175,7 @@ public function printRoundTitles()
public function getPlayerList($selected)
{
$html = '