for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Cortex\Auth\Http\Requests\Adminarea;
use Illuminate\Foundation\Http\FormRequest;
use Cortex\Foundation\Exceptions\GenericException;
class TwoFactorPhoneSettingsRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @throws \Cortex\Foundation\Exceptions\GenericException
* @return bool
*/
public function authorize(): bool
$user = $this->user($this->get('guard'));
if (! $user->phone || ! $user->phone_verified) {
throw new GenericException(trans('cortex/auth::messages.account.'.(! $user->phone ? 'phone_field_required' : 'phone_verification_required')), route('adminarea.account.settings'));
route('adminarea.account.settings')
string
array|null
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.
}
return true;
* Get the validation rules that apply to the request.
* @return array
public function rules(): array
return [];
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: