@param string $scope

@return mixed
163687
public function getScopeType($scope = 'public')
    {
        switch ($scope) {
            case 'public':
                $type = \ReflectionMethod::IS_PUBLIC;
                break;
            case 'protected':
                $type = \ReflectionMethod::IS_PROTECTED;
                break;
            case 'private':
                $type = \ReflectionMethod::IS_PRIVATE;
                break;
        }

        return $type;
    }
1151337
protected function _properties($key, $scope) {
        return $this->cache($key, function() use ($scope) {
            $props = [];

            foreach ($this->reflection()->getProperties($scope) as $prop) {
                $props[] = $prop->getName();
            }

            return $props;
        });
    }
1113815
private function createCreateForm(Scope $scope)
    {
        $form = $this->createForm(new ScopeType(), $scope, array(
            'action' => $this->generateUrl('admin_scope_create'),
            'method' => 'POST',
        ));

        $form->add('submit', 'submit', array('label' => 'Create'));

        return $form;
    }
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;
    }
836167
public function getLimitedWebPartManager($scope)
    {
        $manager = new LimitedWebPartManager($this->getContext(),
            new ResourcePathServiceOperation($this->getContext(),
                $this->getResourcePath(),
                "getlimitedwebpartmanager",
                array($scope)
            ));
        return $manager;
    }
676439
public function newQueryWithoutScope($scope)
    {
        $this->getGlobalScope($scope)->remove($builder = $this->newQuery(), $this);

        return $builder;
    }
1048843
public function transform(Scope $scope)
    {
        $resource = $scope->resource();
        
        // When we encounter a null resource, we just return null because
        // there's nothing else we can do with it.
        if ($resource === null) {
            return null;
        }
        
        // If the resource is not a ResourceInterface instance we allow it to be
        // something array-like.
        if (!($resource instanceof ResourceInterface)) {
            if (\is_array($resource)) {
                return $resource;
            }
            if (\is_object($resource) && method_exists($resource, 'toArray')) {
                return $resource->toArray();
            }

            throw new UnhandledResourceType('Unable to serialize resource of type ' . \gettype($resource));
        }

        // Try to resolve a transformer for a resource that does not have one
        // assigned.
        if (!$resource->hasTransformer()) {
            $transformer = $this->resolveTransformerForResource($resource);
            $resource->setTransformer($transformer);
        }

        // Call the relationship loader for any relations
        $this->loadRelations($resource, $scope->resolvedRelationshipKeys());

        // We can only transform the resource data if we have some data to
        // transform ...
        if (($data = $resource->getData()) !== null) {
            // Build the data by recursively transforming each resource.
            if ($resource instanceof Collection) {
                $data = [];
                foreach ($resource as $itemData) {
                    $data[] = $this->transformData($scope, $itemData);
                }
            } elseif ($resource instanceof Item) {
                $data = $this->transformData($scope, $data);
            }
        }

        // Serialize the transformed data
        return $this->serialize($resource, $data);
    }
478503
public function &refScopeStatistic($scope)
    {
        if(!isset($this->statistics[$scope])) $this->statistics[$scope] = [];
        return $this->statistics[$scope];
    }
770573
public function getScope($key)
    {
        $scope = ('application' === $key) ? 'APPLICATION_CONFIG' : 'BUNDLE_CONFIG';

        if ($this->application->getContainer()->has('config.configurator')) {
            $scope = $this
                    ->application
                    ->getContainer()
                    ->get('config.configurator')
                    ->getRegistryScope($scope, $this->persistPerContext, $this->persistPerEnvironment)
            ;
        }

        return $scope;
    }
897947
public function getCurrentScope()
    {
        $key = request(Scope::QUERY_NAME);

        return $this->scopes->first(function ($scope) use ($key) {
            return $scope->key == $key;
        });
    }
79807
public function removeScope($scope)
    {
        $this->validateScopeValue($scope);

        $key = $this->getScopeKey($scope);
        if (false === $key) {
            return $this;
        }

        unset($this->descriptor['scopes'][$key]);
        return $this;
    }
351193
private function figureOutWhichIncludes(Scope $scope)
    {
        $includes = $this->getDefaultIncludes();

        foreach ($this->getAvailableIncludes() as $include) {
            if ($scope->isRequested($include)) {
                $includes[] = $include;
            }
        }

        foreach ($includes as $include) {
            if ($scope->isExcluded($include)) {
                $includes = array_diff($includes, [$include]);
            }
        }

        return $includes;
    }
145840
public function retrieveTokenRequest(array $scope = array()) {
    $parameters = array(
      'oauth_callback' => $this->getCallbackUrl()
    );

    $requestUrl = self::_URL_REQUEST;

    if (!empty($scope)) {
        $requestUrl .= '?scope=' . implode('+', $scope);
    }

    $response = $this->fetch(self::_METHOD_TOKENS, $requestUrl, NULL, $parameters);
    parse_str($response['linkedin'], $response['linkedin']);
    
    /**
	   * Check for successful request (a 200 response from LinkedIn server) 
	   * per the documentation linked in method comments above.
	   */
    if(($response['info']['http_code'] == 200) && (array_key_exists('oauth_callback_confirmed', $response['linkedin'])) && ($response['linkedin']['oauth_callback_confirmed'] == 'true')) {
      // tokens retrieved
      $this->setToken($response['linkedin']);
      
      // set the response
      $return_data            = $response;
      $return_data['success'] = TRUE;        
    } else {
      // error getting the request tokens
      $this->setToken(NULL);
      
      // set the response
      $return_data = $response;
      if((array_key_exists('oauth_callback_confirmed', $response['linkedin'])) && ($response['linkedin']['oauth_callback_confirmed'] == 'true')) {
        $return_data['error'] = 'HTTP response from LinkedIn end-point was not code 200';
      } else {
        $return_data['error'] = 'OAuth callback URL was not confirmed by the LinkedIn end-point';
      }
      $return_data['success'] = FALSE;
    }
    return $return_data;
	}
284476
public function isValidScope($scope)
    {
        $reflectionClass = new \ReflectionClass(get_class($this));

        return in_array($scope, $reflectionClass->getConstants(), true);
    }
345435
public function fetch($scope = null)
    {
        $messages = $this->all($scope);
        $this->clear($scope);

        return $messages;
    }
1163761
public function addScope($scope)
  {
      if (!is_array($scope)) {
          $scope = explode(' ', $scope);
      }

      $this->scopes = array_unique(array_merge($this->scopes, $scope));

      return $this;
  }
320402
public function withoutGlobalScope($scope)
    {
        if (! is_string($scope)) {
            $scope = get_class($scope);
        }

        unset($this->scopes[$scope]);

        $this->removedScopes[] = $scope;

        return $this;
    }