@param string $name

@return \MetaborStd\Statemachine\StateInterface
511975
protected function findOrCreateState($name)
    {
        $name = $this->stateNamePrefix . $name;
        if ($this->targetCollection->hasState($name)) {
            $targetState = $this->targetCollection->getState($name);
        } else {
            $targetState = $this->createState($name);
            $this->addState($targetState);
        }

        return $targetState;
    }
930718
public function removeInterface(string $name)
    {
        foreach ($this->interfaces as $index => $interface) {
            if ($interface === $name) {
                unset($this->interfaces[$index]);
                break;
            }
        }

        return $this;
    }
554739
public static function missing(string $name): self
    {
        $e = sprintf(parent::MISSING, $name);

        return new static($e);
    }
244552
public function getScenarioState($name)
    {
        if (!isset($this->scenarios[$name])) {
            $this->scenarios[$name] = self::INITIAL_SCENARIO;
        }

        return $this->scenarios[$name];
    }
227125
public function getController(string $name = '')
    {
        if (empty($name)) {
            $name = $this->getComponentsName();
        }

        $controller = $this->MVCFactory($name, 'Controller');

        return $controller;
    }
854362
protected static function getProperty(string $name)
    {
        $prop = (new ReflectionClass(Builder::class))->getProperty($name);

        $prop->setAccessible(true);

        return $prop;
    }
534237
public function get($name, $default = null)
    {
        return array_key_exists($name, $this->_states) ? $this->_states[$name] : $default;
    }
1046730
public function getFilter($name)
    {
        $filter = $this->getCompiler()->getFilter($name);
        if (is_string($filter) && !function_exists($filter) && class_exists($filter)) {
            $filter = new $filter();
        }

        return $filter;
    }
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()
        );
    }
640953
public function build(): StateMachineInterface
    {
        $states = new StateSet($this->states->values()->toArray());
        $transitions = new TransitionSet($this->transitions->values()->toArray());
        return new $this->state_machine_class($this->state_machine_name, $states, $transitions);
    }
497175
public function plugin(string $name): \TheCMSThread\Classes\Plugin
    {
        return $this->plugins->get($name);
    }
1128638
public function getContainer($name)
    {
        // try to match one of the container names with the passed name
        /** @var \AppserverIo\Psr\ApplicationServer\Configuration\ContainerConfigurationInterface $container */
        foreach ($this->getContainers() as $container) {
            if (fnmatch($name, $container->getName())) {
                return $container;
            }
        }
    }
1190066
public function getMailbox(string $name): MailboxInterface
    {
        if (false === $this->hasMailbox($name)) {
            throw new MailboxDoesNotExistException(\sprintf('Mailbox name "%s" does not exist', $name));
        }

        return new Mailbox($this->resource, $name, $this->mailboxNames[$name]);
    }
496060
public function enable($name)
    {
        if (! $this->has($name)) {
            throw new InvalidArgumentException("Filter '" . $name . "' does not exist.");
        }

        if (! $this->isEnabled($name)) {
            $filterClass = $this->config->getFilterClassName($name);

            $this->enabledFilters[$name] = new $filterClass($this->em);

            // Keep the enabled filters sorted for the hash
            ksort($this->enabledFilters);

            // Now the filter collection is dirty
            $this->filtersState = self::FILTERS_STATE_DIRTY;
        }

        return $this->enabledFilters[$name];
    }
962266
public function load($name)
    {
        $helper = $this->getRegisteredHelper($name);

        $reflection = new \ReflectionClass($helper);
        $class = $reflection->newInstance($this->di);

        return $class;
    }
366951
public function createElement($name)
    {
        $elementClass = $this->classNameResolver->resolveElement($name);

        return $this->instantiateElement($elementClass);
    }
1292421
public function retrieveState($name = null)
    {
        $key = $this->generateKey(self::STATE_KEY);
        $state = self::storage()->get($key, []);
        if ($name !== null) {
            return isset($state[$name]) ? $state[$name] : null;
        }

        return $state;
    }