for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sco\Admin\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Sco\Admin\Contracts\ComponentInterface;
class UploadController extends Controller
{
public function formElement(Request $request, ComponentInterface $component, $field, $id = null)
if (is_null($id)) {
$form = $component->fireCreate();
} else {
$form = $component->fireEdit($id);
}
$element = $form->getElement($field);
getElement()
Sco\Admin\Contracts\Form\FormInterface
getElements()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
$element
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
$myVar = 'Value'; $higher = false; if (rand(1, 6) > 3) { $higher = true; } else { $higher = false; }
Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.
$myVar
$higher
return response()->json(['message' => 'ok', 'id' => time()]);
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.