Get default rule provider from dependency injection container
or first instance of the Validate class.

@uses-dependency-container validate

@return RuleProviderInterface
160850
public function getRuleProviderDefault() : RuleProviderInterface
    {
        $container = Dependency::container();
        return $container->has('validate') ? $container->get('validate') : Validate::getInstance();
    }
735951
public static Provider getProvider() {
        Provider provider = cProvider.get();
        if (provider == null) {
            provider = getDefaultProvider();
            if (!cProvider.compareAndSet(null, provider)) {
                provider = cProvider.get();
            }
        }
        return provider;
    }
364623
public static function getProvider($classname) {
		if (array_key_exists($classname, self::$providers)) {
			return self::$providers[$classname];
		}
		
		$provider = new $classname;
		
		if (!($provider instanceof ServiceProviderInterface)) {
			throw new \InvalidArgumentException("$classname is not a valid ServiceProviderInterface instance");
		}

		self::$providers[$classname] = $provider;
		return self::$providers[$classname];
	}
306601
public function getInstance()
    {
        if ($this->isSingleton() && $this->hasInstance()) {
            return $this->instance;
        }

        // require path
        if ($this->path) {
            require_once $this->path;
        }

        // initialize
        if ($this->isClosure()) {
            $closure = $this->class;
            $instance = $closure($this->container);
        } else {
            $class = $this->class;
            if ($class[0] !== '\\') $class = '\\' . $class;
            $script = sprintf('$instance = new %s(%s);', $class, $this->array2ArgsWithInjectDependency('$this->args', $this->args));
            eval($script);
        }

        if ($this->isSingleton()) {
            $this->instance = $instance;
        }
        if ($this->container && method_exists($instance, 'setContainer')) {
            $instance->setContainer($this->container);
        }
        
        // inject dependency
        if ($this->container) {
            $this->container->injectDependency($instance);
        }
        
        // init method
        if ($this->hasInitMethod()) {
            $this->callInitMethod($instance);
        } elseif($this->hasInitializeMethod($instance)) {
            $instance->initialize();
        }

        return $instance;
    }
617547
public static function getCurrentProviderId()
    {
        try {
            $optionValue = Option::get(self::CURRENT_PROVIDER_OPTION_NAME);
        } catch (\Exception $e) {
            $optionValue = false;
        }
        return $optionValue === false ? DefaultProvider::ID : $optionValue;
    }
651778
public function getInstance(Constraint $constraint)
    {
        $name = $constraint->validatedBy();

        if (!isset($this->validators[$name])) {
            if ($this->container->has($name)) {
                $this->validators[$name] = $this->container->get($name);
            } else {
                if (!class_exists($name)) {
                    throw new ValidatorException(sprintf('Constraint validator "%s" does not exist or is not enabled. Check the "validatedBy" method in your constraint class "%s".', $name, \get_class($constraint)));
                }

                $this->validators[$name] = new $name();
            }
        }

        if (!$this->validators[$name] instanceof ConstraintValidatorInterface) {
            throw new UnexpectedTypeException($this->validators[$name], ConstraintValidatorInterface::class);
        }

        return $this->validators[$name];
    }
1223806
public function getDataProvidor() {
		$option = $this->options;
		$cfg    = isset($this->options['dsCfg']) ? $this->options['dsCfg'] : '';
		if (!is_array($cfg)) {
			$cfg = trim($cfg);
		}
		if (!isset($option['dataSource']) && is_string($cfg)) {
			$cfg1 = ltrim($cfg, ':');
			if (strlen($cfg) - strlen($cfg1) == 2) {
				return new FieldDataProvidor($this->form, $this, $cfg1);
			}

			return FieldDataProvidor::emptyDatasource();
		}

		$dsp = trim($option['dataSource'], '()\\');
		if ($dsp == 'json') {
			return new JsonDataProvidor($this->form, $this, $cfg);
		}

		if ($dsp == 'table') {
			return new TableDataProvidor($this->form, $this, $cfg);
		}

		if ($dsp == 'text') {
			return new LineDataProvidor($this->form, $this, $cfg);
		}

		if ($dsp == 'param' || $dsp == 'parse_str') {
			return new ParamDataProvidor($this->form, $this, $cfg);
		}

		if (!is_subclass_of($dsp, FieldDataProvidor::class)) {
			return FieldDataProvidor::emptyDatasource();
		}

		return new $dsp($this->form, $this, $cfg);
	}
