for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PerfectOblivion\Valid\Sanitizer\Laravel;
use Illuminate\Foundation\Http\FormRequest as LaravelFormRequest;
/**
* File copied from Waavi/Sanitizer https://github.com/waavi/sanitizer
* Sanitization functionality to be customized within this project before a 1.0 release.
*/
class FormRequest extends LaravelFormRequest
{
* Sanitize input before validating.
public function validate()
$this->sanitize();
parent::validate();
validate()
Illuminate\Foundation\Http\FormRequest
validated()
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.
}
* Sanitize this request's input
public function sanitize()
$this->sanitizer = \Sanitizer::make($this->input(), $this->filters());
sanitizer
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
$this->replace($this->sanitizer->sanitize());
* Filters to be applied to the input.
*
* @return array
public function filters()
return [];
* Validation rules to be applied to the input.
public function rules()
* Determine if the user is authorized to make this request.
* @return bool
public function authorize()
return true;
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.