Completed
Push — master ( 782061...5c46be )
by
unknown
13:53
created

Handler::export()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Blast Project package.
5
 *
6
 * Copyright (C) 2015-2017 Libre Informatique
7
 *
8
 * This file is licenced under the GNU LGPL v3.
9
 * For the full copyright and license information, please view the LICENSE.md
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Blast\CoreBundle\Exporter;
14
15
use Exporter\Source\SourceIteratorInterface;
16
use Exporter\Writer\WriterInterface;
17
use Exporter\Handler as BaseHandler;
18
19
class Handler extends BaseHandler
20
{
21
    public function export()
22
    {
23
        $this->writer->open();
24
25
        foreach ($this->source as $key => $data) {
26
            $this->writer->write($data);
27
        }
28
29
        $this->writer->close();
30
    }
31
32
    /**
33
     * @param SourceIteratorInterface $source
34
     * @param WriterInterface         $writer
35
     *
36
     * @return Handler
37
     */
38
    public static function create(SourceIteratorInterface $source, WriterInterface $writer)
39
    {
40
        return new self($source, $writer);
41
    }
42
}
43