FloatValue::inPropertyWithDifferentKey()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 5
rs 10
c 1
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Stratadox\Hydration\Mapping\Simple\Type;
5
6
use Stratadox\Hydration\Mapping\Composite\ConditionalMapping;
7
use Stratadox\Hydration\Mapping\Transform\KeyTransform;
8
use Stratadox\Hydration\Mapping\Primitive\FloatCheck;
9
use Stratadox\Hydration\Mapping\Primitive\FloatMapping;
10
use Stratadox\Hydration\Mapping\Simple\Keyed;
0 ignored issues
show
Bug introduced by
The type Stratadox\Hydration\Mapping\Simple\Keyed 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
use Stratadox\HydrationMapping\KeyedMapping;
12
use Stratadox\HydrationMapping\Mapping;
13
14
final class FloatValue
15
{
16
    public static function inProperty(string $name): Mapping
17
    {
18
        return ConditionalMapping::ensureThat(
19
            FloatCheck::passes(),
20
            FloatMapping::inProperty($name)
21
        );
22
    }
23
24
    public static function inPropertyWithDifferentKey(
25
        string $name,
26
        string $key
27
    ): Mapping {
28
        return KeyTransform::use($key, self::inProperty($name));
29
    }
30
}
31