Completed
Push — master ( a8a226...edd472 )
by Tomas
01:14
created

NotificationHistoryResolver   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

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