400006
protected function getValidatorInstance()
    {
        $factory = $this->container->make(ValidationFactory::class);

        if (method_exists($this, 'validator')) {
            return $this->container->call(array($this, 'validator'), compact('factory'));
        }

        $rules = $this->container->call(array($this, 'rules'));

        return $factory->make($this->all(), $rules, $this->messages(), $this->attributes());
    }
1107446
private function getValidator()
    {
        if (null === $this->validator) {
            $hook = function ($uri) {
                return $this->uriToFile($uri);
            };

            $this->validator = SchemaValidator::buildDefault($hook);
        }

        return $this->validator;
    }
707936
public function getProvider($name)
    {
        if (!$this->has($name)) {
            throw new DependencyException(
                $name.' dependency not found.',
                1
            );
        }

        return $this->dependencies[$name];
    }
1028694
protected function getServiceList()
    {
        $name = $this->poolConfig->getName();
        if ($this->poolConfig->isUseProvider() && App::hasBean('providerSelector')) {
            $type = $this->poolConfig->getProvider();

            return provider()->select($type)->getServiceList($name);
        }

        $uri = $this->poolConfig->getUri();
        if (empty($uri)) {
            $error = sprintf('Service does not configure uri name=%s', $name);
            App::error($error);
            throw new \InvalidArgumentException($error);
        }

        return $uri;
    }
924652
public function getValidator() {
    if (!isset($this->validator)) {
      $this->validator = new ArgsValidator($this->arguments_spec, $this->parsed_args);
    }
    return $this->validator;
  }
512950
protected function configureContainerInternal()
	{
		$this->container->add(
			'instantiator',
			function () {
				return function ($name) {
					return $this->container->get($name);
				};
			}
		);

		$this->container->add(\Weave\Middleware\Middleware::class)
		->withArgument(\Weave\Middleware\MiddlewareAdaptorInterface::class)
		->withArgument(
			function ($pipelineName) {
				return $this->provideMiddlewarePipeline($pipelineName);
			}
		)
		->withArgument(\Weave\Resolve\ResolveAdaptorInterface::class)
		->withArgument(\Weave\Dispatch\DispatchAdaptorInterface::class)
		->withArgument(\Weave\Http\RequestFactoryInterface::class)
		->withArgument(\Weave\Http\ResponseFactoryInterface::class)
		->withArgument(\Weave\Http\ResponseEmitterInterface::class);

		$this->container->add(
			\Weave\Resolve\ResolveAdaptorInterface::class,
			\Weave\Resolve\Resolve::class
		)
		->withArgument('instantiator');

		$this->container->add(
			\Weave\Dispatch\DispatchAdaptorInterface::class,
			\Weave\Dispatch\Dispatch::class
		);

		$this->container->add(\Weave\Middleware\Dispatch::class)
		->withArgument(\Weave\Resolve\ResolveAdaptorInterface::class)
		->withArgument(\Weave\Dispatch\DispatchAdaptorInterface::class);

		$this->container->add(\Weave\Router\Router::class)
		->withArgument(\Weave\Router\RouterAdaptorInterface::class)
		->withArgument(
			function ($router) {
				return $this->provideRouteConfiguration($router);
			}
		)
		->withArgument(\Weave\Resolve\ResolveAdaptorInterface::class)
		->withArgument(\Weave\Dispatch\DispatchAdaptorInterface::class);
	}
1276033
public function getProvider() {
        if(!$this->provider) {
            $root_path = $this->getSetting('MAJ_CERT_ROOTDIR', 'certificates/');
            $this->provider = new CertificateFileProvider($root_path, Globals::getTree());
        }
        return $this->provider;
    }
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);
    }
550139
private function getProvider()
    {
        if ($this->app instanceof \Laravel\Lumen\Application) {
            $provider = '\Intervention\Image\ImageServiceProviderLumen';
        } elseif (version_compare(\Illuminate\Foundation\Application::VERSION, '5.0', '<')) {
            $provider = '\Intervention\Image\ImageServiceProviderLaravel4';
        } else {
            $provider = '\Intervention\Image\ImageServiceProviderLaravel5';
        }

        return new $provider($this->app);
    }
1318565
protected function initContainer()
    {
        $initNode = $this->getResolver()->getSectionId('', 'init');

        if ($this->getResolver()->has($initNode)) {
            $this->getFactory()->executeMethodBatch(
                $this->getResolver()->get($initNode)
            );
        }
        return $this;
    }