phpcs fixes

This commit is contained in:
Jérémy Munsch 2024-01-19 15:53:22 +01:00
parent 490ba20fe3
commit 3bf8f4368d
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
4 changed files with 7 additions and 5 deletions

View file

@ -40,8 +40,9 @@ class StoreFontRequest extends FormRequest
{
return [
'font_name' => [
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
'present', 'required_without:font', 'nullable', function (string $attribute, $value, callable $fail) {
'present', 'required_without:font', 'nullable',
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed
function (string $attribute, $value, callable $fail) {
$font = $this->input('font');
if (is_null($font) and !in_array($value, Font::DEFAULT_FONTS)) {
$fail(trans('validation.in_array', [

View file

@ -134,7 +134,8 @@ class ShowroomExport implements ShouldQueue, ShouldBeUnique
}
foreach ($filesToZip as $file) {
$fileToAdd = Str::of($file)->replace($this->tempFolder, '')->start('/')->explode('/')->filter()->implode('/');
$fileToAdd = Str::of($file)->replace($this->tempFolder, '')
->start('/')->explode('/')->filter()->implode('/');
if (!$zip->addFile($file, $fileToAdd)) {
throw new \RuntimeException("Failed to add file {$file} into zip");
}

View file

@ -103,8 +103,8 @@ class ActivityLog extends Model
$activity->model_id
)->first();
if ($targetModel != null) {
// phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
$targetModelTypes = collect($targetModel->toArray())
// phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed
->map(function ($field, $fieldIndex) use ($targetModel) {
return Schema::getColumnType($targetModel->getTable(), $fieldIndex);
})->toArray();

View file

@ -36,7 +36,7 @@ class UserFactory extends Factory
*/
public function unverified(): static
{
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);