doctrine / orm

@@ -48,8 +48,8 @@
Loading
48 48
    }
49 49
50 50
    /**
51 -
     * @param object                         $object
52 -
     * @param int|string|int[]|string[]|null $value
51 +
     * @param object                                                 $object
52 +
     * @param int|string|int[]|string[]|BackedEnum|BackedEnum[]|null $value
53 53
     */
54 54
    public function setValue(mixed $object, mixed $value = null): void
55 55
    {
@@ -66,8 +66,12 @@
Loading
66 66
        $this->originalReflectionProperty->setValue($object, $value);
67 67
    }
68 68
69 -
    private function initializeEnumValue(object $object, int|string $value): BackedEnum
69 +
    private function initializeEnumValue(object $object, int|string|BackedEnum $value): BackedEnum
70 70
    {
71 +
        if ($value instanceof BackedEnum) {
72 +
            return $value;
73 +
        }
74 +
71 75
        $enumType = $this->enumType;
72 76
73 77
        try {

@@ -317,14 +317,14 @@
Loading
317 317
                        break;
318 318
                    }
319 319
320 -
                    if ($value !== null && isset($cacheKeyInfo['enumType'])) {
321 -
                        $value = $this->buildEnum($value, $cacheKeyInfo['enumType']);
322 -
                    }
323 -
324 320
                    $rowData['data'][$dqlAlias][$fieldName] = $type
325 321
                        ? $type->convertToPHPValue($value, $this->_platform)
326 322
                        : $value;
327 323
324 +
                    if ($rowData['data'][$dqlAlias][$fieldName] !== null && isset($cacheKeyInfo['enumType'])) {
325 +
                        $rowData['data'][$dqlAlias][$fieldName] = $this->buildEnum($rowData['data'][$dqlAlias][$fieldName], $cacheKeyInfo['enumType']);
326 +
                    }
327 +
328 328
                    if ($cacheKeyInfo['isIdentifier'] && $value !== null) {
329 329
                        $id[$dqlAlias]                .= '|' . $value;
330 330
                        $nonemptyComponents[$dqlAlias] = true;

@@ -72,12 +72,11 @@
Loading
72 72
    }
73 73
74 74
    /**
75 -
     * Do an optimized search of an element
75 +
     * {@inheritDoc}
76 76
     *
77 -
     * @param object $element
78 -
     * @psalm-param TValue $element
77 +
     * Do an optimized search of an element
79 78
     *
80 -
     * @return bool
79 +
     * @template TMaybeContained
81 80
     */
82 81
    public function contains($element)
83 82
    {

@@ -23,7 +23,7 @@
Loading
23 23
    /**
24 24
     * Converts a comparison expression into the target query language output.
25 25
     *
26 -
     * @return void
26 +
     * {@inheritDoc}
27 27
     */
28 28
    public function walkComparison(Comparison $comparison)
29 29
    {
@@ -32,35 +32,39 @@
Loading
32 32
        $operator = $comparison->getOperator();
33 33
34 34
        if (($operator === Comparison::EQ || $operator === Comparison::IS) && $value === null) {
35 -
            return;
35 +
            return null;
36 36
        } elseif ($operator === Comparison::NEQ && $value === null) {
37 -
            return;
37 +
            return null;
38 38
        }
39 39
40 40
        $this->values[] = $value;
41 41
        $this->types[]  = [$field, $value, $operator];
42 +
43 +
        return null;
42 44
    }
43 45
44 46
    /**
45 47
     * Converts a composite expression into the target query language output.
46 48
     *
47 -
     * @return void
49 +
     * {@inheritDoc}
48 50
     */
49 51
    public function walkCompositeExpression(CompositeExpression $expr)
50 52
    {
51 53
        foreach ($expr->getExpressionList() as $child) {
52 54
            $this->dispatch($child);
53 55
        }
56 +
57 +
        return null;
54 58
    }
55 59
56 60
    /**
57 61
     * Converts a value expression into the target query language part.
58 62
     *
59 -
     * @return void
63 +
     * {@inheritDoc}
60 64
     */
61 65
    public function walkValue(Value $value)
62 66
    {
63 -
        return;
67 +
        return null;
64 68
    }
65 69
66 70
    /**

@@ -391,6 +391,8 @@
Loading
391 391
392 392
    /**
393 393
     * {@inheritdoc}
394 +
     *
395 +
     * @template TMaybeContained
394 396
     */
395 397
    public function contains($element): bool
396 398
    {
Files Coverage
lib/Doctrine/ORM 89.69%
Project Totals (332 files) 89.69%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading