File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 1616
1717use phpFastCache \Cache \ExtendedCacheItemInterface ;
1818use phpFastCache \CacheManager ;
19+ use phpFastCache \Exceptions \phpFastCacheCoreException ;
1920use Psr \Cache \CacheItemInterface ;
2021
2122/**
@@ -40,6 +41,7 @@ trait StandardPsr6StructureTrait
4041 * @param string $key
4142 * @return \phpFastCache\Cache\ExtendedCacheItemInterface
4243 * @throws \InvalidArgumentException
44+ * @throws phpFastCacheCoreException
4345 */
4446 public function getItem ($ key )
4547 {
@@ -55,6 +57,9 @@ public function getItem($key)
5557 $ driverArray = $ this ->driverRead ($ item );
5658
5759 if ($ driverArray ) {
60+ if (!is_array ($ driverArray )){
61+ throw new phpFastCacheCoreException (sprintf ('The driverRead method returned an unexpected variable type: %s ' , gettype ($ driverArray )));
62+ }
5863 $ item ->set ($ this ->driverUnwrapData ($ driverArray ));
5964 $ item ->expiresAt ($ this ->driverUnwrapTime ($ driverArray ));
6065 $ item ->setTags ($ this ->driverUnwrapTags ($ driverArray ));
You can’t perform that action at this time.
0 commit comments