Create a throttling repository.

@return \Cartalyst\Sentinel\Throttling\IlluminateThrottleRepository
760791
protected function createThrottling()
    {
        $model = $this->config['throttling']['model'];

        foreach (['global', 'ip', 'user'] as $type) {
            ${"{$type}Interval"} = $this->config['throttling'][$type]['interval'];

            ${"{$type}Thresholds"} = $this->config['throttling'][$type]['thresholds'];
        }

        return new IlluminateThrottleRepository(
            $model,
            $globalInterval,
            $globalThresholds,
            $ipInterval,
            $ipThresholds,
            $userInterval,
            $userThresholds
        );
    }
512468
public function throttle()
    {
        if ((time() - $this->lastCpuCheck) >= $this->cpuCheckFrequency) {
            $load = sys_getloadavg();
            
            if ($load[0]/$this->cpuCount >= $this->cpuTarget) {
                $this->pause += $this->throttleSensitivity;
                $this->controller->notify('Daemon throttling down');
            } else {
                $this->pause -= $this->throttleSensitivity;
                $this->controller->notify('Daemon throttling up');
            }

            $this->lastCpuCheck = time();
        }

        // Never allow pause to dip below 1 microsecond
        if ($this->pause < 1) {
            $this->pause = 1;
        }

        return $this->pause;
    }
651206
public function makeEmptyCopy(): self
    {
        $query = $this->constructEmptyCopy();
        $query->setClosureResolver($this->closureResolver);
        return $query;
    }
453317
protected function getRepositoryUrlCache()
    {
        $repositoryUrlCache = $this->getSession()->get(SessionParameter::REPOSITORY_URL_CACHE);
        if ($repositoryUrlCache === null) {
            $repositoryUrlCache = new RepositoryUrlCache();
            $this->getSession()->put(SessionParameter::REPOSITORY_URL_CACHE, $repositoryUrlCache);
        }

        return $repositoryUrlCache;
    }
384676
protected function createDispatcher()
    {
        return $this->dispatcher ?: \FastRoute\simpleDispatcher(function ($r) {
            foreach ($this->router->getRoutes() as $route) {
                $r->addRoute($route['method'], $route['uri'], $route['action']);
            }
        });
    }
1041222
public function build(): SetFocusEmulationEnabledRequest
	{
		$instance = new SetFocusEmulationEnabledRequest();
		if ($this->enabled === null) {
			throw new BuilderException('Property [enabled] is required.');
		}
		$instance->enabled = $this->enabled;
		return $instance;
	}
873309
public function build(): SetAsyncCallStackDepthRequest
	{
		$instance = new SetAsyncCallStackDepthRequest();
		if ($this->maxDepth === null) {
			throw new BuilderException('Property [maxDepth] is required.');
		}
		$instance->maxDepth = $this->maxDepth;
		return $instance;
	}
302370
public function make()
    {
        if (is_lumen()) {
            return new \Laravel\Lumen\Http\ResponseFactory();
        }

        return app(\Illuminate\Contracts\Routing\ResponseFactory::class);
    }
839704
public function create()
    {
        $this->assertPathIsSet();
        $this->assertNotExists();
        $this->doCreate();
        $this->setPermissions();

        return $this;
    }
1027007
protected function registerRateLimiting()
    {
        $this->app->singleton('api.limiting', function ($app) {
            return new DingoRateLimitHandler($app, $app['cache'], prepare_config_instances(config('nodes.api.throttling')));
        });
    }
885892
protected function createRedisStore()
    {
        $serverArray    = $this->config['servers'];
        $persistent     = boolval($this->config['persistent']);
        $prefix         = trim($this->config['prefix']);

        if ($persistent) {
            foreach ($serverArray as $k => $v) {
                $v['persistent']    = true;
                $serverArray[$k]    = $v;
            }
        }

        $redisServer    = new RedisServer($serverArray);
        return new RedisStore($redisServer, $prefix);
    }
355223
public function build(): SimulatePressureNotificationRequest
	{
		$instance = new SimulatePressureNotificationRequest();
		if ($this->level === null) {
			throw new BuilderException('Property [level] is required.');
		}
		$instance->level = $this->level;
		return $instance;
	}
298359
protected function createPersistence()
    {
        $session = $this->createSession();

        $cookie = $this->createCookie();

        $model = $this->config['persistences']['model'];

        $single = $this->config['persistences']['single'];

        return new IlluminatePersistenceRepository($session, $cookie, $model, $single);
    }
1194083
public static function create()
    {
        return parent::create()
            ->setSerializationContextFactory(array(self::class, 'createDefaultSerializationContext'))
            ->addDefaultHandlers()
            ->configureListeners(function (EventDispatcher $dispatcher) {
                $proxySubscriber = new DoctrineProxySubscriber(false);
                $dispatcher->addSubscriber($proxySubscriber);
            })
            ->configureHandlers(function (HandlerRegistryInterface $handlerRegistry) {
                $proxyHandler = new DoctrineProxyHandler();
                $handlerRegistry->registerSubscribingHandler($proxyHandler);
            })
        ;
    }
972474
public function createCore()
    {
        $config = new MemoryConfigCollection();

        // Set default middleware
        $config->setMiddlewares([
            new InheritanceMiddleware(Config::UNINHERITED),
            new ExtensionMiddleware(Config::EXCLUDE_EXTRA_SOURCES),
        ]);

        // Transform
        $config->transform([
            $this->buildStaticTransformer(),
            $this->buildYamlTransformer()
        ]);

        return $config;
    }
512453
public function getRepository()
    {
        $repository = MigrationsRepository::getInstance()
            ->setCommand($this)
            ->setIo($this->io);

        $repository['path'] = $this->console->get('migration.dir') ?: $this->console->get('path.migrations');

        return $repository;
    }
1297457
protected function getContainerBuilder(): ContainerBuilder
    {
        $container = new ContainerBuilder();
        $container->getParameterBag()->add($this->getKernelParameters());

        if (class_exists('ProxyManager\Configuration') && class_exists('Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator')) {
            $container->setProxyInstantiator(new RuntimeInstantiator());
        }

        return $container;
    }