StringTokeniser   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 16
wmc 1
lcom 0
cbo 1
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
1
<?php
2
/**
3
 * This file is part of graze/csv-token
4
 *
5
 * Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license https://github.com/graze/csv-token/blob/master/LICENSE.md
11
 * @link    https://github.com/graze/csv-token
12
 */
13
14
namespace Graze\CsvToken\Tokeniser;
15
16
use Graze\CsvToken\Csv\CsvConfigurationInterface;
17
use GuzzleHttp\Psr7\Stream;
18
19
class StringTokeniser extends StreamTokeniser
20
{
21
    /**
22
     * StringTokeniser constructor.
23
     *
24
     * @param CsvConfigurationInterface $config
25
     * @param string                    $csv
26
     */
27 14
    public function __construct(CsvConfigurationInterface $config, $csv)
28
    {
29 14
        $stream = fopen('php://memory', 'r+');
30 14
        fwrite($stream, $csv);
31 14
        rewind($stream);
32 14
        parent::__construct($config, $stream);
33 14
    }
34
}
35