ArrayWriter::write()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 9.6666
cc 1
eloc 4
nc 1
nop 2
crap 1
1
<?php
2
3
/*
4
 * This file is part of Payload.
5
 *
6
 * (c) DraperStudio <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace DraperStudio\Payload\Writers;
13
14
use DraperStudio\Payload\Serialisers\ArraySerialiser;
15
16
/**
17
 * Class ArrayWriter.
18
 */
19
class ArrayWriter extends Writer
20
{
21
    /**
22
     * @param $path
23
     * @param $input
24
     *
25
     * @return bool
26
     */
27 3
    public function write($path, $input)
28
    {
29 3
        $contents = (new ArraySerialiser())->serialise($input);
30
31 3
        return $this->put($path, "<?php
32
33
34 3
 return $contents;");
35
    }
36
}
37