check(); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ // max 50 Mo 'file' => [ 'required', // phpcs:ignore Generic.Files.LineLength.TooLong 'mimetypes:application/vnd.ms-excel,application/vnd.ms-office,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/xml', 'max:51200', // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed function ($attribute, $value, $fail) { if ($this->file->getClientMimeType() !== 'application/vnd.ms-excel') { $fail(__('Le fichier doit ĂȘtre d\'un mime type application/vnd.ms-excel')); } } ] ]; } }