for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class CoursesController extends \BaseController {
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.
public function __construct(Course $course)
{
$this->course = $course;
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function index()
$data = $this->course->all();
return $data;
* Store a newly created resource in storage.
public function store()
//
* Display the specified resource.
* @param int $id
public function show($id)
return Course::find($id)->get();
* Show the form for editing the specified resource.
$id
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(...).
$italy
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.
public function edit()
$operation = Input::get('oper');
switch ($operation) {
case "add":
$this->course->name = Input::get('name');
$this->course->par = Input::get('par');
$this->course->rating = Input::get('rating');
$this->course->slope = Input::get('slope');
$this->course->save();
break;
case "edit":
$id = Input::get('id');
$this->course = $this->course->find($id);
case "del":
$this->course = $this->course->destroy($id);
* Update the specified resource in storage.
public function update($id)
* Remove the specified resource from storage.
public function destroy($id)
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.