@param array $rest

@return bool
429560
private function validateAgainstAdditionalPropertiesValidator(array $rest)
    {
        foreach ($rest as $propertyValue) {
            if (!$this->additionalProperties->validate($propertyValue)) {
                return false;
            }
        }
        return true;
    }
572316
public static function IsSingleDepth( array $array ) : bool
   {

      if ( \count( $array ) < 1 )
      {
         return false;
      }

      foreach ( $array as $v )
      {
         if ( \is_array( $v ) && \count( $v ) > 0 )
         {
            return false;
         }
      }

      return true;

   }
1270187
private function isInTransaction(array $options)
    {
        if (isset($options['session']) && $options['session'] instanceof \MongoDB\Driver\Session && $options['session']->isInTransaction()) {
            return true;
        }
        return false;
    }
1311666
public function isAuthorise($response){
        $result = false;
        $hasError = $this->isError($response);
        $isApprove = $this->isApprove($response);

        if(!$hasError && $isApprove){
            $result = true;
        }

        return $result;
    }
445624
public static function has($array, $key)
    {
        if (empty($array) || null === $key) {
            return false;
        }

        if (array_key_exists($key, $array)) {
            return true;
        }

        foreach (explode('.', $key) as $segment) {
            if ((\is_array($array) && array_key_exists($segment, $array)) || ($array instanceof \ArrayAccess && $array->offsetExists($segment))) {
                $array = $array[$segment];
            } else {
                return false;
            }
        }

        return true;
    }
400871
protected function isPaginated(array $json)
    {
        if (!array_key_exists('links', $json) || !array_key_exists('meta', $json)) {
            return false;
        }
        if (is_array($json['links'])
            && array_key_exists('self', $json['links'])
            && array_key_exists('first', $json['links'])
            && array_key_exists('last', $json['links'])
            && isset($json['meta']['pagination'])
            && is_array($json['meta']['pagination'])
            && array_key_exists('total', $json['meta']['pagination'])
            && array_key_exists('count', $json['meta']['pagination'])
            && array_key_exists('per_page', $json['meta']['pagination'])
            && array_key_exists('current_page', $json['meta']['pagination'])
            && array_key_exists('total_pages', $json['meta']['pagination'])
        ) {
            return true;
        }
        return false;
    }
106805
public static function assoc($first, $rest, $idx) {
        $ret = [];
        $ret[$first[0]] = $first[1];

        foreach($rest as $val) {
            $ret[$val[$idx][0]] = $val[$idx][1];
        }
        return $ret;
    }
263291
public function once( array $credentials = [] )
	{
		if ( $this->validate( $credentials ) )
		{
			$this->setAcct( $this->lastAttempted );

			return true;
		}

		return false;
	}
462457
public function check(array $config): bool
    {
        $this->extensions = Collection::make(Arr::get($config, 'extensions', []));
        $this->extensions = $this->extensions->reject(function ($ext) {
            return extension_loaded($ext) === false;
        });

        return $this->extensions->isEmpty();
    }
1258569
private static function userHasResource($resources)
    {
        if (!is_array($resources)) {
            $resources = [$resources];
        }

        $container = Container::getInstance();

        /** @var Rbac $rbac */
        $rbac = $container->get('rbac');

        /** @var Auth $auth */
        $auth = $container->get('auth');

        foreach($resources as $resource){
            foreach ($auth->getStorage()->read()['roles'] as $roleName) {
                if (true === $rbac->isGranted($roleName, $resource)) {
                    return true;
                }
            }
        }

        return false;
    }
383660
public function has($object)
    {
        // search for the correct serializer
        foreach ($this->serializers as $serializer) {
            $className = $this->getSerializerHandledClass($serializer);

            if ($object instanceof $className || $object === $className) {
                return true;
            }
        }

        false;
    }
966061
private static function isValidUri(array $uri): bool
    {
        if (!self::isValidUriScheme($uri['scheme'])) {
            return false;
        }
        if (!self::isValidUriPath($uri['path'])) {
            return false;
        }
        if (!self::isValidUriQuery($uri['query'])) {
            return false;
        }
        if (!self::isValidUriFragment($uri['fragment'])) {
            return false;
        }
        if (!self::isValidUriAuthority($uri['authority'])) {
            return false;
        }

        return true;
    }
458057
public static function keyExists(array $array, $path) : bool
    {
        foreach (explode('.', $path) as $segment) {
            if (! is_array($array) or ! array_key_exists($segment, $array)) {
                return false;
            }

            $array = $array[$segment];
        }

        return true;
    }
1338526
public static function isTaken(?array $data = [])
  {
    if (count($data) == 1) {
      foreach($data as $field => $value) {
        return self::where($field, $value)->first() == null ? false: true;
      }
    }

    $response = array();
    foreach($data as $field => $value) {
      $check = self::where($field, $value)->first();

      $response = array_merge($response, array($field => $check == null ? false : true));
    }

    return $response;
  }
803351
protected function resolveBody(array $post = [])
    {
        $rest = [];

        if (in_array($this->method(), ['OPTIONS', 'HEAD', 'PUT', 'DELETE', 'TRACE'])) {
            parse_str($this->raw, $rest);
        }

        return array_merge($post, $rest);
    }
308010
protected function processPayload(Array $payload)
	{
		// verify the payload
		if (isset($payload['security']) and isset($payload['data']) and isset($payload['flash']))
		{
			if (( ! $this->config['match_ip'] or $payload['security']['ip'] === $_SERVER['REMOTE_ADDR']) and
				( ! $this->config['match_ua'] or $payload['security']['ua'] === $_SERVER['HTTP_USER_AGENT']) and
				($payload['security']['ex'] == 0 or $payload['security']['ex'] >= time()) and
				$payload['security']['id'] == $this->sessionId)
			{
				// restore the session id
				$this->setSessionId($payload['security']['id']);

				// restore the last session id rotation timer
				$this->manager->setRotationTimer($payload['security']['rt']);

				// and store the data
				$this->data->setContents($payload['data']);
				$this->flash->setContents($payload['flash']);

				return true;
			}
		}

		return false;
	}
1254044
public static function simplePayload(array $payload) : array
    {
        $payload = array_filter($payload, function ($val) {
            if ($val instanceof PayloadInterface) {
                $val = $val->getPayload();
            }

            // this will effectively remove empty arrays
            if (is_array($val) && empty($val)) {
                return false;
            }

            if (is_null($val)) {
                return false;
            }

            if ($val === '') {
                return false;
            }

            return true;
        });

        foreach ($payload as $key => $val) {
            if (is_array($val)) {
                $payload[$key] = static::simplePayload($val);
            } elseif ($val instanceof PayloadInterface) {
                $payload[$key] = static::simplePayload($val->getPayload());
            }
        }

        return $payload;
    }