Completed
Branch dev (20d83f)
by Arina
01:20
created

Builder   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
build() 0 1 ?
1
<?php
2
3
namespace ArinaSystems\JsonResponse\Builders;
4
5
use Illuminate\Container\Container;
6
use ArinaSystems\JsonResponse\Option;
7
use ArinaSystems\JsonResponse\Attribute;
8
9
abstract class Builder
10
{
11
    /**
12
     * @var \Illuminate\Http\Request
13
     */
14
    protected $request;
15
16
    /**
17
     * @var \ArinaSystems\JsonResponse\Option
18
     */
19
    protected $options;
20
21
    /**
22
     * @var \ArinaSystems\JsonResponse\Attribute
23
     */
24
    protected $attributes;
25
26
    /**
27
     * Create a new instance.
28
     *
29
     * @param \ArinaSystems\JsonResponse\Option    $options
30
     * @param \ArinaSystems\JsonResponse\Attribute $attributes
31
     */
32
    public function __construct(Option $options, Attribute $attributes)
33
    {
34
        $this->options = $options;
35
        $this->attributes = $attributes;
36
        $this->request = Container::getInstance()->make('request');
37
    }
38
39
    /**
40
     * Build a value of the attribute.
41
     *
42
     * @return mixed
43
     */
44
    abstract public function build($value);
45
}
46