ArrayItemLogger::doRemoveLog()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace TreeHouse\IoBundle\Import\Log;
4
5
use TreeHouse\IoBundle\Entity\Import;
6
7
class ArrayItemLogger extends AbstractItemLogger
8
{
9
    /**
10
     * @var array
11
     */
12
    protected $items = [];
13
14
    /**
15
     * @inheritdoc
16
     */
17
    public function getImportedItems(Import $import)
18
    {
19
        $ident = $this->getLogIdent($import);
20
21
        foreach ($this->items[$ident] as $item) {
22
            yield $item;
23
        }
24
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29 4
    protected function doLog($ident, $originalId, array $context)
30
    {
31 4
        $this->items[$ident][$originalId] = $context;
32 4
    }
33
34
    /**
35
     * @inheritdoc
36
     */
37
    protected function doRemoveLog($ident)
38
    {
39
        unset($this->items[$ident]);
40
    }
41
}
42