ApiRole::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace Magefix\Fixture\Builder;
4
5
use \Magefix\Fixture\Builder\Helper\ApiRole as ApiRoleHelper;
6
use Magefix\Fixture\Factory\Builder;
7
8
/**
9
 * Class ApiRole
10
 * @package Magefix\Fixture\Builder
11
 * @author  Carlo Tasca <[email protected]>
12
 */
13
class ApiRole extends AbstractBuilder
14
{
15
    /**
16
     * @return mixed
17
     */
18
    public function build()
19
    {
20
        $this->invokeProvidersMethods();
21
22
        $fixtureId = ApiRoleHelper::create($this->_data['fixture']['attributes']);
23
24
        return $fixtureId;
25
    }
26
27
    /**
28
     * @return mixed
29
     */
30
    public function buildAndRegister()
31
    {
32
        $this->invokeProvidersMethods();
33
34
        $fixtureId = ApiRoleHelper::create($this->_data['fixture']['attributes']);
35
        Builder::registerFixture(Builder::API_ROLE_FIXTURE_TYPE, $fixtureId, $this->_getHook());
36
37
        return $fixtureId;
38
    }
39
40
}
41