mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Phpstan fixes
This commit is contained in:
parent
e97fe9de86
commit
67f172b741
|
|
@ -176,11 +176,10 @@ abstract class BaseAsset extends PropertyObject
|
|||
/**
|
||||
* Receive asset location and return the SRI integrity hash
|
||||
*
|
||||
* @param $input
|
||||
*
|
||||
* @param string $input
|
||||
* @return string
|
||||
*/
|
||||
public static function integrityHash( $input )
|
||||
public static function integrityHash($input)
|
||||
{
|
||||
$grav = Grav::instance();
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,6 @@ class Cache extends Getters
|
|||
*/
|
||||
public function init(Grav $grav)
|
||||
{
|
||||
/** @var Config $config */
|
||||
$this->config = $grav['config'];
|
||||
$this->now = time();
|
||||
|
||||
|
|
|
|||
|
|
@ -524,8 +524,12 @@ class Blueprint extends BlueprintForm
|
|||
* @param string $op
|
||||
* @return bool
|
||||
*/
|
||||
protected function resolveActions(UserInterface $user, array $actions, string $op = 'and')
|
||||
protected function resolveActions(?UserInterface $user, array $actions, string $op = 'and')
|
||||
{
|
||||
if (null === $user) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$c = $i = count($actions);
|
||||
foreach ($actions as $key => $action) {
|
||||
if (!is_int($key) && is_array($actions)) {
|
||||
|
|
|
|||
|
|
@ -128,12 +128,12 @@ class Session extends \Grav\Framework\Session\Session
|
|||
/** @var Uri $uri */
|
||||
$uri = $grav['uri'];
|
||||
/** @var Forms|null $form */
|
||||
$form = $grav['forms']->getActiveForm();
|
||||
$form = $grav['forms']->getActiveForm(); // @phpstan-ignore-line
|
||||
|
||||
$sessionField = base64_encode($uri->url);
|
||||
|
||||
/** @var FormFlash|null $flash */
|
||||
$flash = $form ? $form->getFlash() : null;
|
||||
$flash = $form ? $form->getFlash() : null; // @phpstan-ignore-line
|
||||
$object = $flash && method_exists($flash, 'getLegacyFiles') ? [$sessionField => $flash->getLegacyFiles()] : null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ trait FlexMediaTrait
|
|||
$updated = true;
|
||||
if ($medium) {
|
||||
$media->add($filename, $medium);
|
||||
} else {
|
||||
} elseif (is_callable([$media, 'hide'])) {
|
||||
$media->hide($filename);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,3 +161,8 @@ parameters:
|
|||
- '#Call to deprecated method stopPropagation\(\) of class Symfony\\Component\\EventDispatcher\\Event#'
|
||||
- '#Parameter \#2 \$listener of method Symfony\\Component\\EventDispatcher\\EventDispatcher::addListener\(\)#'
|
||||
- '#Parameter \#2 \$listener of method Symfony\\Component\\EventDispatcher\\EventDispatcher::removeListener\(\)#'
|
||||
|
||||
# Installer updates
|
||||
-
|
||||
message: '#Variable \$this in PHPDoc tag @var does not exist#'
|
||||
path: '*/system/src/Grav/Installer/updates/*'
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user