Framework: Fix all phpstan level 5 issues

This commit is contained in:
Matias Griese
2019-05-17 15:18:41 +03:00
parent 99d0c7cb3e
commit b795155345
4 changed files with 6 additions and 5 deletions

View File

@@ -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)
{

View File

@@ -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)

View File

@@ -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) {

View File

@@ -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