(dev/core#174) CRM_Utils_Cache_Interface::get() should match PSR-16
authorTim Otten <totten@civicrm.org>
Tue, 19 Jun 2018 22:09:08 +0000 (15:09 -0700)
committerTim Otten <totten@civicrm.org>
Wed, 27 Jun 2018 21:29:52 +0000 (14:29 -0700)
commit2da67cc5bf2670122892aade13a6546263bf6e7d
tree34413c461332b7203df21457a976c7bce934219e
parent1b7de4fff377afeb665b7db717c9d4d332efce3b
(dev/core#174) CRM_Utils_Cache_Interface::get() should match PSR-16

Comparing `CRM_Utils_Cache_Interface::get()` and `Psr\SimpleCache\CacheInterface::get()`,
they agree on key details:

1. They return values are `mixed` (strings, arrays, numbers,, etc)
2. The default representation of a cache-miss is NULL.

They differ in that PSR-16 allows the caller to optionally specify a `$default`.

Since no existing callers actually use this, we can (for moment) throw an
error if someone tries to pass `$default` to a driver that doesn't support
it.

See also: https://www.php-fig.org/psr/psr-16/
CRM/Utils/Cache/APCcache.php
CRM/Utils/Cache/ArrayCache.php
CRM/Utils/Cache/Interface.php
CRM/Utils/Cache/Memcache.php
CRM/Utils/Cache/Memcached.php
CRM/Utils/Cache/NoCache.php
CRM/Utils/Cache/Redis.php
CRM/Utils/Cache/SerializeCache.php
CRM/Utils/Cache/SqlGroup.php