SmallintGuesser   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 2
b 0
f 0
dl 0
loc 17
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A fake() 0 3 1
A getName() 0 3 1
A supports() 0 5 1
1
<?php
2
3
namespace Knp\FriendlyContexts\Guesser;
4
5
class SmallintGuesser extends IntGuesser implements GuesserInterface
6
{
7
    public function supports(array $mapping)
8
    {
9
        $mapping = array_merge([ 'type' => null ], $mapping);
10
11
        return $mapping['type'] === 'smallint';
12
    }
13
14
    public function fake(array $mapping)
15
    {
16
        return current($this->fakers)->fake('numberBetween', [0, 32000]);
17
    }
18
19
    public function getName()
20
    {
21
        return 'smallint';
22
    }
23
}
24