PHP Classes

File: src/_functions.php

Recommend this page to a friend!
  Classes of Payam Naderi   Key-Value Storage   src/_functions.php   Download  
File: src/_functions.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Key-Value Storage
Store and retrieve values on different containers
Author: By
Last change:
Date: 6 years ago
Size: 438 bytes
 

Contents

Class file image Download
<?php
namespace Poirot\Storage
{
    use
Poirot\Storage\Exception\exInvalidKey;


   
/**
     * Assert Given Key
     *
     * @param $key
     *
     * @throws exInvalidKey
     */
   
function assertKey($key)
    {
        if ( !
is_string($key) && !is_int($key) )
            throw new
exInvalidKey(sprintf(
               
'Key must be string or int; given: (%s).'
               
, \Poirot\Std\flatten($key)
            ));
    }

}