public static function getRequiredArgsError($args, $requiredArgs)
    {
        if (!is_array($args) && !is_object($args)) {
            return sprintf(__('invalid type "%s" for $args', 'themaster'), gettype($args));
        }
        if (!is_array($requiredArgs) && !is_object($args)) {
            return sprintf(__('invalid type "%s" for $requiredArgs', 'themaster'), gettype($requiredArgs));
        }

        $missing = array();
        foreach ($requiredArgs as $req) {
            if (!@isset($args[$req]) && !@isset($args->$req)) {
                $missing[] = $req;
            }
        }
        
        if (count($missing) == 0) {
            return false;
        } else {
            return sprintf(
                __('Missing %s as %s.', 'themaster'),
                self::readableList(
                    $missing,
                    ' '.__('and').' ',
                    ', ',
                    null,
                    '"'
                ),
                (count($missing) === 1 ? 'a key' : 'keys')
            );
        }
    }
public static function getRequiredArgsError($args, $requiredArgs)
    {
        if (!is_array($args) && !is_object($args)) {
            return sprintf(__('invalid type "%s" for $args', 'themaster'), gettype($args));
        }
        if (!is_array($requiredArgs) && !is_object($args)) {
            return sprintf(__('invalid type "%s" for $requiredArgs', 'themaster'), gettype($requiredArgs));
        }

        $missing = array();
        foreach ($requiredArgs as $req) {
            if (!@isset($args[$req]) && !@isset($args->$req)) {
                $missing[] = $req;
            }
        }
        
        if (count($missing) == 0) {
            return false;
        } else {
            return sprintf(
                __('Missing %s as %s.', 'themaster'),
                self::readableList(
                    $missing,
                    ' '.__('and').' ',
                    ', ',
                    null,
                    '"'
                ),
                (count($missing) === 1 ? 'a key' : 'keys')
            );
        }
    }
public static function getRequiredArgsError ( $ args , $ requiredArgs ) { if ( ! is_array ( $ args ) && ! is_object ( $ args ) ) { return sprintf ( __ ( 'invalid type "%s" for $args' , 'themaster' ) , gettype ( $ args ) ) ; } if ( ! is_array ( $ requiredArgs ) && ! is_object ( $ args ) ) { return sprintf ( __ ( 'invalid type "%s" for $requiredArgs' , 'themaster' ) , gettype ( $ requiredArgs ) ) ; } $ missing = array ( ) ; foreach ( $ requiredArgs as $ req ) { if ( ! @ isset ( $ args [ $ req ] ) && ! @ isset ( $ args -> $ req ) ) { $ missing [ ] = $ req ; } } if ( count ( $ missing ) == 0 ) { return false ; } else { return sprintf ( __ ( 'Missing %s as %s.' , 'themaster' ) , self :: readableList ( $ missing , ' ' . __ ( 'and' ) . ' ' , ', ' , null , '"' ) , ( count ( $ missing ) === 1 ? 'a key' : 'keys' ) ) ; } }
Checks if Array 1 has all required keys, specified by Array 2

@access public
@param  array $args         the array to be checked.
@param  array $requiredArgs the required keys.
@return string|false        Error string or false if no Error found.
Checks if Array 1 has all required keys specified by Array 2