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

DevGoogleImageTaggingService::getImageToSend()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
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