src/Mobileka/ScopeApplicator/ScopeApplicator.php
public function applyScopes($dataProvider, array $allowedScopes = [])
    {
        // Validate getInputManager() implementation
        if (!$this->validateInputManager()) {
            throw new BadInputManagerException;
        }

        // If there are no allowed scopes, just return the $dataProvider
        if ($allowedScopes) {
            $configurator = $this->getConfigurator($allowedScopes);
            $scopes = $configurator->prepareScopes();

            foreach ($scopes as $scope => $config) {
                $scopeArguments = $configurator->parseScopeArguments($config);

                // If null, we have to ignore this scope
                if (!is_null($scopeArguments)) {
                    try {
                        $dataProvider = call_user_func_array([$dataProvider, $scope], $scopeArguments);
                    } catch (ErrorException $e) {
                        $this->getLogger()->log($e);
                        throw $e;
                    }
                }
            }
        }

        return $dataProvider;
    }
public function applyScopes($dataProvider, array $allowedScopes = [])
    {
        // Validate getInputManager() implementation
        if (!$this->validateInputManager()) {
            throw new BadInputManagerException;
        }

        // If there are no allowed scopes, just return the $dataProvider
        if ($allowedScopes) {
            $configurator = $this->getConfigurator($allowedScopes);
            $scopes = $configurator->prepareScopes();

            foreach ($scopes as $scope => $config) {
                $scopeArguments = $configurator->parseScopeArguments($config);

                // If null, we have to ignore this scope
                if (!is_null($scopeArguments)) {
                    try {
                        $dataProvider = call_user_func_array([$dataProvider, $scope], $scopeArguments);
                    } catch (ErrorException $e) {
                        $this->getLogger()->log($e);
                        throw $e;
                    }
                }
            }
        }

        return $dataProvider;
    }
Apply scopes

@param  mixed $dataProvider
@param  array $allowedScopes
@throws \ErrorException
@throws \Mobileka\ScopeApplicator\BadInputManagerException
@return mixed