AbstractFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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