mirror of
https://github.com/getgrav/grav.git
synced 2026-02-04 22:00:13 +01:00
Framework: Fix all phpstan level 5 issues
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
namespace Grav\Framework\Flex;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
use Grav\Common\Debugger;
|
||||
use Grav\Common\Grav;
|
||||
@@ -125,7 +126,7 @@ class FlexCollection extends ObjectCollection implements FlexCollectionInterface
|
||||
|
||||
/**
|
||||
* @param array $filters
|
||||
* @return FlexCollectionInterface
|
||||
* @return FlexCollectionInterface|Collection
|
||||
*/
|
||||
public function filterBy(array $filters)
|
||||
{
|
||||
|
||||
@@ -82,7 +82,7 @@ class FlexForm implements FlexFormInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Data|FlexObjectInterface
|
||||
* @return Data|FlexObjectInterface|object
|
||||
*/
|
||||
public function getData()
|
||||
{
|
||||
@@ -103,7 +103,7 @@ class FlexForm implements FlexFormInterface
|
||||
$value = $this->data ? $this->data[$name] : null;
|
||||
|
||||
// Return the form data or fall back to the object property.
|
||||
return $value ?? $this->getObject()->value($name);
|
||||
return $value ?? $this->getObject()->getFormValue($name);
|
||||
}
|
||||
|
||||
public function getDefaultValue(string $name)
|
||||
|
||||
@@ -736,7 +736,7 @@ class FlexObject implements FlexObjectInterface, FlexAuthorizeInterface
|
||||
}
|
||||
|
||||
$grav = Grav::instance();
|
||||
/** @var Flex $flex */
|
||||
/** @var Flex|null $flex */
|
||||
$flex = $grav['flex_objects'] ?? null;
|
||||
$directory = $flex ? $flex->getDirectory($type) : null;
|
||||
if (!$directory) {
|
||||
|
||||
@@ -29,7 +29,7 @@ interface RenderInterface
|
||||
* @example {% render object layout 'custom' with { variable: 'value' } %}
|
||||
*
|
||||
* @param string|null $layout Layout to be used.
|
||||
* @param array|null $context Extra context given to the renderer.
|
||||
* @param array $context Extra context given to the renderer.
|
||||
*
|
||||
* @return ContentBlockInterface|HtmlBlock Returns `HtmlBlock` containing the rendered output.
|
||||
* @api
|
||||
|
||||
Reference in New Issue
Block a user