for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace WITR\Http\Controllers\Admin;
use WITR\Http\Requests;
use WITR\Http\Controllers\Controller;
use WITR\SystemSetting;
use Illuminate\Http\Request;
class SystemSettingController extends Controller {
public function __construct()
{
$this->middleware('auth');
$this->middleware('admin');
}
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
$settings = SystemSetting::all();
return view('admin.settings.index')
->withSettings($settings);
* Update the specified resource in storage.
* @param int $id
$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 update(Request $request)
$input = $request->all();
foreach ($settings as $setting) {
$value = $input['value_' . $setting->id];
$setting->value = $value;
$enabled_id = 'enabled_' . $setting->id;
if (array_key_exists($enabled_id, $input)) {
$setting->enabled = $input[$enabled_id];
} else {
$setting->enabled = 1;
$setting->save();
return redirect()->route('admin.settings')
->with('success', 'Settings Saved!');
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 methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.