Test Setup Failed
Push — master ( dcfdf2...6863da )
by guillaume
16:18 queued 10:15
created

InMemoryFileStorage::uriToTmpPicture()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace App\Src\UseCases\Infra\Gateway;
5
6
7
use App\Src\UseCases\Domain\Picture;
8
9
class InMemoryFileStorage implements FileStorage
10
{
11
    private $fs = [];
12
13
    public function setContent(string $path, array $content)
14
    {
15
        $this->fs[$path] = $content;
16
    }
17
18
    public function content(string $path): array
19
    {
20
        return $this->fs[$path];
21
    }
22
23
    public function uriToTmpPicture(string $uri): Picture
24
    {
25
        $path = uniqid();
26
        app(PictureHandler::class)->add($path, 600, 600);
27
        return new Picture($path, $ext = 'jpg');
28
    }
29
30
}
31