Completed
Push — wip-platform ( 03cba6...2999ab )
by
unknown
05:53 queued 02:49
created

Handler   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

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