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

EntityFactory::createReader()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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