Completed
Branch develop (598d0f)
by Benjamin
03:23
created

Optionable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A resolveOptions() 0 5 1
A __construct() 0 3 1
1
<?php
2
3
namespace Obblm\Core\Helper;
4
5
use Obblm\Core\Contracts\OptionableInterface;
6
use Symfony\Component\OptionsResolver\OptionsResolver;
7
8
abstract class Optionable implements OptionableInterface
9
{
10
    public function __construct(array $options = [])
11
    {
12
        $this->resolveOptions($options);
13
    }
14
    public function resolveOptions($options)
15
    {
16
        $resolver = new OptionsResolver();
17
        $this->configureOptions($resolver);
18
        $this->options = $resolver->resolve($options);
0 ignored issues
show
Bug Best Practice introduced by
The property options does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
19
    }
20
}
21