随机获得数组中的值，返回一个保持键值对应的数组

@param array $array
@param int $number
@return array
482250
public static function random($array, $number = 1)
    {
        $result = [];
        $keys = array_rand($array, $number);
        foreach($keys as $key)
        {
            if(!isset($array[$key]))
            {
                break;
            }
            $result[$key] = $array[$key];
        }
        return $result;
    }
179176
public function copyFromArray(array &$array)
    {
        // developer
        $this->setDeveloper(
            LanguageUtility::getFromArray('developer', $array));

        // clientId
        $this->setClientId(
            LanguageUtility::getFromArray('clientId', $array));

        // clientIdAlias
        $this->setClientIdAlias(
            LanguageUtility::getFromArray('clientIdAlias', $array));

        // clientIdAliasEnabled
        $this->setClientIdAliasEnabled(
            LanguageUtility::getFromArrayAsBoolean('clientIdAliasEnabled', $array));

        // clientSecret
        $this->setClientSecret(
            LanguageUtility::getFromArray('clientSecret', $array));

        // clientType
        $this->setClientType(
            ClientType::valueOf(
                LanguageUtility::getFromArray('clientType', $array)));

        // redirectUris
        $this->setRedirectUris(
            LanguageUtility::getFromArray('redirectUris', $array));

        // responseTypes
        $responseTypes = LanguageUtility::getFromArray('responseTypes', $array);
        $this->setResponseTypes(
            LanguageUtility::convertArray(
                $responseTypes, '\Authlete\Types\ResponseType::valueOf'));

        // grantTypes
        $grantTypes = LanguageUtility::getFromArray('grantTypes', $array);
        $this->setGrantTypes(
            LanguageUtility::convertArray(
                $grantTypes, '\Authlete\Types\GrantType::valueOf'));

        // applicationType
        $this->setApplicationType(
            ApplicationType::valueOf(
                LanguageUtility::getFromArray('applicationType', $array)));

        // contacts
        $this->setContacts(
            LanguageUtility::getFromArray('contacts', $array));

        // clientName
        $this->setClientName(
            LanguageUtility::getFromArray('clientName', $array));

        // clientNames
        $clientNames = LanguageUtility::getFromArray('clientNames', $array);
        $this->setClientNames(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $clientNames, __NAMESPACE__ . '\TaggedValue'));

        // logoUri
        $this->setLogoUri(
            LanguageUtility::getFromArray('logoUri', $array));

        // logoUris
        $logoUris = LanguageUtility::getFromArray('logoUris', $array);
        $this->setLogoUris(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $logoUris, __NAMESPACE__ . '\TaggedValue'));

        // clientUri
        $this->setClientUri(
            LanguageUtility::getFromArray('clientUri', $array));

        // clientUris
        $clientUris = LanguageUtility::getFromArray('clientUris', $array);
        $this->setClientUris(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $clientUris, __NAMESPACE__ . '\TaggedValue'));

        // policyUri
        $this->setPolicyUri(
            LanguageUtility::getFromArray('policyUri', $array));

        // policyUris
        $policyUris = LanguageUtility::getFromArray('policyUris', $array);
        $this->setPolicyUris(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $policyUris, __NAMESPACE__ . '\TaggedValue'));

        // tosUri
        $this->setTosUri(
            LanguageUtility::getFromArray('tosUri', $array));

        // tosUris
        $tosUris = LanguageUtility::getFromArray('tosUris', $array);
        $this->setTosUris(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $tosUris, __NAMESPACE__ . '\TaggedValue'));

        // jwksUri
        $this->setJwksUri(
            LanguageUtility::getFromArray('jwksUri', $array));

        // jwks
        $this->setJwks(
            LanguageUtility::getFromArray('jwks', $array));

        // sectorIdentifier
        $this->setSectorIdentifierUri(
            LanguageUtility::getFromArray('sectorIdentifier', $array));

        // subjectType
        $this->setSubjectType(
            SubjectType::valueOf(
                LanguageUtility::getFromArray('subjectType', $array)));

        // idTokenSignAlg
        $this->setIdTokenSignAlg(
            JWSAlg::valueOf(
                LanguageUtility::getFromArray('idTokenSignAlg', $array)));

        // idTokenEncryptionAlg
        $this->setIdTokenEncryptionAlg(
            JWEAlg::valueOf(
                LanguageUtility::getFromArray('idTokenEncryptionAlg', $array)));

        // idTokenEncryptionEnc
        $this->setIdTokenEncryptionEnc(
            JWEEnc::valueOf(
                LanguageUtility::getFromArray('idTokenEncryptionEnc', $array)));

        // userInfoSignAlg
        $this->setUserInfoSignAlg(
            JWSAlg::valueOf(
                LanguageUtility::getFromArray('userInfoSignAlg', $array)));

        // userInfoEncryptionAlg
        $this->setUserInfoEncryptionAlg(
            JWEAlg::valueOf(
                LanguageUtility::getFromArray('userInfoEncryptionAlg', $array)));

        // userInfoEncryptionEnc
        $this->setUserInfoEncryptionEnc(
            JWEEnc::valueOf(
                LanguageUtility::getFromArray('userInfoEncryptionEnc', $array)));

        // requestSignAlg
        $this->setRequestSignAlg(
            JWSAlg::valueOf(
                LanguageUtility::getFromArray('requestSignAlg', $array)));

        // requestEncryptionAlg
        $this->setRequestEncryptionAlg(
            JWEAlg::valueOf(
                LanguageUtility::getFromArray('requestEncryptionAlg', $array)));

        // requestEncryptionEnc
        $this->setRequestEncryptionEnc(
            JWEEnc::valueOf(
                LanguageUtility::getFromArray('requestEncryptionEnc', $array)));

        // tokenAuthMethod
        $this->setTokenAuthMethod(
            ClientAuthMethod::valueOf(
                LanguageUtility::getFromArray('tokenAuthMethod', $array)));

        // tokenAuthSignAlog
        $this->setTokenAuthSignAlg(
            JWSAlg::valueOf(
                LanguageUtility::getFromArray('tokenAuthSignAlg', $array)));

        // defaultMaxAge
        $this->setDefaultMaxAge(
            LanguageUtility::getFromArray('defaultMaxAge', $array));

        // authTimeRequired
        $this->setAuthTimeRequired(
            LanguageUtility::getFromArrayAsBoolean('authTimeRequired', $array));

        // defaultAcrs
        $this->setDefaultAcrs(
            LanguageUtility::getFromArray('defaultAcrs', $array));

        // loginUri
        $this->setLoginUri(
            LanguageUtility::getFromArray('loginUri', $array));

        // requestUris
        $this->setRequestUris(
            LanguageUtility::getFromArray('requestUris', $array));

        // description
        $this->setDescription(
            LanguageUtility::getFromArray('description', $array));

        // descriptions
        $descriptions = LanguageUtility::getFromArray('descriptions', $array);
        $this->setDescriptions(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $descriptions, __NAMESPACE__ . '\TaggedValue'));

        // createdAt
        $this->setCreatedAt(
            LanguageUtility::getFromArray('createdAt', $array));

        // modifiedAt
        $this->setModifiedAt(
            LanguageUtility::getFromArray('modifiedAt', $array));

        // extension
        $extension = LanguageUtility::getFromArray('extension', $array);
        $this->setExtension(
            LanguageUtility::convertArrayToArrayCopyable(
                $extension, __NAMESPACE__ . '\ClientExtension'));

        // tlsClientAuthSubjectDn
        $this->setTlsClientAuthSubjectDn(
            LanguageUtility::getFromArray('tlsClientAuthSubjectDn', $array));

        // tlsClientCertificateBoundAccessTokens
        $this->setTlsClientCertificateBoundAccessTokens(
            LanguageUtility::getFromArrayAsBoolean('tlsClientCertificateBoundAccessTokens', $array));

        // selfSignedCertificateKeyId
        $this->setSelfSignedCertificateKeyId(
            LanguageUtility::getFromArray('selfSignedCertificateKeyId', $array));

        // softwareId
        $this->setSoftwareId(
            LanguageUtility::getFromArray('softwareId', $array));

        // softwareVersion
        $this->setSoftwareVersion(
            LanguageUtility::getFromArray('softwareVersion', $array));

        // authorizationSignAlg
        $this->setAuthorizationSignAlg(
            JWSAlg::valueOf(
                LanguageUtility::getFromArray('authorizationSignAlg', $array)));

        // authorizationEncryptionAlg
        $this->setAuthorizationEncryptionAlg(
            JWEAlg::valueOf(
                LanguageUtility::getFromArray('authorizationEncryptionAlg', $array)));

        // authorizationEncryptionEnc
        $this->setAuthorizationEncryptionEnc(
            JWEEnc::valueOf(
                LanguageUtility::getFromArray('authorizationEncryptionEnc', $array)));
    }
