Passed
Push — master ( c062f3...83edb5 )
by Aleksandr
02:32
created

SingletonsTrait   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 12
c 0
b 0
f 0
dl 0
loc 55
ccs 0
cts 22
cp 0
rs 10
wmc 11

11 Methods

Rating   Name   Duplication   Size   Complexity  
A makePivotModel() 0 3 1
A makeEavFactory() 0 3 1
A makeFakerGenerator() 0 3 1
A makeValueParser() 0 3 1
A makeDomainModel() 0 3 1
A makeGroupModel() 0 3 1
A makeAttributeSet() 0 3 1
A makeAttributeContainer() 0 3 1
A makeEntityModel() 0 3 1
A makeAttributeSetModel() 0 3 1
A makeAttributeModel() 0 3 1
1
<?php
2
/**
3
 * This file is part of the eav package.
4
 * @author    Aleksandr Drobotik <[email protected]>
5
 * @copyright 2023 Aleksandr Drobotik
6
 * @license   https://opensource.org/license/mit  The MIT License
7
 */
8
declare(strict_types=1);
9
10
namespace Drobotik\Eav\Trait;
11
12
use Drobotik\Eav\AttributeContainer;
13
use Drobotik\Eav\AttributeSet;
14
use Drobotik\Eav\Factory\EavFactory;
15
use Drobotik\Eav\Model\AttributeGroupModel;
16
use Drobotik\Eav\Model\AttributeModel;
17
use Drobotik\Eav\Model\AttributeSetModel;
18
use Drobotik\Eav\Model\DomainModel;
19
use Drobotik\Eav\Model\EntityModel;
20
use Drobotik\Eav\Model\PivotModel;
21
use Drobotik\Eav\Value\ValueParser;
22
use Faker\Factory;
23
use Faker\Generator;
24
25
trait SingletonsTrait
26
{
27
    public function makeAttributeSetModel() : AttributeSetModel
28
    {
29
        return new AttributeSetModel;
30
    }
31
32
    public function makeAttributeContainer() : AttributeContainer
33
    {
34
        return new AttributeContainer;
35
    }
36
37
    public function makeEntityModel() : EntityModel
38
    {
39
        return new EntityModel();
40
    }
41
42
    public function makeAttributeSet() : AttributeSet
43
    {
44
        return new AttributeSet();
45
    }
46
47
    public function makeDomainModel() : DomainModel
48
    {
49
        return new DomainModel();
50
    }
51
52
    public function makeGroupModel() : AttributeGroupModel
53
    {
54
        return new AttributeGroupModel();
55
    }
56
57
    public function makePivotModel() : PivotModel
58
    {
59
        return new PivotModel();
60
    }
61
62
    public function makeAttributeModel() : AttributeModel
63
    {
64
        return new AttributeModel();
65
    }
66
67
    public function makeEavFactory(): EavFactory
68
    {
69
        return new EavFactory();
70
    }
71
72
    public function makeValueParser(): ValueParser
73
    {
74
        return new ValueParser();
75
    }
76
77
    public function makeFakerGenerator(): Generator
78
    {
79
        return Factory::create();
80
    }
81
82
}