FileTempObject   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __destruct() 0 4 2
A fromString() 0 9 1
1
<?php
2
3
namespace Jackal\ImageMerge\Model\File;
4
5
class FileTempObject extends FileObject
6
{
7
    public static function fromString($content)
8
    {
9
        $path = Filename::createTempFilename();
10
11
        $o = new self($path, 'w+');
12
        $o->fwrite($content);
13
        $o->seek(0);
14
15
        return $o;
16
    }
17
18
    public function __destruct()
19
    {
20
        if (is_file($this->getPathname())) {
21
            unlink($this->getPathname());
22
        }
23
    }
24
}
25