]> git.mxchange.org Git - mailer.git/blobdiff - inc/wrapper-functions.php
Fixes + asserts
[mailer.git] / inc / wrapper-functions.php
index 9eee082a5fb26ac7d776654bca2d5d5ffd5d958c..c5aea2d344f62861eb17bf735393416d712a1649 100644 (file)
@@ -527,7 +527,7 @@ function isDebugBuildMailsEnabled () {
 }
 
 // Checks whether the cache instance is valid
 }
 
 // Checks whether the cache instance is valid
-function isCacheInstanceValid () {
+function isValidCacheInstance () {
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
        // Is there cache?
        if (!isset($GLOBALS[__FUNCTION__])) {
                // Determine it
@@ -1085,7 +1085,7 @@ function getUserDataArray () {
 
 // Checks if the user data is valid, this may indicate that the user has logged
 // in, but you should use isMember() if you want to find that out.
 
 // Checks if the user data is valid, this may indicate that the user has logged
 // in, but you should use isMember() if you want to find that out.
-function isUserDataValid () {
+function isValidUserData () {
        // User id should not be zero so abort here
        if (!isCurrentUserIdSet()) {
                // Debug message, may be noisy
        // User id should not be zero so abort here
        if (!isCurrentUserIdSet()) {
                // Debug message, may be noisy
@@ -3491,9 +3491,9 @@ function translateFullComma ($dotted) {
 // Wrapper to check if the first element to be shifted is set to given value
 function shift_array (&$array, $value, $key = '0') {
        // Is the element set and value matches?
 // Wrapper to check if the first element to be shifted is set to given value
 function shift_array (&$array, $value, $key = '0') {
        // Is the element set and value matches?
-       assert(is_array($array));
-       assert(isset($array[$key]));
-       assert($array[$key] === $value);
+       assert(is_array($array), 'array[]=' . gettype($array), ',expected: array');
+       assert(isset($array[$key]), 'array[' . $key . '] not set.');
+       assert(($array[$key] === $value), ',array[' . $key . ']=' . $array[$key] . ',value=' . $value);
 
        // Shift it
        array_shift($array);
 
        // Shift it
        array_shift($array);