Phpstan fixes

This commit is contained in:
Matias Griese
2022-02-19 13:47:29 +02:00
parent 93bb929b38
commit 12c8cf9c40
3 changed files with 9 additions and 2 deletions

View File

@@ -39,6 +39,7 @@ class FlexPageObject extends FlexObject implements PageInterface, FlexTranslateI
use PageAuthorsTrait;
use PageContentTrait;
use PageFormTrait;
/** @phpstan-use PageLegacyTrait<FlexPageObject,FlexPageCollection> */
use PageLegacyTrait;
use PageRoutableTrait;
use PageTranslateTrait;

View File

@@ -37,6 +37,9 @@ use function strlen;
/**
* Implements PageLegacyInterface
*
* @template T of FlexPageObject
* @template C of FlexPageCollection
*/
trait PageLegacyTrait
{
@@ -862,6 +865,7 @@ trait PageLegacyTrait
* Returns children of this page.
*
* @return PageCollectionInterface|FlexIndexInterface
* @phpstan-return FlexPageIndex<T,C>
*/
public function children()
{
@@ -1040,6 +1044,7 @@ trait PageLegacyTrait
* @param string|array $params
* @param bool $pagination
* @return PageCollectionInterface|Collection
* @phpstan-return PageCollectionInterface<T,C>|Collection
* @throws InvalidArgumentException
*/
public function collection($params = 'content', $pagination = true)
@@ -1069,6 +1074,7 @@ trait PageLegacyTrait
* @param string|array $value
* @param bool $only_published
* @return PageCollectionInterface|Collection
* @phpstan-return PageCollectionInterface<T,C>|Collection
*/
public function evaluate($value, $only_published = true)
{

View File

@@ -21,8 +21,8 @@ use function is_object;
* ObjectCollection Trait
* @package Grav\Framework\Object
*
* @template TKey as array-key
* @template T as ObjectInterface
* @template TKey of array-key
* @template T of ObjectInterface
*/
trait ObjectCollectionTrait
{