953053
public static function get($array, $key, $default = null)
	{
		if (!static::accessible($array))
			return value($default);

		if (is_null($key))
			return $array;

		if (static::exists($array, $key))
			return $array[(string) $key];


		foreach (static::toKey($key) as $segment) {
			if (static::accessible($array) && static::exists($array, $segment)) {
				$array = $array[$segment];
			} else {
				return value($default);
			}
		}

		return $array;
	}
1358684
public static function getObjectWithKey(array $array, $key)
    {
        foreach ($array as $object) {
            if (is_array($object) && array_key_exists($key, $object)) {
                return $object;
            }
        }

        return null;
    }
1149113
public function copyToArray(array &$array)
    {
        parent::copyToArray($array);

        $array['action']               = LanguageUtility::toString($this->action);
        $array['service']              = LanguageUtility::convertArrayCopyableToArray($this->service);
        $array['client']               = LanguageUtility::convertArrayCopyableToArray($this->client);
        $array['clientIdAliasUsed']    = $this->clientIdAliasUsed;
        $array['display']              = LanguageUtility::toString($this->display);
        $array['maxAge']               = LanguageUtility::orZero($this->maxAge);
        $array['scopes']               = LanguageUtility::convertArrayOfArrayCopyableToArray($this->scopes);
        $array['uiLocales']            = $this->uiLocales;
        $array['claimsLocales']        = $this->claimsLocales;
        $array['claims']               = $this->claims;
        $array['acrEssential']         = $this->acrEssential;
        $array['acrs']                 = $this->acrs;
        $array['subject']              = $this->subject;
        $array['loginHint']            = $this->loginHint;
        $array['prompts']              = LanguageUtility::convertArrayToStringArray($this->prompts);
        $array['requestObjectPayload'] = $this->requestObjectPayload;
        $array['idTokenClaims']        = $this->idTokenClaims;
        $array['userInfoClaims']       = $this->userInfoClaims;
        $array['responseContent']      = $this->responseContent;
        $array['ticket']               = $this->ticket;
    }
