Passed
Pull Request — master (#17)
by Aleksei
02:31
created

BelongsToMorphed::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 0
c 0
b 0
f 0
dl 0
loc 11
rs 10
cc 1
nc 1
nop 8

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 Cycle\Annotated\Annotation\Relation\Morphed;
6
7
final class BelongsToMorphed
8
{
9
    public function __construct(
10
        string $target,
11
        bool $cascade = true,
12
        bool $nullable = true,
13
        string $innerKey = '{relationName}_{outerKey}',
14
        string $outerKey = null,
15
        string $morphKey = '{relationName}_role',
16
        int $morphKeyLength = 32,
17
        bool $indexCreate = true,
18
        // Inverse $inverse = null, // can be uncommented for compatibility with php 8.1
19
    ) {
20
    }
21
}
22