Passed
Push — master ( 60319d...b48e8d )
by Daniele
08:21
created

FluidSaveTrait::save()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 2
eloc 5
nc 2
nop 2
1
<?php
2
3
namespace FluidXml;
4
5
trait FluidSaveTrait
6
{
7
        public function save($file, $strip = false)
8
        {
9
                $status = \file_put_contents($file, $this->xml($strip));
10
11
                if (! $status) {
12
                        throw new \Exception("The file '$file' is not writable.");
13
                }
14
15
                return $this;
16
        }
17
}
18