Passed
Pull Request — 0.9.x (#308)
by Shinji
02:20
created

CollectedMemories::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

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

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 reliforp/reli-prof 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 Reli\Lib\PhpProcessReader\PhpMemoryReader;
15
16
use Reli\Lib\PhpProcessReader\PhpMemoryReader\MemoryLocation\MemoryLocations;
17
use Reli\Lib\PhpProcessReader\PhpMemoryReader\ReferenceContext\TopReferenceContext;
18
19
class CollectedMemories
20
{
21
    public function __construct(
22
        public MemoryLocations $chunk_memory_locations,
23
        public MemoryLocations $huge_memory_locations,
24
        public MemoryLocations $vm_stack_memory_locations,
25
        public MemoryLocations $compiler_arena_memory_locations,
26
        public int $cached_chunks_size,
27
        public MemoryLocations $memory_locations,
28
        public TopReferenceContext $top_reference_context,
29
        public int $memory_get_usage_size,
30
        public int $memory_get_usage_real_size,
31
    ) {
32
    }
33
}
34