@@ -43,7 +43,7 @@ class Cache
4343 private $ namespace ;
4444
4545
46- public function __construct (Storage $ storage , string $ namespace = null )
46+ public function __construct (Storage $ storage , ? string $ namespace = null )
4747 {
4848 $ this ->storage = $ storage ;
4949 $ this ->namespace = $ namespace . self ::NAMESPACE_SEPARATOR ;
@@ -83,7 +83,7 @@ public function derive(string $namespace)
8383 * @param mixed $key
8484 * @return mixed
8585 */
86- public function load ($ key , callable $ generator = null )
86+ public function load ($ key , ? callable $ generator = null )
8787 {
8888 $ storageKey = $ this ->generateKey ($ key );
8989 $ data = $ this ->storage ->read ($ storageKey );
@@ -106,7 +106,7 @@ public function load($key, callable $generator = null)
106106 /**
107107 * Reads multiple items from the cache.
108108 */
109- public function bulkLoad (array $ keys , callable $ generator = null ): array
109+ public function bulkLoad (array $ keys , ? callable $ generator = null ): array
110110 {
111111 if (count ($ keys ) === 0 ) {
112112 return [];
@@ -169,7 +169,7 @@ public function bulkLoad(array $keys, callable $generator = null): array
169169 * @return mixed value itself
170170 * @throws Nette\InvalidArgumentException
171171 */
172- public function save ($ key , $ data , array $ dependencies = null )
172+ public function save ($ key , $ data , ? array $ dependencies = null )
173173 {
174174 $ key = $ this ->generateKey ($ key );
175175
@@ -263,7 +263,7 @@ public function remove($key): void
263263 * - Cache::TAGS => (array) tags
264264 * - Cache::ALL => true
265265 */
266- public function clean (array $ conditions = null ): void
266+ public function clean (? array $ conditions = null ): void
267267 {
268268 $ conditions = (array ) $ conditions ;
269269 if (isset ($ conditions [self ::TAGS ])) {
@@ -294,7 +294,7 @@ public function call(callable $function)
294294 /**
295295 * Caches results of function/method calls.
296296 */
297- public function wrap (callable $ function , array $ dependencies = null ): \Closure
297+ public function wrap (callable $ function , ? array $ dependencies = null ): \Closure
298298 {
299299 return function () use ($ function , $ dependencies ) {
300300 $ key = [$ function , $ args = func_get_args ()];
0 commit comments