Fix lint
continuous-integration/drone/push Build is passing Details

pull/14/head
Clément FRÉVILLE 5 months ago
parent b0f09a8217
commit a73dac370c

@ -19,6 +19,9 @@ readonly class SightEngineImageSafetyService implements ImageSafetyServiceInterf
public function isValid(File $file): bool public function isValid(File $file): bool
{ {
$handle = fopen($file->getRealPath(), 'r'); $handle = fopen($file->getRealPath(), 'r');
if ($handle === false) {
return false;
}
$response = $this->client->request('POST', 'https://api.sightengine.com/1.0/check.json', [ $response = $this->client->request('POST', 'https://api.sightengine.com/1.0/check.json', [
'body' => [ 'body' => [
'media' => $handle, 'media' => $handle,

@ -12,10 +12,13 @@ class ImageSafetyValidator extends ConstraintValidator
{ {
} }
public function validate($value, Constraint $constraint): void /**
* @param mixed $value
* @param ImageSafety $constraint
* @return void
*/
public function validate(mixed $value, Constraint $constraint): void
{ {
/* @var ImageSafety $constraint */
if (null === $value || '' === $value) { if (null === $value || '' === $value) {
return; return;
} }

Loading…
Cancel
Save