InitialItem::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 *
4
 * This file is part of the Aggrego.
5
 * (c) Tomasz Kunicki <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 */
11
12
namespace Aggrego\FragmentedDataBoardDomain\Board\Shard;
13
14
use Aggrego\Domain\Board\Key;
15
use Aggrego\Domain\Profile\Profile;
16
use Ramsey\Uuid\Uuid as RamseyUuid;
17
18
class InitialItem extends Item
19
{
20
    /** @var Key */
21
    private $key;
22
23
    public function __construct(Profile $profile, Key $key)
24
    {
25
        parent::__construct(
26
            new Uuid(RamseyUuid::uuid4()->toString()),
0 ignored issues
show
Deprecated Code introduced by
The function Ramsey\Uuid\UuidInterface::toString() has been deprecated: In ramsey/uuid 4.0.0, this method will be replaced with the __toString() magic method, which is currently available in the Uuid concrete class. The new recommendation is to cast Uuid objects to string, rather than calling `toString()`. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

26
            new Uuid(/** @scrutinizer ignore-deprecated */ RamseyUuid::uuid4()->toString()),

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
27
            $profile
28
        );
29
        $this->key = $key;
30
    }
31
32
    public function getKey(): Key
33
    {
34
        return $this->key;
35
    }
36
}
37