检验auth数组正确性

@param array

@return null or die
1161
public function checkAuthArray($array)
	{

		//root
		if(array_has($array, 'root')){
			if(array_get($array, 'root') != 'only') {
				die('FooWeChat\Authorize\Auth\checkAuthArray: 参数 root 值错误');
			}
		}

		//admin
		if(array_has($array, 'admin')){
			$a = array_get($array, 'admin');
			if($a != 'yes' && $a != 'no' && $a != 'only') {
				die('FooWeChat\Authorize\Auth\checkAuthArray: 参数 admin 值错误');
			}
		}

		//way
		if(array_has($array, 'way')){
			$a = array_get($array, 'way');
			if($a != 'wechat' && $a != 'web' && $a != 'all') {
				die('FooWeChat\Authorize\Auth\checkAuthArray: 参数 way 值错误');
			}
		}

		//except
		if(array_has($array, 'except')){
			$this->checkUser(array_get($array, 'except'));
		}

		//user
		if(array_has($array, 'user')){
			$this->checkUser(array_get($array, 'user'));
		}

	}
240803
protected static function prepareWhere(array $array, $list)
    {
        if (!is_array($list)) {
            $list = [$list];
        }
        foreach ($list as $v) {
            if (array_key_exists($v, $array)) {
                return $v;
            }
        }

        return null;
    }
805515
function arrayToUUID(array, offset)
			{
				var k=0;
				var string = '';
				var UUID_format = [4, 2, 2, 2, 6];
				for (var l=0; l<UUID_format.length; l++)
				{
					if (l != 0)
					{
						string += '-';
					}
					for (var j=0; j<UUID_format[l]; j++, k++)
					{
						string += evothings.util.toHexString(array[offset+k], 1);
					}
				}
				return string;
			}
29589
@SafeVarargs
    public static <V> V getLast(V... array) {
        return JMArrays.isNullOrEmpty(array) ? null : array[array.length - 1];
    }
563324
function( array, id, recurse ) {
			for ( var i = 0, item;
			( item = array[ i ] ); i++ ) {
				if ( item.id == id )
					return item;
				if ( recurse && item[ recurse ] ) {
					var retval = getById( item[ recurse ], id, recurse );
					if ( retval )
						return retval;
				}
			}
			return null;
		}
805092
public function find($array, $params)
    {
        if (count($array)) {
            foreach ($array as $item) {
                $found = true;
                foreach ($params as $key => $value) {
                    if ($item->$key != $value) {
                        $found = false;
                    }
                }
                if ($found) {
                    return $item;
                }
            }
        }

        return null;
    }
88641
function (authenticationRequest) {

            var authenticationProviders = this.$providers,
                provider;

            for (var i = 0; i < authenticationProviders.length; i++) {

                provider = authenticationProviders[i];

                if (provider.isResponsibleForAuthenticationRequest(authenticationRequest)) {
                    return provider;
                }
            }

            return null;

        }
999589
public static <T> QueryParameterValue array(T[] array, Class<T> clazz) {
    return array(array, classToType(clazz));
  }
1053936
public Object get (Object array, int index)
    {
        return (array == null) ? null : Array.get(array, index);
    }
1132586
public static Iterator<Object> getKeys(Object[] array)
    {
        if (array == null)
        {
            return null;
        }
        ArrayList<Object> keyList = new ArrayList<Object>();
        int i = array.length - 2;
        while (i >= 0)
        {
            keyList.add(array[i]);
            i = i - 2;
        }
        return keyList.iterator();
    }
107897
public VisitState get(final byte[] array) {
		// The starting point.
		int pos = (int)(MurmurHash3.hash(array) & mask);
		// There's always an unused entry.
		while (visitState[pos] != null) {
			if (Arrays.equals(visitState[pos].schemeAuthority, array)) return visitState[pos];
			pos = (pos + 1) & mask;
		}
		return null;
	}
314753
protected function fromGuard()
    {
        $auth = $this->laravel['auth'];
        $user = $auth->user();

        return is_null($user) === true ? [] : [
            'id' => $user->getAuthIdentifier(),
            'rows' => $user->toArray(),
        ];
    }
777465
public static function str_safe_html(&$array)
    {
        if (is_array($array)) {
            foreach ($array as $key => $value) {
                if (!is_array($value)) {
                    //&,",',> ,< 转为html实体 &amp;,&quot;&#039;,&gt;,&lt;
                    $array[$key] = htmlspecialchars($value,ENT_QUOTES);
                } else {
                    self::str_safe_html($array[$key]);
                }
            }
        } else {
            $array = htmlspecialchars($array,ENT_QUOTES);
        }
    }
1190130
public static String HA1(String username, String realm, String password, String algorithm){
        String ha1 = "";
        ha1 = DigestAuthentication.H(username+":"+realm+":"+password, algorithm);
        return ha1;
    }
903387
public static String jsonJoin(String[] array) {
        int arraySize = array.length;
        int bufSize = arraySize * (array[0].length() + 3);
        StringBuilder buf = new StringBuilder(bufSize);
        for (int i = 0; i < arraySize; i++) {
            if (i > 0) {
                buf.append(',');
            }

            buf.append('"');
            buf.append(array[i]);
            buf.append('"');
        }
        return buf.toString();
    }
712996
public function getAuthorization()
    {
        if (!$this->hasHeader('Authorization')) {
            return null;
        }
        $temp = explode(' ', trim($this->getHeaderLine('Authorization')), 2);
        switch (strtolower($temp[0])) {
            case 'basic':
                $temp[1] = base64_decode($temp[1]);
                $temp[1] = explode(':', $temp[1], 2);
                return ['username' => $temp[1][0], 'password' => $temp[1][1] ?? null];
            case 'token':
            case 'oauth':
            case 'bearer':
                return ['token' => $temp[1] ?? null];
            default:
                return null;
        }
    }
557273
static public Object getByEquality(Object[] array, Object key)
    {
        if (array != null)
        {
            int length = array.length;

            for (int i = 0; i < length; i += 2)
            {
                Object targetKey = array[i];
                if (targetKey == null)
                {
                    return null;
                }
                else if (targetKey.equals(key))
                {
                    return array[i + 1];
                }
            }
        }

        return null;
    }