Completed
Push — master ( d565f6...12549b )
by Michael
02:45
created
app/models/User.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 use Zizaco\Confide\ConfideUser;
4 4
 use Zizaco\Confide\ConfideUserInterface;
5 5
 
6
-class User extends Eloquent implements ConfideUserInterface
7
-{
6
+class User extends Eloquent implements ConfideUserInterface {
8 7
 	use ConfideUser;
9 8
 }
10 9
\ No newline at end of file
Please login to merge, or discard this patch.
app/library/Classes/Statistics/PlayerStatistics.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -3,38 +3,38 @@
 block discarded – undo
3 3
 
4 4
 interface PlayerStatistics {
5 5
 
6
-    public function matchesHandicap($playerId);
7
-    public function scoringAverage($playerId);
8
-    public function scoringAverageByYear($playerId, $year);
9
-    public function scoringAverageMatchesByYear($year);
10
-    public function handicapRounds($playerId);
11
-
12
-    public function scoringAverageCourse($course);
13
-    public function scoringAverageCourseByYear($course, $year);
14
-    public function scoringAverageCourseMatchesByYear($course, $year);
15
-
16
-    public function totalEagles();
17
-    public function eaglesByYear($year);
18
-    public function eaglesMatchesByYear($year);
19
-
20
-    public function totalBirdies($playerId);
21
-    public function birdiesByYear($playerId, $year);
22
-    public function birdiesMatchesByYear($year);
23
-
24
-    public function totalPars();
25
-    public function parsByYear($year);
26
-    public function parsMatchesByYear($year);
27
-
28
-    public function totalbogeys();
29
-    public function bogeysByYear($year);
30
-    public function bogeysMatchesByYear($year);
31
-
32
-    public function totalDoubles();
33
-    public function doublesByYear($year);
34
-    public function doublesMatchesByYear($year);
35
-
36
-    public function totalOthers();
37
-    public function othersByYear($year);
38
-    public function othersMatchesByYear($year);
6
+	public function matchesHandicap($playerId);
7
+	public function scoringAverage($playerId);
8
+	public function scoringAverageByYear($playerId, $year);
9
+	public function scoringAverageMatchesByYear($year);
10
+	public function handicapRounds($playerId);
11
+
12
+	public function scoringAverageCourse($course);
13
+	public function scoringAverageCourseByYear($course, $year);
14
+	public function scoringAverageCourseMatchesByYear($course, $year);
15
+
16
+	public function totalEagles();
17
+	public function eaglesByYear($year);
18
+	public function eaglesMatchesByYear($year);
19
+
20
+	public function totalBirdies($playerId);
21
+	public function birdiesByYear($playerId, $year);
22
+	public function birdiesMatchesByYear($year);
23
+
24
+	public function totalPars();
25
+	public function parsByYear($year);
26
+	public function parsMatchesByYear($year);
27
+
28
+	public function totalbogeys();
29
+	public function bogeysByYear($year);
30
+	public function bogeysMatchesByYear($year);
31
+
32
+	public function totalDoubles();
33
+	public function doublesByYear($year);
34
+	public function doublesMatchesByYear($year);
35
+
36
+	public function totalOthers();
37
+	public function othersByYear($year);
38
+	public function othersMatchesByYear($year);
39 39
 
40 40
 }
41 41
\ No newline at end of file
Please login to merge, or discard this patch.
app/models/UserValidator.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,7 @@
 block discarded – undo
9 9
 use Zizaco\Confide\UserValidator as ConfideUserValidator;
10 10
 use Zizaco\Confide\UserValidatorInterface;
11 11
 
12
-class UserValidator extends ConfideUserValidator implements UserValidatorInterface
13
-{
12
+class UserValidator extends ConfideUserValidator implements UserValidatorInterface {
14 13
 
15 14
     public $rules = [
16 15
         'create' => [
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -12,14 +12,14 @@
 block discarded – undo
12 12
 class UserValidator extends ConfideUserValidator implements UserValidatorInterface
13 13
 {
14 14
 
15
-    public $rules = [
16
-        'create' => [
17
-            'email'    => 'required|email',
18
-            'password' => 'required|min:8',
19
-        ],
20
-        'update' => [
21
-            'email'    => 'required|email',
22
-            'password' => 'required|min:8',
23
-        ]
24
-    ];
15
+	public $rules = [
16
+		'create' => [
17
+			'email'    => 'required|email',
18
+			'password' => 'required|min:8',
19
+		],
20
+		'update' => [
21
+			'email'    => 'required|email',
22
+			'password' => 'required|min:8',
23
+		]
24
+	];
25 25
 }
26 26
\ No newline at end of file
Please login to merge, or discard this patch.
app/controllers/MatchEditController.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,12 +4,12 @@
 block discarded – undo
4 4
 
5 5
 class MatchEditController extends \BaseController {
6 6
 
7
-    public function __construct(MatchRepository $matchRepository)
8
-    {
9
-        $this->matchRepo = $matchRepository;
10
-    }
7
+	public function __construct(MatchRepository $matchRepository)
8
+	{
9
+		$this->matchRepo = $matchRepository;
10
+	}
11 11
 
12
-    /**
12
+	/**
13 13
 	 * Display a listing of the resource.
14 14
 	 *
15 15
 	 * @return Response
Please login to merge, or discard this patch.
app/library/Classes/Statistics/CourseStatistics.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@
 block discarded – undo
3 3
 
4 4
 interface CourseStatistics {
5 5
 
6
-    public function averageScore($courseId);
7
-    public function averageScoreByPlayer($courseId, $playerId);
8
-    public function averageScoreByYear($courseId, $year);
9
-    public function averageScoreByPlayerAndYear($courseId, $playerId, $year);
6
+	public function averageScore($courseId);
7
+	public function averageScoreByPlayer($courseId, $playerId);
8
+	public function averageScoreByYear($courseId, $year);
9
+	public function averageScoreByPlayerAndYear($courseId, $playerId, $year);
10 10
 
11 11
 }
12 12
\ No newline at end of file
Please login to merge, or discard this patch.
app/library/Classes/Statistics/CourseStatisticsEloquent.php 3 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
         {
15 15
             return $round->score;
16 16
         });
17
-        if($rounds->count() > 0) {
18
-            return round(array_sum($scores->toArray())/($rounds->count()), 2);
17
+        if ($rounds->count() > 0) {
18
+            return round(array_sum($scores->toArray()) / ($rounds->count()), 2);
19 19
         } else {
20 20
             return $rounds;
21 21
         }
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
         {
30 30
             return $round->score;
31 31
         });
32
-        if($rounds->count() > 0) {
33
-            return round(array_sum($scores->toArray())/($rounds->count()), 2);
32
+        if ($rounds->count() > 0) {
33
+            return round(array_sum($scores->toArray()) / ($rounds->count()), 2);
34 34
         } else {
35 35
             return $rounds;
36 36
         }
@@ -38,16 +38,16 @@  discard block
 block discarded – undo
38 38
     public function averageScoreByYear($courseId, $year)
39 39
     {
40 40
         $rounds = Round::where('course_id', '=', $courseId)
41
-            ->where('date', '>=', $year . $this->date1)
42
-            ->where('date', '<=', $year . $this->date2)
41
+            ->where('date', '>=', $year.$this->date1)
42
+            ->where('date', '<=', $year.$this->date2)
43 43
             ->get();
44 44
         $scores = $rounds->map(function($round)
45 45
         {
46 46
             return $round->score;
47 47
         });
48 48
 
49
-        if($rounds->count() > 0) {
50
-            return round(array_sum($scores->toArray())/($rounds->count()), 2);
49
+        if ($rounds->count() > 0) {
50
+            return round(array_sum($scores->toArray()) / ($rounds->count()), 2);
51 51
         } else {
52 52
             return $rounds;
53 53
         }
@@ -56,16 +56,16 @@  discard block
 block discarded – undo
56 56
     {
57 57
         $rounds = Round::where('course_id', '=', $courseId)
58 58
             ->where('player_id', '=', $playerId)
59
-            ->where('date', '>=', $year . $this->date1)
60
-            ->where('date', '<=', $year . $this->date2)
59
+            ->where('date', '>=', $year.$this->date1)
60
+            ->where('date', '<=', $year.$this->date2)
61 61
             ->get();
62 62
         $scores = $rounds->map(function($round)
63 63
         {
64 64
             return $round->score;
65 65
         });
66 66
 
67
-        if($rounds->count() > 0) {
68
-            return round(array_sum($scores->toArray())/($rounds->count()), 2);
67
+        if ($rounds->count() > 0) {
68
+            return round(array_sum($scores->toArray()) / ($rounds->count()), 2);
69 69
         } else {
70 70
             return $rounds;
71 71
         }
Please login to merge, or discard this patch.
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -5,75 +5,75 @@
 block discarded – undo
5 5
 
6 6
 class CourseStatisticsEloquent implements CourseStatistics
7 7
 {
8
-    private $date1 = '-01-01';
9
-    private $date2 = '-12-31';
8
+	private $date1 = '-01-01';
9
+	private $date2 = '-12-31';
10 10
 
11
-    public function averageScore($courseId)
12
-    {
13
-        $today = Carbon::today()->toDateString();
14
-        $rounds = Round::where('course_id', '=', $courseId)
15
-            ->where('date', '<', $today)->get();
16
-        $scores = $rounds->map(function($round)
17
-        {
18
-            return $round->score;
19
-        });
20
-        if($rounds->count() > 0) {
21
-            return round(array_sum($scores->toArray())/($rounds->count()), 2);
22
-        } else {
23
-            return $rounds;
24
-        }
25
-    }
26
-    public function averageScoreByPlayer($courseId, $playerId)
27
-    {
28
-        $today = Carbon::today()->toDateString();
29
-        $rounds = Round::where('course_id', '=', $courseId)
30
-            ->where('date', '<', $today)
31
-            ->where('player_id', '=', $playerId)
32
-            ->get();
33
-        $scores = $rounds->map(function($round)
34
-        {
35
-            return $round->score;
36
-        });
37
-        if($rounds->count() > 0) {
38
-            return round(array_sum($scores->toArray())/($rounds->count()), 2);
39
-        } else {
40
-            return $rounds;
41
-        }
42
-    }
43
-    public function averageScoreByYear($courseId, $year)
44
-    {
45
-        $rounds = Round::where('course_id', '=', $courseId)
46
-            ->where('date', '>=', $year . $this->date1)
47
-            ->where('date', '<=', $year . $this->date2)
48
-            ->get();
49
-        $scores = $rounds->map(function($round)
50
-        {
51
-            return $round->score;
52
-        });
11
+	public function averageScore($courseId)
12
+	{
13
+		$today = Carbon::today()->toDateString();
14
+		$rounds = Round::where('course_id', '=', $courseId)
15
+			->where('date', '<', $today)->get();
16
+		$scores = $rounds->map(function($round)
17
+		{
18
+			return $round->score;
19
+		});
20
+		if($rounds->count() > 0) {
21
+			return round(array_sum($scores->toArray())/($rounds->count()), 2);
22
+		} else {
23
+			return $rounds;
24
+		}
25
+	}
26
+	public function averageScoreByPlayer($courseId, $playerId)
27
+	{
28
+		$today = Carbon::today()->toDateString();
29
+		$rounds = Round::where('course_id', '=', $courseId)
30
+			->where('date', '<', $today)
31
+			->where('player_id', '=', $playerId)
32
+			->get();
33
+		$scores = $rounds->map(function($round)
34
+		{
35
+			return $round->score;
36
+		});
37
+		if($rounds->count() > 0) {
38
+			return round(array_sum($scores->toArray())/($rounds->count()), 2);
39
+		} else {
40
+			return $rounds;
41
+		}
42
+	}
43
+	public function averageScoreByYear($courseId, $year)
44
+	{
45
+		$rounds = Round::where('course_id', '=', $courseId)
46
+			->where('date', '>=', $year . $this->date1)
47
+			->where('date', '<=', $year . $this->date2)
48
+			->get();
49
+		$scores = $rounds->map(function($round)
50
+		{
51
+			return $round->score;
52
+		});
53 53
 
54
-        if($rounds->count() > 0) {
55
-            return round(array_sum($scores->toArray())/($rounds->count()), 2);
56
-        } else {
57
-            return $rounds;
58
-        }
59
-    }
60
-    public function averageScoreByPlayerAndYear($courseId, $playerId, $year)
61
-    {
62
-        $rounds = Round::where('course_id', '=', $courseId)
63
-            ->where('player_id', '=', $playerId)
64
-            ->where('date', '>=', $year . $this->date1)
65
-            ->where('date', '<=', $year . $this->date2)
66
-            ->get();
67
-        $scores = $rounds->map(function($round)
68
-        {
69
-            return $round->score;
70
-        });
54
+		if($rounds->count() > 0) {
55
+			return round(array_sum($scores->toArray())/($rounds->count()), 2);
56
+		} else {
57
+			return $rounds;
58
+		}
59
+	}
60
+	public function averageScoreByPlayerAndYear($courseId, $playerId, $year)
61
+	{
62
+		$rounds = Round::where('course_id', '=', $courseId)
63
+			->where('player_id', '=', $playerId)
64
+			->where('date', '>=', $year . $this->date1)
65
+			->where('date', '<=', $year . $this->date2)
66
+			->get();
67
+		$scores = $rounds->map(function($round)
68
+		{
69
+			return $round->score;
70
+		});
71 71
 
72
-        if($rounds->count() > 0) {
73
-            return round(array_sum($scores->toArray())/($rounds->count()), 2);
74
-        } else {
75
-            return $rounds;
76
-        }
77
-    }
72
+		if($rounds->count() > 0) {
73
+			return round(array_sum($scores->toArray())/($rounds->count()), 2);
74
+		} else {
75
+			return $rounds;
76
+		}
77
+	}
78 78
 
79 79
 }
80 80
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,7 @@
 block discarded – undo
3 3
 use Carbon\Carbon;
4 4
 use \Round;
5 5
 
6
-class CourseStatisticsEloquent implements CourseStatistics
7
-{
6
+class CourseStatisticsEloquent implements CourseStatistics {
8 7
     private $date1 = '-01-01';
9 8
     private $date2 = '-12-31';
10 9
 
Please login to merge, or discard this patch.
app/library/Classes/Statistics/LeagueStatistics.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -3,36 +3,36 @@
 block discarded – undo
3 3
 
4 4
 interface LeagueStatistics {
5 5
 
6
-    public function topFiveLowestScores();
7
-    public function topFiveLowestScoresByYear($year);
8
-    public function topFiveScoringAverageByYear($year);
9
-    public function topFiveNetScoresByYear($year);
10
-    public function mostSkinsByYear($year);
11
-    public function totalEagles($year);
12
-    public function totalBirdies($year);
13
-    public function totalPars($year);
14
-    public function totalBogeys($year);
15
-    public function totalDoubles($year);
16
-    public function totalOthers($year);
6
+	public function topFiveLowestScores();
7
+	public function topFiveLowestScoresByYear($year);
8
+	public function topFiveScoringAverageByYear($year);
9
+	public function topFiveNetScoresByYear($year);
10
+	public function mostSkinsByYear($year);
11
+	public function totalEagles($year);
12
+	public function totalBirdies($year);
13
+	public function totalPars($year);
14
+	public function totalBogeys($year);
15
+	public function totalDoubles($year);
16
+	public function totalOthers($year);
17 17
 
18
-    public function netScoresByPlayer($playerId);
19
-    public function netScoresByPlayerTop($playerId,$number);
20
-    public function netScoresByPlayerYear($playerId, $year);
21
-    public function netScoresByPlayerTopYear($playerId,$top, $year);
18
+	public function netScoresByPlayer($playerId);
19
+	public function netScoresByPlayerTop($playerId,$number);
20
+	public function netScoresByPlayerYear($playerId, $year);
21
+	public function netScoresByPlayerTopYear($playerId,$top, $year);
22 22
 
23
-    public function netScoresLeague();
24
-    public function netScoresLeagueTop($number);
25
-    public function netScoresLeagueYear($year);
26
-    public function netScoresLeagueTopYear($top,$year);
23
+	public function netScoresLeague();
24
+	public function netScoresLeagueTop($number);
25
+	public function netScoresLeagueYear($year);
26
+	public function netScoresLeagueTopYear($top,$year);
27 27
 
28
-    // Cumulative Net returns +/- relative to par
29
-    public function netCumulative();
30
-    public function netCumulativeTop($top);
31
-    public function netCumulativeByPlayer($playerId);
32
-    public function netCumulativeByPlayerTop($playerId,$top);
33
-    public function netCumulativeYear($year);
34
-    public function netCumulativeTopYear($top,$year);
35
-    public function netCumulativeByPlayerYear($playerId,$year);
36
-    public function netCumulativeByPlayerTopYear($playerId,$top,$year);
28
+	// Cumulative Net returns +/- relative to par
29
+	public function netCumulative();
30
+	public function netCumulativeTop($top);
31
+	public function netCumulativeByPlayer($playerId);
32
+	public function netCumulativeByPlayerTop($playerId,$top);
33
+	public function netCumulativeYear($year);
34
+	public function netCumulativeTopYear($top,$year);
35
+	public function netCumulativeByPlayerYear($playerId,$year);
36
+	public function netCumulativeByPlayerTopYear($playerId,$top,$year);
37 37
 
38 38
 }
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,23 +16,23 @@
 block discarded – undo
16 16
     public function totalOthers($year);
17 17
 
18 18
     public function netScoresByPlayer($playerId);
19
-    public function netScoresByPlayerTop($playerId,$number);
19
+    public function netScoresByPlayerTop($playerId, $number);
20 20
     public function netScoresByPlayerYear($playerId, $year);
21
-    public function netScoresByPlayerTopYear($playerId,$top, $year);
21
+    public function netScoresByPlayerTopYear($playerId, $top, $year);
22 22
 
23 23
     public function netScoresLeague();
24 24
     public function netScoresLeagueTop($number);
25 25
     public function netScoresLeagueYear($year);
26
-    public function netScoresLeagueTopYear($top,$year);
26
+    public function netScoresLeagueTopYear($top, $year);
27 27
 
28 28
     // Cumulative Net returns +/- relative to par
29 29
     public function netCumulative();
30 30
     public function netCumulativeTop($top);
31 31
     public function netCumulativeByPlayer($playerId);
32
-    public function netCumulativeByPlayerTop($playerId,$top);
32
+    public function netCumulativeByPlayerTop($playerId, $top);
33 33
     public function netCumulativeYear($year);
34
-    public function netCumulativeTopYear($top,$year);
35
-    public function netCumulativeByPlayerYear($playerId,$year);
36
-    public function netCumulativeByPlayerTopYear($playerId,$top,$year);
34
+    public function netCumulativeTopYear($top, $year);
35
+    public function netCumulativeByPlayerYear($playerId, $year);
36
+    public function netCumulativeByPlayerTopYear($playerId, $top, $year);
37 37
 
38 38
 }
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
app/models/Course.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -3,21 +3,21 @@
 block discarded – undo
3 3
 class Course extends Eloquent
4 4
 {
5 5
 
6
-    protected $fillable = ['id', 'name', 'rating', 'slope', 'par'];
6
+	protected $fillable = ['id', 'name', 'rating', 'slope', 'par'];
7 7
 
8
-    public function rounds()
9
-    {
10
-        return $this->hasMany('Round');
11
-    }
8
+	public function rounds()
9
+	{
10
+		return $this->hasMany('Round');
11
+	}
12 12
 
13 13
 	public function holes()
14
-    {
15
-        return $this->hasMany('Hole');
16
-    }
14
+	{
15
+		return $this->hasMany('Hole');
16
+	}
17 17
 
18 18
 	public function match()
19
-    {
20
-        return $this->hasMany('Match');
21
-    }
19
+	{
20
+		return $this->hasMany('Match');
21
+	}
22 22
 
23 23
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-class Course extends Eloquent
4
-{
3
+class Course extends Eloquent {
5 4
 
6 5
     protected $fillable = ['id', 'name', 'rating', 'slope', 'par'];
7 6
 
@@ -11,12 +10,12 @@  discard block
 block discarded – undo
11 10
     }
12 11
 
13 12
 	public function holes()
14
-    {
13
+	{
15 14
         return $this->hasMany('Hole');
16 15
     }
17 16
 
18 17
 	public function match()
19
-    {
18
+	{
20 19
         return $this->hasMany('Match');
21 20
     }
22 21
 
Please login to merge, or discard this patch.
app/controllers/EagleController.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -5,34 +5,34 @@
 block discarded – undo
5 5
 
6 6
 class EagleController extends \BaseController {
7 7
 
8
-    public function __construct(LeagueStatistics $leagueStatistics)
9
-    {
10
-        $this->leagueStatistics = $leagueStatistics;
11
-    }
12
-
13
-    /**
14
-     * Display a listing of the resource.
15
-     *
16
-     * @return Response
17
-     */
18
-    public function index()
19
-    {
20
-        //may use for get all
21
-    }
22
-
23
-
24
-    /**
25
-     * Display the specified resource.
26
-     *
27
-     * @param  int  $id
28
-     * @return Response
29
-     */
30
-    public function show($id)
31
-    {
32
-        $results  = $this->leagueStatistics->totalEagles($id);
33
-        $data['data'] = $results;
34
-        return $data;
35
-    }
8
+	public function __construct(LeagueStatistics $leagueStatistics)
9
+	{
10
+		$this->leagueStatistics = $leagueStatistics;
11
+	}
12
+
13
+	/**
14
+	 * Display a listing of the resource.
15
+	 *
16
+	 * @return Response
17
+	 */
18
+	public function index()
19
+	{
20
+		//may use for get all
21
+	}
22
+
23
+
24
+	/**
25
+	 * Display the specified resource.
26
+	 *
27
+	 * @param  int  $id
28
+	 * @return Response
29
+	 */
30
+	public function show($id)
31
+	{
32
+		$results  = $this->leagueStatistics->totalEagles($id);
33
+		$data['data'] = $results;
34
+		return $data;
35
+	}
36 36
 
37 37
 
38 38
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
      */
30 30
     public function show($id)
31 31
     {
32
-        $results  = $this->leagueStatistics->totalEagles($id);
32
+        $results = $this->leagueStatistics->totalEagles($id);
33 33
         $data['data'] = $results;
34 34
         return $data;
35 35
     }
Please login to merge, or discard this patch.