@param string $name
@param  Maybe $state

@return ValidatorInterface
166589
private function createValidator(string $name, Maybe $state): ValidatorInterface
    {
        return new Validator(
            $this->createValidationSchema(
                $name.self::SUFFIX_IN,
                $state->input_schema->get() ?? self::$default_validation_schema
            ),
            $this->createValidationSchema(
                $name.self::SUFFIX_OUT,
                $state->output_schema->get() ?? self::$default_validation_schema
            )
        );
    }
558677
public function createObjectState(
        ?ObjectStateCreateData $data = null,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: StringUtil::fqcnToBlockPrefix(ObjectStateCreateType::class);

        return $this->formFactory->createNamed(
            $name,
            ObjectStateCreateType::class,
            $data ?? new ObjectStateCreateData()
        );
    }
1225640
private function verifyState($state)
    {
        $this->logger->debug('Verify parameter state.');
        $state = urldecode($state);
        $stateArray = [];
        parse_str($state, $stateArray);
        $token = $stateArray['token'];
        $token = preg_replace('~{~', '', $token, 1);
        $token = preg_replace('~}~', '', $token, 1);
        
        if ($token != $this->session->get(static::OPENID_SESSION_TOKEN)) {
            $this->logger->error('The value of the parameter STATE is not equal to the one which is expected');
            throw new SecurityException("The token is invalid.");
        }
    }
774503
function (name, state) {
        if (!module.exports.operations.validateState || module.exports.operations.validateState(state)) {
            module.exports.config.states[name] = state;
        } else {
            log.error('Unable to update invalid state:', state, 'with name:', name);
        }
    }
1103907
public function createValidator(string $name): ValidatorInterface
    {
        if (isset($this->validators[$name])) {
            return $this->validators[$name];
        }

        if (($validator = $this->getValidatorDefine($name)) !== false) {
            if (Assert::string($validator)) {
                if (Assert::namespace($validator)) {
                    $namespace = $validator;
                } else {
                    $namespace = '\\One\\Validation\\Validators\\' . $validator;
                }

                $this->validators[$name] = Reflection::newInstance(
                    $namespace,
                    [ $this ]
                );

                unset($namespace);
            } elseif (Assert::array($validator)) {
                $this->validators[$name] = CustomValidator::createFromArray($this, $validator);
            } else {
                $this->validators[$name] = CustomValidator::createFromClosure($this, $validator);
            }

            return $this->validators[$name];
        }

        throw new ValidationException(sprintf('Validator "%s" not found', $name));
    }
90366
protected function ruleFactory(string $name, array $parameters): RuleInterface
	{
		return $this->container->get($this->getRuleClassName($name), $parameters);
	}
1059743
public function execute(State $state) {
        $errors = [];
        foreach ($state->functionLookup as $name => $functions) {
            $calls = $state->callFinder->getCallsForFunction($name);
            foreach ($functions as $func) {
                foreach ($calls as $call) {
                    $errors = array_merge($errors, $this->verifyCall($func, $call[0], $state, $name));
                }
            }
        }
        foreach ($state->internalTypeInfo->functions as $name => $arginfo) {
            $calls = $state->callFinder->getCallsForFunction($name);
            foreach ($calls as $call) {
                $errors = array_merge($errors, $this->verifyInternalCall($arginfo, $call[0], $state, $name));
            }
        }
        foreach ($state->methodCalls as $call) {
            if (!$call->name instanceof Operand\Literal) {
                // Variable method call
                continue;
            }
            if (!$call->var->type || $call->var->type->type !== Type::TYPE_OBJECT) {
                // We don't know the type
                continue;
            }
            $name = strtolower($call->var->type->userType);
            if (!isset($state->classResolves[$name])) {
                // Could not find class
                continue;
            }
            foreach ($state->classResolves[$name] as $cn => $class) {
                // For every possible class that can resolve the type
                $method = $this->findMethod($class, $name);
                if (!$method) {
                    // Class does not *directly* implement method
                    continue;
                }
                $errors = array_merge($errors, $this->verifyCall($method, $call, $state, $cn . "->" . $name));
            }
        }
        return $errors;
    }
516858
public function add($name): ValidatorChain
    {
        $this->validators[$name] = $this->validators[$name] ?? Validator::create();
        return $this->validators[$name];
    }
1178931
protected function setState($state)
    {
        if (!array_key_exists($state, $this->stateDirectives)) {
            throw new InvalidArgumentException("Invalid state {$state}");
        }
        $this->state = $state;
        return $this;
    }
534237
public function get($name, $default = null)
    {
        return array_key_exists($name, $this->_states) ? $this->_states[$name] : $default;
    }
354420
public function setState(State $state = null): AbstractTable
    {
        $this->current = new State($this->initial->getName());

        if (!empty($state)) {
            $this->current->setName($state->getName());
            $this->current->syncState($state);
        }

        return $this;
    }
1165596
public function validate($state)
    {
        $valid = $this->store->get(self::STATE_NAME) == $state;
        $this->store->delete(self::STATE_NAME);
        return $valid;
    }
1006088
public function get(string $name)
    {
        if (!isset(self::$namedStates[$name])) {
            throw new DomainException("Unknown state: $name");
        }
        return self::$namedStates[$name];
    }
217046
public function checkState($storeState, $state = null)
	{
		if(null === $state)
		{
			if(null === $this->state)
			{
				if(isset($_GET['state']))
				{
					$state = $_GET['state'];
				}
				else
				{
					$state = '';
				}
			}
			else
			{
				$state = $this->state;
			}
		}
		return $storeState === $state;
	}
1083115
public function execute(State $state) {
        $errors = [];
        foreach ($state->newCalls as $new) {
            $type = null;
            if ($new->class instanceof Operand\Literal) {
                $type = $new->class->value;
            } elseif ($new->class->type->type !== Type::TYPE_OBJECT) {
                $errors[] = ["Unknown class type for new call", $new];
                continue;
            } else {
                $type = $new->class->type->userType;
            }
            $name = strtolower($type);
            if (!isset($state->classResolves[$name])) {
                if (isset($state->internalTypeInfo->methods[$name])) {
                    // TODO
                } else {
                    $errors[] = ["Could not find class definition for $type", $new];
                }
                continue;
            }
            foreach ($state->classResolves[$name] as $sub => $class) {
                $constructor = $this->findConstructor($class);
                if ($constructor) {
                    // validate parameters!!!
                    $errors = array_merge($errors, $this->verifyCall($constructor, $new, $state, "{$class->name->value}::__construct"));
                }
            }
        }
        return $errors;
    }
1186781
public function stub(string $name, bool $isNewRule = true): StubVerifier
    {
        $key = strtolower($name);

        if (isset($this->state->stubs->$key)) {
            $stub = $this->state->stubs->$key;
        } else {
            $stub = $this->state->stubs->$key = $this->createStub($name);
        }

        if ($isNewRule) {
            $stub->closeRule();
        }

        return $stub;
    }
1043810
public function get($state) : State
    {
        $this->addCallback('GET', $state);
        if (!isset($this->actions['POST'])) {
            $this->addCallback('POST', $state);
        }
        return $this;
    }