Completed
Push — master ( 5ac91e...39483e )
by Kirill
38:30
created

BooleanType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 23
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isCompatible() 0 4 1
1
<?php
2
/**
3
 * This file is part of Railt package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Railt\SDL\Standard\Scalars;
11
12
/**
13
 * The Boolean standard scalar implementation.
14
 *
15
 * @see http://facebook.github.io/graphql/#sec-Boolean
16
 */
17
final class BooleanType extends StringType
18
{
19
    /**
20
     * The Boolean scalar public name constant.
21
     * This name will be used in the future as the
22
     * type name available for use in our schema.
23
     */
24
    protected const SCALAR_TYPE_NAME = 'Boolean';
25
26
    /**
27
     * Short Boolean scalar public description.
28
     */
29
    protected const TYPE_DESCRIPTION = 'The `Boolean` scalar type represents `true` or `false`.';
30
31
    /**
32
     * @param mixed|bool $value
33
     * @return bool
34
     */
35 168
    public function isCompatible($value): bool
36
    {
37 168
        return \is_bool($value);
38
    }
39
}
40