getExceptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Gember\EventSourcing\Util\Serialization\Serializer;
6
7
final class SerializationFailedCollectionException extends SerializationFailedException
8
{
9
    /**
10
     * @var list<SerializationFailedException>
0 ignored issues
show
Bug introduced by
The type Gember\EventSourcing\Uti...ization\Serializer\list was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
     */
12
    private array $exceptions = [];
13
14 3
    public static function withExceptions(string $message, SerializationFailedException ...$exceptions): self
15
    {
16 3
        $exception = new self(sprintf('Serialization failed: %s', $message));
17 3
        $exception->exceptions = array_values($exceptions);
0 ignored issues
show
Documentation Bug introduced by
It seems like array_values($exceptions) of type array is incompatible with the declared type Gember\EventSourcing\Uti...ization\Serializer\list of property $exceptions.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
18
19 3
        return $exception;
20
    }
21
22
    /**
23
     * @return list<SerializationFailedException>
24
     */
25 3
    public function getExceptions(): array
26
    {
27 3
        return $this->exceptions;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->exceptions returns the type array which is incompatible with the documented return type Gember\EventSourcing\Uti...ization\Serializer\list.
Loading history...
28
    }
29
}
30