RequestModelBuilder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 3 1
A registerBuilder() 0 4 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\Ratepay\Business\Api\Model;
9
10
class RequestModelBuilder implements RequestModelBuilderInterface
11
{
12
    /**
13
     * @var \SprykerEco\Zed\Ratepay\Business\Api\Model\RequestInterface[]
14
     */
15
    protected $builders;
16
17
    /**
18
     * @param string $modelType
19
     * @param \SprykerEco\Zed\Ratepay\Business\Api\Model\RequestInterface $builder
20
     *
21
     * @return $this
22
     */
23
    public function registerBuilder($modelType, RequestInterface $builder)
24
    {
25
        $this->builders[$modelType] = $builder;
26
        return $this;
27
    }
28
29
    /**
30
     * @param string $modelType
31
     *
32
     * @return \SprykerEco\Zed\Ratepay\Business\Api\Model\RequestInterface
33
     */
34
    public function build($modelType)
35
    {
36
        return $this->builders[$modelType];
37
    }
38
}
39