maj
This commit is contained in:
@@ -35,7 +35,7 @@ use function in_array;
|
||||
* @package Grav\Framework\Flex
|
||||
* @template T of FlexObjectInterface
|
||||
* @template C of FlexCollectionInterface
|
||||
* @extends ObjectIndex<string,T>
|
||||
* @extends ObjectIndex<string,T,C>
|
||||
* @implements FlexIndexInterface<T>
|
||||
* @mixin C
|
||||
*/
|
||||
@@ -540,6 +540,7 @@ class FlexIndex extends ObjectIndex implements FlexCollectionInterface, FlexInde
|
||||
*/
|
||||
protected function createFrom(array $entries, string $keyField = null)
|
||||
{
|
||||
/** @phpstan-var static<T,C> $index */
|
||||
$index = new static($entries, $this->getFlexDirectory());
|
||||
$index->setKeyField($keyField ?? $this->_keyField);
|
||||
|
||||
@@ -630,7 +631,10 @@ class FlexIndex extends ObjectIndex implements FlexCollectionInterface, FlexInde
|
||||
*/
|
||||
protected function loadCollection(array $entries = null): CollectionInterface
|
||||
{
|
||||
return $this->getFlexDirectory()->loadCollection($entries ?? $this->getEntries(), $this->_keyField);
|
||||
/** @var C $collection */
|
||||
$collection = $this->getFlexDirectory()->loadCollection($entries ?? $this->getEntries(), $this->_keyField);
|
||||
|
||||
return $collection;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user