forked from wallabag/wallabag
Move to PHPStan level 4
This commit is contained in:
@ -143,11 +143,8 @@ class ContentProxy
|
||||
}
|
||||
|
||||
try {
|
||||
// is it already a DateTime?
|
||||
// (it's inside the try/catch in case of fail to be parse time string)
|
||||
if (!$date instanceof \DateTime) {
|
||||
$date = new \DateTime($date);
|
||||
}
|
||||
$date = new \DateTime($date);
|
||||
|
||||
$entry->setPublishedAt($date);
|
||||
} catch (\Exception $e) {
|
||||
|
||||
@ -98,10 +98,10 @@ class DownloadImages
|
||||
* - re-saved it (for security reason)
|
||||
* - return the new local path.
|
||||
*
|
||||
* @param int $entryId ID of the entry
|
||||
* @param string $imagePath Path to the image to retrieve
|
||||
* @param string $url Url from where the image were found
|
||||
* @param string $relativePath Relative local path to saved the image
|
||||
* @param int $entryId ID of the entry
|
||||
* @param string|null $imagePath Path to the image to retrieve
|
||||
* @param string $url Url from where the image were found
|
||||
* @param string $relativePath Relative local path to saved the image
|
||||
*
|
||||
* @return string|false Relative url to access the image from the web
|
||||
*/
|
||||
@ -136,7 +136,7 @@ class DownloadImages
|
||||
}
|
||||
|
||||
$ext = $this->getExtensionFromResponse($res, $imagePath);
|
||||
if (false === $res) {
|
||||
if (false === $ext) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -20,8 +20,8 @@ class Redirect
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url URL to redirect
|
||||
* @param bool $ignoreActionMarkAsRead Ignore configured action when mark as read
|
||||
* @param string|null $url URL to redirect
|
||||
* @param bool $ignoreActionMarkAsRead Ignore configured action when mark as read
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
||||
@ -129,7 +129,8 @@ class RuleBasedTagger
|
||||
private function fixEntry(Entry $entry)
|
||||
{
|
||||
$clonedEntry = clone $entry;
|
||||
$clonedEntry->setReadingTime($entry->getReadingTime() / $entry->getUser()->getConfig()->getReadingSpeed() * 200);
|
||||
$newReadingTime = (int) ($entry->getReadingTime() / $entry->getUser()->getConfig()->getReadingSpeed() * 200);
|
||||
$clonedEntry->setReadingTime($newReadingTime);
|
||||
|
||||
return $clonedEntry;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user