Balloon::flush()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Balloon;
3
4
use Balloon\Manager\FileManager;
5
use Balloon\Proxy\FileReaderProxy;
6
use Balloon\Proxy\IProxy;
7
8
/**
9
 * Class Balloon
10
 * @package Balloon
11
 * @author Raphaël Lefebvre <[email protected]>
12
 * @method FileReaderProxy getFileReader()
13
 */
14
class Balloon extends FileManager implements IProxy
15
{
16
    /**
17
     * @param FileReaderProxy $fileReaderProxy
18
     * @param string $primaryKey
19
     */
20
    public function __construct(FileReaderProxy $fileReaderProxy, $primaryKey = '')
21
    {
22
        parent::__construct($fileReaderProxy, $primaryKey);
23
    }
24
25
    /**
26
     * writes the modification into the file.
27
     *
28
     * @return int
29
     */
30
    public function flush()
31
    {
32
        return $this->getFileReader()->flush();
33
    }
34
35
    /**
36
     * rollbacks the modifications not pushed.
37
     */
38
    public function clear()
39
    {
40
        $this->getFileReader()->clear();
41
    }
42
43
    /**
44
     * invalidates the cache of the file.
45
     *
46
     * @return int
0 ignored issues
show
Documentation introduced by
Should the return type not be integer|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
47
     */
48
    public function invalidate()
49
    {
50
        return $this->getFileReader()->invalidate();
51
    }
52
}
53