mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Fixed some phpstan issues
This commit is contained in:
parent
5f0380f547
commit
d25014779d
|
|
@ -487,7 +487,7 @@ abstract class Folder
|
|||
/**
|
||||
* Does a directory contain children
|
||||
*
|
||||
* @param $dir
|
||||
* @param string $directory
|
||||
* @return bool
|
||||
*/
|
||||
public static function hasChildren($directory) {
|
||||
|
|
|
|||
|
|
@ -222,7 +222,6 @@ class PageObject extends FlexPageObject
|
|||
|
||||
/**
|
||||
* @param array $variables
|
||||
* @return array
|
||||
*/
|
||||
protected function onAfterSave(array $variables): void
|
||||
{
|
||||
|
|
|
|||
|
|
@ -281,6 +281,9 @@ class AbstractFile implements FileInterface
|
|||
} else {
|
||||
// Support for symlinks.
|
||||
$realpath = is_link($filepath) ? realpath($filepath) : $filepath;
|
||||
if ($realpath === false) {
|
||||
throw new \RuntimeException('Failed to save file ' . $filepath);
|
||||
}
|
||||
|
||||
// Create file with a temporary name and rename it to make the save action atomic.
|
||||
$tmp = $this->tempname($realpath);
|
||||
|
|
|
|||
|
|
@ -444,7 +444,7 @@ class FlexPageObject extends FlexObject implements PageInterface, MediaManipulat
|
|||
}
|
||||
|
||||
/**
|
||||
* @return UserCollectionInterface|FlexCollectionInterface|null
|
||||
* @return UserCollectionInterface|null
|
||||
* @internal
|
||||
*/
|
||||
protected function loadAccounts()
|
||||
|
|
|
|||
|
|
@ -230,6 +230,6 @@ trait PageAuthorsTrait
|
|||
}
|
||||
|
||||
abstract public function getNestedProperty($property, $default = null, $separator = null);
|
||||
abstract protected function loadAccounts();
|
||||
|
||||
abstract protected function loadAccounts();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ trait PageRoutableTrait
|
|||
|
||||
/** @var string */
|
||||
private $_route;
|
||||
/** @var string */
|
||||
/** @var string|null */
|
||||
private $_path;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ abstract class AbstractFilesystemStorage implements FlexStorageInterface
|
|||
protected $dataFormatter;
|
||||
/** @var string */
|
||||
protected $keyField = 'storage_key';
|
||||
/** @var string */
|
||||
protected $keyLen = '32';
|
||||
/** @var int */
|
||||
protected $keyLen = 32;
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ trait FlexMediaTrait
|
|||
$locator->clearCache($targetFile);
|
||||
}
|
||||
|
||||
$fileParts = $filesystem->pathinfo($basename);
|
||||
$fileParts = (array)$filesystem->pathinfo($basename);
|
||||
|
||||
if (!file_exists($targetPath)) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ class Session implements SessionInterface
|
|||
return $this;
|
||||
}
|
||||
|
||||
// TODO: session_create_id() segfaults in PHP 7.3 (PHP bug #73461)
|
||||
// TODO: session_create_id() segfaults in PHP 7.3 (PHP bug #73461), remove phpstan rule when fixing this one.
|
||||
$newId = 0; // session_create_id();
|
||||
|
||||
// Set destroyed timestamp for the old session as well as pointer to the new id.
|
||||
|
|
|
|||
|
|
@ -25,6 +25,10 @@ parameters:
|
|||
ignoreErrors:
|
||||
|
||||
# FIXME: Bugs that need to be fixed
|
||||
# FIXME: PHP 7.3 bug workaround
|
||||
-
|
||||
message: '#If condition is always false.#'
|
||||
path: 'system/src/Grav/Framework/Session/Session.php'
|
||||
|
||||
# TODO: Errors that needs some more thinking (bad design?)
|
||||
- '#Access to an undefined property RocketTheme\\Toolbox\\Event\\Event::#'
|
||||
|
|
@ -90,8 +94,11 @@ parameters:
|
|||
message: '#unknown class (Memcache|Memcached|Redis|RedisException)#'
|
||||
path: 'system/src/Grav/Common/Cache.php'
|
||||
-
|
||||
message: '#on an unknown class Collator#'
|
||||
message: '#unknown class Collator#'
|
||||
path: 'system/src/Grav/Common/Page/Pages.php'
|
||||
-
|
||||
message: '#unknown class Collator#'
|
||||
path: 'system/src/Grav/Common/Flex/Types/Pages/PageCollection.php'
|
||||
-
|
||||
message: '#Ternary operator condition is always true#'
|
||||
path: 'system/src/Grav/Framework/Cache/AbstractCache.php'
|
||||
|
|
@ -121,6 +128,15 @@ parameters:
|
|||
-
|
||||
message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexObject#'
|
||||
path: 'system/src/Grav/Framework/Flex/FlexObject.php'
|
||||
-
|
||||
message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexIndex#'
|
||||
path: 'system/src/Grav/Framework/Flex/FlexIndex.php'
|
||||
-
|
||||
message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexCollection#'
|
||||
path: 'system/src/Grav/Framework/Flex/FlexCollection.php'
|
||||
-
|
||||
message: '#Call to deprecated method (getAuthorizeScope|getActiveUser)\(\) of class Grav\\Framework\\Flex\\FlexObject#'
|
||||
path: 'system/src/Grav/Framework/Flex/Pages/Traits/PageAuthorsTrait.php'
|
||||
-
|
||||
message: '#deprecated class#'
|
||||
path: 'system/src/Grav/Framework/Uri/Uri.php'
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user