Completed
Push — master ( 28b764...a7b092 )
by Michaël
02:42
created

ErasingWriter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A write() 0 6 2
1
<?php
2
3
namespace TextFile\Writer;
4
5
/**
6
 * Class ErasingWriter
7
 *
8
 * @package TextFile\Writer
9
 */
10
class ErasingWriter implements WriterInterface
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15 4
    public function write(\SplFileObject $file, $text, $newLineAtEnd = false)
16
    {
17 4
        $file->fwrite($text . ($newLineAtEnd ? PHP_EOL : ''));
18
19 4
        return $file;
20
    }
21
}
22