ColorBlockSvg::image()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 10
ccs 6
cts 6
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Limsum\ColorBlock;
4
5
use Illuminate\Support\Facades\Response;
6
7
class ColorBlockSvg extends AbstractColorBlockImage
8
{
9 1
    public function image(): \Illuminate\Http\Response
10
    {
11 1
        return Response::make("
12 1
        <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 {$this->with} {$this->height}'>
13 1
          <rect width='{$this->with}' height='{$this->height}'
14 1
            fill='{$this->color}'
15
               />
16
        </svg>
17
       ", 200, [
18 1
           'Content-Type' => 'image/svg+xml',
19
       ]);
20
    }
21
}
22