Completed
Pull Request — master (#51)
by Matt
05:11
created

DevGoogleImageTaggingService   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getImageToSend() 0 3 1
1
<?php
2
3
namespace App\Service;
4
5
use App\Entity\Image;
6
7
class DevGoogleImageTaggingService extends GoogleImageTaggingService implements ImageTaggingServiceInterface
8
{
9
    /**
10
     * Unlike production, our dev service grabs the actual image data from
11
     * our local URL and throws it at Google directly, because its URLs
12
     * aren't public.
13
     *
14
     * @return mixed|string
15
     */
16
    protected function getImageToSend(Image $image)
17
    {
18
        return fopen($image->getMediumImageUri(), 'r');
0 ignored issues
show
Bug introduced by
It seems like $image->getMediumImageUri() can also be of type null; however, parameter $filename of fopen() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

18
        return fopen(/** @scrutinizer ignore-type */ $image->getMediumImageUri(), 'r');
Loading history...
19
    }
20
}
21