IntMapping   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toAttribute() 0 4 1
A toArray() 0 4 1
1
<?php
2
namespace Vsmoraes\DynamoMapper\Mappings;
3
4
class IntMapping implements Mapping
5
{
6
    /**
7
     * {@inheritdoc}
8
     */
9
    public function toAttribute(array $data)
10
    {
11
        return (int) $data['N'];
12
    }
13
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function toArray($value): array
18
    {
19
        return ['N' => $value];
20
    }
21
}
22