18642
public static function pluck(array $array, $key)
    {
        return array_map(
            function ($item) use ($key) {
                return is_object($item) ? $item->$key : $item[$key];
            },
            $array
        );
    }
278020
protected function map(array &$array, $fn) {
        $result = [];
        $length = count($array);
        while ($length--) {
            $result[$length] = $fn($array[$length]);
        }
        ksort($result);
        return $result;
    }
682355
public static function pluck($array, $key)
    {
        return array_map(
            function ($v) use ($key) {
                return is_object($v) ? $v->$key : $v[$key];

            },
            $array
        );
    }
523541
private function arrayCopy(array $array) {
    $result = array();
    foreach ($array as $key => $val) {
      if (is_array($val)) {
        $result[$key] = self::arrayCopy($val);
      }
      elseif (is_object($val)) {
        $result[$key] = clone $val;
      }
      else {
        $result[$key] = $val;
      }
    }
    return $result;
  }
1140048
public static function arrayPick(array &$array, $key, $value = null)
    {
        if (array_key_exists($key, $array)) {
            $value = $array[$key] ?? $value;
            unset($array[$key]);
        }

        return $value;
    }
264625
private static function associateNumericKeys($array, $default=true) {
		if (is_string($array)) {
			$array = [$array => $default];
		} else {
			foreach ($array as $key=>$value) {
				if (is_int($key)) {
					$array[$value] = $default;
					unset($array[$key]);
				}
			}
		}
		return $array;
	}
423995
public static function array_pick($array) {
    if (!is_array( $array )) {
      return $array;
    }
    $keys = array_slice(func_get_args(), 1);
    $keys = self::array_flatten($keys);
    $pick = array();
    foreach ( $keys as $key ) {
      if (!array_key_exists($key, $array)) {
        continue;
      }
      $pick[$key] = $array[$key];
    }
    return $pick;
  }
301037
public static function associativeArray(array $array) {
        $string = '[ ';
        foreach($array as $key => $item) {
            $string .= $key . ' => ' . $item;
            if($item !== last($array)) {
                $string .= ', ';
            }
        }
        $string .= ' ]';

        return $string;
    }
