Merge pull request #23912 from mlutfy/reportVars
[civicrm-core.git] / CRM / Utils / Cache / NaiveHasTrait.php
CommitLineData
9f70b0e4
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
bc77d7c0 4 | Copyright CiviCRM LLC. All rights reserved. |
9f70b0e4 5 | |
bc77d7c0
TO
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9f70b0e4
TO
9 +--------------------------------------------------------------------+
10 */
11
12/**
13 *
14 * @package CRM
ca5cec67 15 * @copyright CiviCRM LLC https://civicrm.org/licensing
9f70b0e4
TO
16 * The traditional CRM_Utils_Cache_Interface did not support has().
17 * To get drop-in compliance with PSR-16, we use a naive adapter.
18 *
8f7f4610 19 * There may be opportunities to replace/optimize in specific drivers.
9f70b0e4
TO
20 */
21trait CRM_Utils_Cache_NaiveHasTrait {
22
23 public function has($key) {
89861474 24 $nack = CRM_Utils_Cache::nack();
8f7f4610
TO
25 $value = $this->get($key, $nack);
26 return ($value !== $nack);
9f70b0e4
TO
27 }
28
29}