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

FluidSaveTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A save() 0 10 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