GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( d88c83...a99e88 )
by Carlos
11:19
created

ImageService   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A base64From() 0 10 2
1
<?php
2
3
namespace juniorb2ss\DeathByCaptcha\Services;
4
5
use Intervention\Image\Exception\ImageException;
6
use Intervention\Image\ImageManagerStatic as Image;
7
use juniorb2ss\DeathByCaptcha\Interfaces\ImageInterface;
8
use juniorb2ss\DeathByCaptcha\Exceptions\InvalidCaptchaException;
9
10
class ImageService implements ImageInterface
11
{
12
    public static function base64From(string $content): string
13
    {
14
        try {
15
            $image = Image::make($content);
16
17
            return (string)$image->encode();
18
        } catch (ImageException $e) {
19
            throw new InvalidCaptchaException;
20
        }
21
    }
22
}
23