668677
public function copyFromArray(array &$array)
    {
        // serviceName
        $this->setServiceName(
            LanguageUtility::getFromArray('serviceName', $array));

        // apiKey
        $this->setApiKey(
            LanguageUtility::getFromArray('apiKey', $array));

        // apiSecret
        $this->setApiSecret(
            LanguageUtility::getFromArray('apiSecret', $array));

        // issuer
        $this->setIssuer(
            LanguageUtility::getFromArray('issuer', $array));

        // authorizationEndpoint
        $this->setAuthorizationEndpoint(
            LanguageUtility::getFromArray('authorizationEndpoint', $array));

        // tokenEndpoint
        $this->setTokenEndpoint(
            LanguageUtility::getFromArray('tokenEndpoint', $array));

        // revocationEndpoint
        $this->setRevocationEndpoint(
            LanguageUtility::getFromArray('revocationEndpoint', $array));

        // supportedRevocationAuthMethods
        $supportedRevocationAuthMethods = LanguageUtility::getFromArray('supportedRevocationAuthMethods', $array);
        $this->setSupportedRevocationAuthMethods(
            LanguageUtility::convertArray(
                $supportedRevocationAuthMethods, '\Authlete\Types\ClientAuthMethod::valueOf'));

        // userInfoEndpoint
        $this->setUserInfoEndpoint(
            LanguageUtility::getFromArray('userInfoEndpoint', $array));

        // jwksUri
        $this->setJwksUri(
            LanguageUtility::getFromArray('jwksUri', $array));

        // jwks
        $this->setJwks(
            LanguageUtility::getFromArray('jwks', $array));

        // registrationEndpoint
        $this->setRegistrationEndpoint(
            LanguageUtility::getFromArray('registrationEndpoint', $array));

        // supportedScopes
        $supportedScopes = LanguageUtility::getFromArray('supportedScopes', $array);
        $this->setSupportedScopes(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $supportedScopes, __NAMESPACE__ . '\Scope'));

        // supportedResponseTypes
        $supportedResponseTypes = LanguageUtility::getFromArray('supportedResponseTypes', $array);
        $this->setSupportedResponseTypes(
            LanguageUtility::convertArray(
                $supportedResponseTypes, '\Authlete\Types\ResponseType::valueOf'));

        // supportedGrantTypes
        $supportedGrantTypes = LanguageUtility::getFromArray('supportedGrantTypes', $array);
        $this->setSupportedGrantTypes(
            LanguageUtility::convertArray(
                $supportedGrantTypes, '\Authlete\Types\GrantType::valueOf'));

        // supportedAcrs
        $this->setSupportedAcrs(
            LanguageUtility::getFromArray('supportedAcrs', $array));

        // supportedTokenAuthMethods
        $supportedTokenAuthMethods = LanguageUtility::getFromArray('supportedTokenAuthMethods', $array);
        $this->setSupportedTokenAuthMethods(
            LanguageUtility::convertArray(
                $supportedTokenAuthMethods, '\Authlete\Types\ClientAuthMethod::valueOf'));

        // supportedDisplays
        $supportedDisplays = LanguageUtility::getFromArray('supportedDisplays', $array);
        $this->setSupportedDisplays(
            LanguageUtility::convertArray(
                $supportedDisplays, '\Authlete\Types\Display::valueOf'));

        // supportedClaimTypes
        $supportedClaimTypes = LanguageUtility::getFromArray('supportedClaimTypes', $array);
        $this->setSupportedClaimTypes(
            LanguageUtility::convertArray(
                $supportedClaimTypes, '\Authlete\Types\ClaimType::valueOf'));

        // supportedClaims
        $this->setSupportedClaims(
            LanguageUtility::getFromArray('supportedClaims', $array));

        // serviceDocumentation
        $this->setServiceDocumentation(
            LanguageUtility::getFromArray('serviceDocumentation', $array));

        // supportedClaimLocales
        $this->setSupportedClaimLocales(
            LanguageUtility::getFromArray('supportedClaimLocales', $array));

        // supportedUiLocales
        $this->setSupportedUiLocales(
            LanguageUtility::getFromArray('supportedUiLocales', $array));

        // policyUri
        $this->setPolicyUri(
            LanguageUtility::getFromArray('policyUri', $array));

        // tosUri
        $this->setTosUri(
            LanguageUtility::getFromArray('tosUri', $array));

        // description
        $this->setDescription(
            LanguageUtility::getFromArray('description', $array));

        // accessTokenType
        $this->setAccessTokenType(
            LanguageUtility::getFromArray('accessTokenType', $array));

        // accessTokenDuration
        $this->setAccessTokenDuration(
            LanguageUtility::getFromArray('accessTokenDuration', $array));

        // refreshTokenDuration
        $this->setRefreshTokenDuration(
            LanguageUtility::getFromArray('refreshTokenDuration', $array));

        // idTokenDuration
        $this->setIdTokenDuration(
            LanguageUtility::getFromArray('idTokenDuration', $array));

        // authorizationResponseDuration
        $this->setAuthorizationResponseDuration(
            LanguageUtility::getFromArray('authorizationResponseDuration', $array));

        // authenticationCallbackEndpoint
        $this->setAuthenticationCallbackEndpoint(
            LanguageUtility::getFromArray('authenticationCallbackEndpoint', $array));

        // authenticationCallbackApiKey
        $this->setAuthenticationCallbackApiKey(
            LanguageUtility::getFromArray('authenticationCallbackApiKey', $array));

        // authenticationCallbackApiSecret
        $this->setAuthenticationCallbackApiSecret(
            LanguageUtility::getFromArray('authenticationCallbackApiSecret', $array));

        // supportedSnses
        $supportedSnses = LanguageUtility::getFromArray('supportedSnses', $array);
        $this->setSupportedSnses(
            LanguageUtility::convertArray(
                $supportedSnses, '\Authlete\Types\Sns::valueOf'));
    
        // snsCredentials
        $snsCredentials = LanguageUtility::getFromArray('snsCredentials', $array);
        $this->setSnsCredentials(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $snsCredentials, __NAMESPACE__ . '\SnsCredentials'));

        // createdAt
        $this->setCreatedAt(
            LanguageUtility::getFromArray('createdAt', $array));

        // modifiedAt
        $this->setModifiedAt(
            LanguageUtility::getFromArray('modifiedAt', $array));

        // developerAuthenticationCallbackEndpoint
        $this->setDeveloperAuthenticationCallbackEndpoint(
            LanguageUtility::getFromArray('developerAuthenticationCallbackEndpoint', $array));

        // developerAuthenticationCallbackApiKey
        $this->setDeveloperAuthenticationCallbackApiKey(
            LanguageUtility::getFromArray('developerAuthenticationCallbackApiKey', $array));

        // developerAuthenticationCallbackApiSecret
        $this->setDeveloperAuthenticationCallbackApiSecret(
            LanguageUtility::getFromArray('developerAuthenticationCallbackApiSecret', $array));

        // supportedDeveloperSnses
        $supportedDeveloperSnses = LanguageUtility::getFromArray('supportedDeveloperSnses', $array);
        $this->setSupportedDeveloperSnses(
            LanguageUtility::convertArray(
                $supportedDeveloperSnses, '\Authlete\Types\Sns::valueOf'));
    
        // developerSnsCredentials
        $developerSnsCredentials = LanguageUtility::getFromArray('developerSnsCredentials', $array);
        $this->setDeveloperSnsCredentials(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $developerSnsCredentials, __NAMESPACE__ . '\SnsCredentials'));

        // clientsPerDeveloper
        $this->setClientsPerDeveloper(
            LanguageUtility::orZero(
                LanguageUtility::getFromArray('clientsPerDeveloper', $array)));

        // directAuthorizationEndpointEnabled
        $this->setDirectAuthorizationEndpointEnabled(
            LanguageUtility::getFromArrayAsBoolean('directAuthorizationEndpointEnabled', $array));

        // directTokenEndpointEnabled
        $this->setDirectTokenEndpointEnabled(
            LanguageUtility::getFromArrayAsBoolean('directTokenEndpointEnabled', $array));

        // directRevocationEndpointEnabled
        $this->setDirectRevocationEndpointEnabled(
            LanguageUtility::getFromArrayAsBoolean('directRevocationEndpointEnabled', $array));

        // directUserInfoEndpointEnabled
        $this->setDirectUserInfoEndpointEnabled(
            LanguageUtility::getFromArrayAsBoolean('directUserInfoEndpointEnabled', $array));

        // directJwksEndpointEnabled
        $this->setDirectJwksEndpointEnabled(
            LanguageUtility::getFromArrayAsBoolean('directJwksEndpointEnabled', $array));

        // directIntrospectionEndpointEnabled
        $this->setDirectIntrospectionEndpointEnabled(
            LanguageUtility::getFromArrayAsBoolean('directIntrospectionEndpointEnabled', $array));

        // singleAccessTokenPerSubject
        $this->setSingleAccessTokenPerSubject(
            LanguageUtility::getFromArrayAsBoolean('singleAccessTokenPerSubject', $array));

        // pkceRequired
        $this->setPkceRequired(
            LanguageUtility::getFromArrayAsBoolean('pkceRequired', $array));

        // refreshTokenKept
        $this->setRefreshTokenKept(
            LanguageUtility::getFromArrayAsBoolean('refreshTokenKept', $array));

        // errorDescriptionOmitted
        $this->setErrorDescriptionOmitted(
            LanguageUtility::getFromArrayAsBoolean('errorDescriptionOmitted', $array));

        // errorUriOmitted
        $this->setErrorUriOmitted(
            LanguageUtility::getFromArrayAsBoolean('errorUriOmitted', $array));

        // clientIdAliasEnabled
        $this->setClientIdAliasEnabled(
            LanguageUtility::getFromArrayAsBoolean('clientIdAliasEnabled', $array));

        // supportedServiceProfiles
        $supportedServiceProfiles = LanguageUtility::getFromArray('supportedServiceProfiles', $array);
        $this->setSupportedServiceProfiles(
            LanguageUtility::convertArray(
                $supportedServiceProfiles, '\Authlete\Types\ServiceProfile::valueOf'));

        // tlsClientCertificateBoundAccessTokens
        $this->setTlsClientCertificateBoundAccessTokens(
            LanguageUtility::getFromArrayAsBoolean('tlsClientCertificateBoundAccessTokens', $array));

        // mutualTlsValidatePkiCertChain
        $this->setMutualTlsValidatePkiCertChain(
            LanguageUtility::getFromArrayAsBoolean('mutualTlsValidatePkiCertChain', $array));

        // introspectionEndpoint
        $this->setIntrospectionEndpoint(
            LanguageUtility::getFromArray('introspectionEndpoint', $array));

        // supportedIntrospectionAuthMethods
        $supportedIntrospectionAuthMethods = LanguageUtility::getFromArray('supportedIntrospectionAuthMethods', $array);
        $this->setSupportedIntrospectionAuthMethods(
            LanguageUtility::convertArray(
                $supportedIntrospectionAuthMethods, '\Authlete\Types\ClientAuthMethod::valueOf'));

        // trustedRootCertificates
        $this->setTrustedRootCertificates(
            LanguageUtility::getFromArray('trustedRootCertificates', $array));

        // authorizationSignatureKeyId
        $this->setAuthorizationSignatureKeyId(
            LanguageUtility::getFromArray('authorizationSignatureKeyId', $array));

        // idTokenSignatureKeyId
        $this->setIdTokenSignatureKeyId(
            LanguageUtility::getFromArray('idTokenSignatureKeyId', $array));

        // userInfoSignatureKeyId
        $this->setUserInfoSignatureKeyId(
            LanguageUtility::getFromArray('userInfoSignatureKeyId', $array));
    }
