Check if the provided scope exists in storage.

@param string $scope - A space-separated string of scopes.
@return bool         - TRUE if it exists, FALSE otherwise.
485378
public function scopeExists($scope)
    {
        // Check reserved scopes first.
        $scope = explode(' ', trim($scope));
        $reservedScope = $this->getReservedScopes();
        $nonReservedScopes = array_diff($scope, $reservedScope);
        if (count($nonReservedScopes) == 0) {
            return true;
        } else {
            // Check the storage for non-reserved scopes.
            $nonReservedScopes = implode(' ', $nonReservedScopes);

            return $this->storage->scopeExists($nonReservedScopes);
        }
    }
88021
public function hasScope($scopes)
  {
    if (is_string($scopes)) {
      if (in_array($scopes, $this->sessionScopes)) {
        return true;
      }
      return false;
    } elseif (is_array($scopes)) {
      foreach ($scopes as $scope) {
        if ( ! in_array($scope, $this->sessionScopes)) {
          return false;
        }
      }
      return true;
    }

    return false;
  }
1100698
public function setScope($scope)
  {
      if (!is_array($scope)) {
          $this->scopes = explode(' ', $scope);
      } else {
          $this->scopes = $scope;
      }

      return $this;
  }
790930
public function setScope($scope)
    {
        if (!in_array($scope, self::SCOPE)) {
            throw new LdapQueryException(sprintf(
                'Scope type "%s" is invalid. See the QueryOperation::SCOPE[] constant for valid types.', $scope
            ));
        }
        $this->properties['scope'] = $scope;

        return $this;
    }
896510
private function validateScopeValue($scope)
    {
        switch ($scope) {
            case self::SCOPE_ACT_AS_USER:
            case self::SCOPE_ADMIN:
            case self::SCOPE_NONE:
            case self::SCOPE_READ:
            case self::SCOPE_WRITE:
            case self::SCOPE_DELETE:
            case self::SCOPE_JIRA_PROJECT_ADMIN:
            case self::SCOPE_CONFLUENCE_SPACE_ADMIN:
                return true;
        }
        throw new \InvalidArgumentException(sprintf("Unknown scope %s", $scope));
    }
863809
public function isScope($scope, $key)
    {
        return isset($this->data[$scope][$key]) && $this->data[$scope][$key];
    }
641826
public function exists($view)
	{
		try
		{
			$this->finder->find($view);
		}
		catch (\InvalidArgumentException $e)
		{
			return false;
		}

		return true;
	}
613328
public function has($path)
    {
        $chunks = $this->splitPath($path);
        $scope  = $this->data;

        while (null !== ($sub = array_shift($chunks))) {
            if (isset($scope[$sub])) {
                $scope = $scope[$sub];
            } else {
                return false;
            }
        }

        return true;
    }
93214
function scope($scope) {
        $styles  = (array) Arr::get($this->scopes, $scope . '.css', []);
        $scripts = (array) Arr::get($this->scopes, $scope . '.js', []);
        foreach($styles as $style) {
            $this->css($style);
        }
        foreach($scripts as $script) {
            $this->js($script);
        }
        
        return $this;
    }
1056217
public function setScope($scope)
    {
        $this->scope = is_array($scope) ? $scope : explode(static::$scopeDelimiter, $scope);

        return $this;
    }
296156
public function hasStatistics($scope, $key = null)
    {
        return isset($key) ? isset($this->statistics[$scope][$key]) : isset($this->statistics[$scope]);
    }
263826
public function checkScope($scope)
  {
      if ($this->OAuthResponse) {
          return $this->OAuthResponse->hasScope($scope);
      }

      return in_array($scope, $this->getScope());
  }
1239507
public function all($scope = null)
    {
        if ($scope === null) {
            return array_values($this->messages);
        }

        $messages = array();
        foreach ($this->messages as $message) {
            if ($message['scope'] === $scope) {
                $messages[] = $message;
            }
        }

        return $messages;
    }
1183733
public function delete($key, $scope = null)
    {
        if ($scope === null) {
            $scope = $this->getScope();
        }

        return $this->getContainer()->delete($key, $scope);
    }
1090102
public function getClassNamesByScope($scope)
    {
        if (!isset($this->cachedClassNamesByScope[$scope])) {
            foreach ($this->objects as $objectName => $information) {
                if ($information['s'] === $scope) {
                    if (isset($information['c'])) {
                        $this->cachedClassNamesByScope[$scope][] = $information['c'];
                    } else {
                        $this->cachedClassNamesByScope[$scope][] = $objectName;
                    }
                }
            }
        }
        return $this->cachedClassNamesByScope[$scope];
    }
566674
public function scope(Scope $scope)
    {
        $callable = $scope->getQuery();

        if (is_string($callable)) {
            /*
             * Adds a Class "ClassName::class" syntax.
             *
             * @note In this case Query class should implement Contracts\Module\Queryable interface.
             * @example: (new Scope('name'))->setQuery(Queryable::class);
             */
            if (class_exists($callable)) {
                $object = app($callable);

                if (!method_exists($object, 'query')) {
                    throw new \Terranet\Administrator\Exception(
                        sprintf(
                            'Query object %s should implement %s interface',
                            get_class($object),
                            \Terranet\Administrator\Contracts\Module\Queryable::class
                        )
                    );
                }

                $this->query = $object->query($this->query);

                return $this;
            }

            /*
             * Allows "SomeClass@method" syntax.
             *
             * @example: (new Scope('name'))->addQuery("User@active")
             */
            if (str_contains($callable, '@')) {
                list($object, $method) = explode('@', $callable);

                $this->query = app($object)->$method($this->query);

                return $this;
            }
        }

        /*
         * Allows adding a \Closure as a query;
         *
         * @example: (new Scope('name'))->setQuery(function($query) { return $this->modify(); })
         */
        if ($callable instanceof Closure) {
            $this->query = $callable($this->query);

            return $this;
        }

        /*
         * Accepts callable builder
         *
         * @example: (new Scope('name'))->setQuery([SomeClass::class, "queryMethod"]);
         */
        if (is_callable($callable)) {
            list($object, $method) = $callable;

            if (is_string($object)) {
                $object = app($object);
            }

            // Call Model Scope immediately when detected.
            //
            // @note: We don't use call_user_func_array() here
            // because of missing columns in returned query.
            $this->query = with(
                $this->model->is($object) ? $this->query : $object
            )->{$method}($this->query);
        }

        return $this;
    }
423322
public function scope($scope)
    {
        $beforeMethod = 'before'.ucfirst($scope);
        $afterMethod  = 'after'.ucfirst($scope);
        if ( method_exists($this, $beforeMethod) )
        {
            call_user_func([$this,$beforeMethod]);
        }
        $this->rules = $this->resolveScope($scope);
        $this->attributes = $this->resolveAttributes($scope);
        $this->messages = $this->resolveMessages($scope);


        if ( method_exists($this, $afterMethod) )
        {
            call_user_func([$this,$afterMethod]);
        }

        return $this;
    }