Opline::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

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

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
/**
4
 * This file is part of the sj-i/php-profiler package.
5
 *
6
 * (c) sji <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace PhpProfiler\Lib\PhpInternals\Types\Zend;
15
16
use PhpProfiler\Lib\PhpInternals\Opcodes\Opcode;
17
18
/** @psalm-immutable */
19
final class Opline
20
{
21
    public function __construct(
22
        public int $op1,
23
        public int $op2,
24
        public int $result,
25
        public int $extended_value,
26
        public int $lineno,
27
        public Opcode $opcode,
28
        public int $op1_type,
29
        public int $op2_type,
30
        public int $result_type,
31
    ) {
32
    }
33
}
34