Passed
Push — master ( 37473d...30ff7d )
by Maurício
11:30 queued 14s
created

ColumnFull::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
nc 1
nop 9
dl 0
loc 11
rs 10
c 1
b 0
f 0
ccs 0
cts 1
cp 0
crap 2

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpMyAdmin;
6
7
final class ColumnFull
8
{
9
    public function __construct(
10
        public readonly string $field,
11
        public readonly string $type,
12
        public readonly string|null $collation,
13
        public readonly bool $isNull,
14
        public readonly string $key,
15
        public readonly string|null $default,
16
        public readonly string $extra,
17
        public readonly string $privileges,
18
        public readonly string $comment,
19
    ) {
20
    }
21
}
22