Completed
Pull Request — master (#74)
by
unknown
04:19
created

DeviceFocusResolver   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 9 1
1
<?php
2
3
namespace OneSignal\Resolver;
4
5
6
use Symfony\Component\OptionsResolver\OptionsResolver;
7
8
class DeviceFocusResolver implements ResolverInterface
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function resolve(array $data)
14
    {
15
        return (new OptionsResolver())
16
            ->setDefault('state', 'ping')
17
            ->setAllowedTypes('state', 'string')
18
            ->setRequired('active_time')
19
            ->setAllowedTypes('active_time', 'int')
20
            ->resolve($data);
21
    }
22
}
23