Skip to content

Commit

Permalink
Fixed hypothetical type error
Browse files Browse the repository at this point in the history
  • Loading branch information
Geolim4 committed Jan 11, 2024
1 parent 06de8d6 commit 10bae31
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions lib/Phpfastcache/Extensions/Drivers/Ravendb/RavenProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,21 @@ public function fromCacheItem(ExtendedCacheItemInterface $item): void
}

/**
* @return array<string, mixed>
* @return null|array<string, mixed>
*/
public function toDriverArray(): array
{
return [
ExtendedCacheItemPoolInterface::DRIVER_KEY_WRAPPER_INDEX => $this->key,
ExtendedCacheItemPoolInterface::DRIVER_DATA_WRAPPER_INDEX => ($this->serializeData ? unserialize($this->data) : $this->data),
ExtendedCacheItemPoolInterface::DRIVER_EDATE_WRAPPER_INDEX => $this->expirationDate,
ExtendedCacheItemPoolInterface::DRIVER_CDATE_WRAPPER_INDEX => $this->creationDate,
ExtendedCacheItemPoolInterface::DRIVER_MDATE_WRAPPER_INDEX => $this->modificationDate,
TaggableCacheItemPoolInterface::DRIVER_TAGS_WRAPPER_INDEX => $this->tags,
];
public function toDriverArray(): ?array
{
if ($this->key) {
return [
ExtendedCacheItemPoolInterface::DRIVER_KEY_WRAPPER_INDEX => $this->key,
ExtendedCacheItemPoolInterface::DRIVER_DATA_WRAPPER_INDEX => ($this->serializeData ? unserialize($this->data) : $this->data),
ExtendedCacheItemPoolInterface::DRIVER_EDATE_WRAPPER_INDEX => $this->expirationDate,
ExtendedCacheItemPoolInterface::DRIVER_CDATE_WRAPPER_INDEX => $this->creationDate,
ExtendedCacheItemPoolInterface::DRIVER_MDATE_WRAPPER_INDEX => $this->modificationDate,
TaggableCacheItemPoolInterface::DRIVER_TAGS_WRAPPER_INDEX => $this->tags,
];
}
return null;
}

public function setSerializeData(bool $serializeData): void
Expand Down

0 comments on commit 10bae31

Please sign in to comment.