HolesController::index()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
class HolesController extends \BaseController {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
5
	public function __construct(Course $course, Hole $hole)
6
    {
7
		$this->course = $course;
8
		$this->hole = $hole;
9
    }
10
	/**
11
	 * Display a listing of the resource.
12
	 *
13
	 * @return Response
14
	 */
15
	public function index()
16
	{
17
		$data = $this->hole->all();
18
        return $data;
19
	}
20
21
	/**
22
	 * Show the form for creating a new resource.
23
	 *
24
	 * @return Response
25
	 */
26
	public function create()
27
	{
28
		//
29
	}
30
31
	/**
32
	 * Store a newly created resource in storage.
33
	 *
34
	 * @return Response
35
	 */
36
	public function store()
37
	{
38
		//
39
	}
40
41
	/**
42
	 * Display the specified resource.
43
	 *
44
	 * @param  int  $course_id
0 ignored issues
show
Bug introduced by
There is no parameter named $course_id. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
45
	 * @return Response
46
	 */
47
	public function show()
48
	{
49
		$course_id = Input::get('course_id');
50
		$holes = Hole::where('course_id', '=', $course_id)->get();
51
		return $holes;
52
	}
53
54
	/**
55
	 * Show the form for editing the specified resource.
56
	 *
57
	 * @param  int  $id
58
	 * @return Response
59
	 */
60
	public function edit($id)
61
	{
62
		//
63
	}
64
65
	/**
66
	 * Update the specified resource in storage.
67
	 *
68
	 * @param  int  $id
69
	 * @return Response
70
	 */
71
	public function update($id)
72
	{
73
		//
74
	}
75
76
	/**
77
	 * Remove the specified resource from storage.
78
	 *
79
	 * @param  int  $id
80
	 * @return Response
81
	 */
82
	public function destroy($id)
83
	{
84
		//
85
	}
86
87
}