Failed Conditions
Pull Request — develop_3.0 (#507)
by Adrien
02:47
created

EntityFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 14
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createReader() 0 4 1
1
<?php
2
3
namespace Box\Spout\Reader\Common\Creator;
4
5
use Box\Spout\Reader\ReaderFactory;
6
use Box\Spout\Reader\ReaderInterface;
7
8
/**
9
 * Class EntityFactory
10
 * Factory to create external entities
11
 */
12
class EntityFactory
13
{
14
    /**
15
     * This creates an instance of the appropriate reader, given the type of the file to be read
16
     *
17
     * @param  string $readerType Type of the reader to instantiate
18
     * @throws \Box\Spout\Common\Exception\UnsupportedTypeException
19
     * @return ReaderInterface
20
     */
21 79
    public static function createReader($readerType)
22
    {
23 79
        return (new ReaderFactory())->create($readerType);
24
    }
25
}
26