use Graby\Graby;
use Psr\Log\LoggerInterface;
-use Wallabag\CoreBundle\Entity\Entry;
-use Wallabag\CoreBundle\Tools\Utils;
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeExtensionGuesser;
use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint;
use Symfony\Component\Validator\Constraints\Url as UrlConstraint;
use Symfony\Component\Validator\Validator\ValidatorInterface;
+use Wallabag\CoreBundle\Entity\Entry;
+use Wallabag\CoreBundle\Tools\Utils;
/**
* This kind of proxy class take care of getting the content from an url
// is it a timestamp?
if (filter_var($date, FILTER_VALIDATE_INT) !== false) {
- $date = '@'.$content['date'];
+ $date = '@' . $content['date'];
}
try {
$this->validateAndSetLanguage(
$entry,
- isset($content['language']) ? $content['language'] : ''
+ isset($content['language']) ? $content['language'] : null
);
$this->validateAndSetPreviewPicture(
$entry,
- isset($content['open_graph']['og_image']) ? $content['open_graph']['og_image'] : ''
+ isset($content['open_graph']['og_image']) ? $content['open_graph']['og_image'] : null
);
// if content is an image, define it as a preview too
return;
}
- $this->logger->warning('Language validation failed. '.(string) $errors);
+ $this->logger->warning('Language validation failed. ' . (string) $errors);
}
/**
return;
}
- $this->logger->warning('PreviewPicture validation failed. '.(string) $errors);
+ $this->logger->warning('PreviewPicture validation failed. ' . (string) $errors);
}
}