for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Services\Validation;
use App\Http\Controllers\DegreeController;
class DegreeValidator
{
/*
* Requires error message implementation and proper namespace usage.
*/
public function validate(Request $request, Applicant $applicant)
$applicant
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function validate(Request $request, /** @scrutinizer ignore-unused */ Applicant $applicant)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
App\Services\Validation\Request
Request
\
$request->validate([
'degrees[:template][:id][area_of_study]' => [
'required',
],
'degrees[:template][:id][institution]' => [
'nullable', // Institution is nullable because applicant might have acquired the skills/knowledge on their own or some other way.
'max:255'
]
]);
If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:
someFunctionCall( $firstArgument, $secondArgument, $thirdArgument ); // Closing parenthesis on a new line.
}