AbstractFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 19
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
/**
4
 * Abstraction for the factory design pattern.
5
 */
6
7
namespace CryptoManana\Core\Abstractions\DesignPatterns;
8
9
use CryptoManana\Core\Interfaces\DesignPatterns\StaticCallInstancingInterface as StaticCalls;
10
11
/**
12
 * Class AbstractFactory - Abstraction for the factory design pattern.
13
 *
14
 * @package CryptoManana\Core\Abstractions\DesignPatterns
15
 */
16
abstract class AbstractFactory implements StaticCalls
17
{
18
    /**
19
     * Factory constructor.
20
     */
21 20
    public function __construct()
22
    {
23
        // Force instances to follow the same definition
24 20
        return null;
25
    }
26
27
    /**
28
     * Dynamic call method for object instancing.
29
     *
30
     * @param string|int|null $type Object type.
31
     *
32
     * @return object|null Instance of an object.
33
     */
34
    abstract public function create($type);
35
}
36