Gets the rules factory

@param IContainer $container The IoC container
@return RulesFactory The rules factory
327250
protected function getRulesFactory(IContainer $container) : RulesFactory
    {
        return new RulesFactory(
            $this->ruleExtensionRegistry,
            $this->errorTemplateRegistry,
            $this->errorTemplateCompiler
        );
    }
664640
public function validator(Factory $factory)
    {
        if (!$this->shouldBeValidated()) {
            return $factory->make([], []);
        }
        
        $rules = app()->call([$this, 'rules']);

        return $factory->make(
            $this->all(), $rules, $this->messages(), $this->attributes()
        );
    }
1271447
public function container(string $containerClass = Container::class): ContainerInterface
    {
        if (($source = $this->getDefinitionSource()) instanceof MutableDefinitionSource) {
            return new $containerClass($source, $this->getProxyFactory(), $this->getWrapperContainer());
        }
        return $source;
    }
109410
protected static function ctxGetContainer(ContextInterface $context): ContainerInterface
    {
        assert(static::ctxHasContainer($context));

        return $context->get(ContextProperties::CTX_CONTAINER);
    }
687893
public function getFilterForRule(Rule $rule)
    {
        $filterIdentifier = $rule->getFilter();

        if ($this->container === null || !$this->container->has($filterIdentifier)) {
            return parent::getFilterForRule($rule);
        }

        return $this->container->get($filterIdentifier);
    }
316965
public static function getUnboundContainerInstance() : Container
    {
        $builder = new ContainerBuilder();
        $builder->useAnnotations(true);
        $builder->useAutowiring(true);
        $builder->addDefinitions(__DIR__ . '/../../../../config/phpdi/phpdi.php');
        return $builder->build();
    }
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;
    }
39003
public function provideBusinessLayerDependencies(Container $container): Container
    {
        $container = parent::provideBusinessLayerDependencies($container);

        $container[static::SERVICE_COMPUTOP_API] = function () use ($container) {
            return $container->getLocator()->computopApi()->service();
        };

        $container[static::FACADE_STORE] = function () use ($container) {
            return new ComputopApiToStoreFacadeBridge($container->getLocator()->store()->facade());
        };

        return $container;
    }
870342
private function createResolverFactories($config, ContainerBuilder $container)
    {
        if (null !== $this->factories) {
            return $this->factories;
        }

        // load bundled adapter factories
        $tempContainer = new ContainerBuilder();
        $parameterBag  = $container->getParameterBag();
        $loader        = new XmlFileLoader($tempContainer, new FileLocator(__DIR__.'/../Resources/config'));

        $loader->load('resolver_factories.xml');

        // load user-created adapter factories
        foreach ($config['factories'] as $factory) {
            $loader->load($parameterBag->resolveValue($factory));
        }

        $services  = $tempContainer->findTaggedServiceIds('gaufrette.resolver.factory');
        $factories = array();
        foreach (array_keys($services) as $id) {
            $factory = $tempContainer->get($id);
            $factories[str_replace('-', '_', $factory->getKey())] = $factory;
        }

        return $this->factories = $factories;
    }
749984
public function get(Container $container)
    {
        if ($this->scope === null) {
            $this->scope = $this->getDefaultScope();
        }

        return $this->scope->get($this, $container);
    }
1029428
protected static function defaultCreateDataParser(
        ContainerInterface $container,
        string $rulesClass
    ): JsonApiDataParserInterface {
        static::assertClassImplements($rulesClass, JsonApiDataRulesInterface::class);

        /** @var JsonApiParserFactoryInterface $factory */
        $factory = $container->get(JsonApiParserFactoryInterface::class);
        $parser  = $factory->createDataParser($rulesClass);

        return $parser;
    }
994685
private function getConfigFromContainer(ContainerInterface $container)
    {
        if (! $container->has('config')) {
            return [];
        }

        $config = $container->get('config');

        if (! isset($config['zf-mvc-auth']['authorization'])) {
            return [];
        }

        return $config['zf-mvc-auth']['authorization'];
    }
1140187
public function provideBusinessLayerDependencies(Container $container): Container
    {
        $container = parent::provideBusinessLayerDependencies($container);
        $container = $this->addBrandTransferExpanderPlugins($container);

        return $container;
    }
876294
private function getRuleFactory(string $name): callable
    {
        if (array_key_exists($name, $this->factories)) {

            return $this->factories[$name];

        }

        throw new RuleFactoryNotDefinedException($name);
    }
1343745
protected function getAuthority(IContainer $container) : IAuthority
    {
        $permissionRegistry = $this->getPermissionRegistry($container);
        $container->bindInstance(IPermissionRegistry::class, $permissionRegistry);
        $container->bindInstance(IRoles::class, $this->getRoles($container));

        return new Authority(-1, [], $permissionRegistry);
    }
707345
public function provideServiceLayerDependencies(Container $container)
    {
        $container[self::SERVICE_ZED] = function (Container $container) {
            return $container->getLocator()->zedRequest()->client();
        };

        $container[self::SERVICE_UTIL_ENCODING] = function (Container $container) {
            return $container->getLocator()->utilEncoding()->service();
        };

        return $container;
    }
22020
protected function getContainerLoader(ContainerInterface $container)
    {
        $locator = new FileLocator($this);
        $resolver = new LoaderResolver([
            new XmlFileLoader($container, $locator),
            new YamlFileLoader($container, $locator),
            new IniFileLoader($container, $locator),
            new PhpFileLoader($container, $locator),
            new DirectoryLoader($container, $locator),
            new ClosureLoader($container),
        ]);

        return new DelegatingLoader($resolver);
    }