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

Optionable::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
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