MixedType::describe()   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 Doctrine\Annotations\Metadata\Type;
6
7
use function is_array;
8
use function is_object;
9
use function is_scalar;
10
11
final class MixedType implements Type
12
{
13 6
    public function describe() : string
14
    {
15 6
        return 'mixed';
16
    }
17
18
    /**
19
     * @param mixed $value
20
     */
21 13
    public function validate($value) : bool
22
    {
23 13
        return $value === null || is_scalar($value) || is_array($value) || is_object($value);
24
    }
25
26 2
    public function acceptsNull() : bool
27
    {
28 2
        return true;
29
    }
30
}
31