231500
public function copyToArray(array &$array)
    {
        $array['grantType']            = LanguageUtility::toString($this->grantType);
        $array['clientId']             = LanguageUtility::orZero($this->clientId);
        $array['subject']              = $this->subject;
        $array['scopes']               = $this->scopes;
        $array['accessTokenDuration']  = LanguageUtility::orZero($this->accessTokenDuration);
        $array['refreshTokenDuration'] = LanguageUtility::orZero($this->refreshTokenDuration);
        $array['properties']           = LanguageUtility::convertArrayOfArrayCopyableToArray($this->properties);
        $array['clientIdAliasUsed']    = $this->clientIdAliasUsed;
        $array['accessToken']          = $this->accessToken;
        $array['refreshToken']         = $this->refreshToken;
    }
1189624
public static function removeNull(array $array)
    {
        $result = [];
        foreach ($array as $key => $value) {
            if (is_null($value)) {
                continue;
            }
            $result[$key] = $value;
        }
        return $result;
    }
59495
private function array_get($array, $key, $default = null)
	{
		if (is_null($key)) return $array;
		foreach (explode('.', $key) as $segment)
		{
			if ( ! is_array($array) or ! array_key_exists($segment, $array))
			{
				return $default;
			}
			$array = $array[$segment] ?: $default;
		}
		return $array;
	}