@param string $interface
@param string $name
@param array  $actions

@return Descriptor|DescriptorInterface
761913
public function implement($interface, $name, $actions = null)
    {
        return $this->describe($interface, null, $actions, null, $name);
    }
796997
public static function make($actions)
    {
        $instance = new static();

        if (array_key_exists(
            'whenInsert',
            $actions
        )) {
            $instance->setWhenInsert(ActionEntry::make($actions['whenInsert']));
        }

        if (array_key_exists(
            'whenUpdate',
            $actions
        )) {
            $instance->setWhenUpdate(ActionEntry::make($actions['whenUpdate']));
        }

        if (array_key_exists(
            'whenDelete',
            $actions
        )) {
            $instance->setWhenDelete(ActionEntry::make($actions['whenDelete']));
        }

        return $instance;
    }
876220
public function getActionToBePerformed($names = [], Event $contextEvent = null)
    {
        $result = null;
        if (empty($names)) {
            $actionsToCheck = $this->getRequiredActions();
        } else {
            $actionsToCheck = [];
            foreach ($names as $name) {
                $actionsToCheck[] = $this->getRequiredAction($name);
            }
        }
        /** @var  RequiredActionInterface $requiredAction */
        foreach ($actionsToCheck as $requiredAction) {
            if ($requiredAction->mustBeExecuted($contextEvent)) {
                $result = $requiredAction;
                break;
            }
        }
        return $result;
    }
199521
public function getNewActionEvent(string $name = null, $target = null, $params = null): ActionEvent
    {
        if ($name === null) {
            $name = 'action_event';
        }

        return new DefaultActionEvent($name, $target, $params);
    }
328086
public function removeInterface($interface) {
		if ($interface instanceof PhpInterface) {
			$name = $interface->getName();
			$qname = $interface->getQualifiedName();

			$this->removeUseStatement($qname);
		} else {
			$name = $interface;
		}

		$this->interfaces->remove($name);

		return $this;
	}
402077
public function setAction($name, Closure $action) {
    if (!array_key_exists($name, $this->actions)) {
      throw new \InvalidArgumentException($name.' ist keine bekannte action: '.implode(',',array_keys($this->actions)));
    }
    
    $this->actions[$name] = $action;
    return $this;
  }
1034348
public function getInterface(string $name)
    {
        if ($this->hasInterface($name)) {
            return $this->interfaces[$name];
        }
        return null;
    }
46591
protected function createServiceFile($name, $with_interface)
    {
        $dir_option = rtrim(str_replace('/', '\\', $this->getDirOption()), '/\\');
        $dir_option = $dir_option ? '\\' . $dir_option : '';
        $classname = $this->configureName('service', $name);

        if($with_interface === true) {
            $interface = trim($this->option('interface'));
            $interface = $this->configureName('repository', $interface ?: $name);

            $stub = str_replace(
                ['{{Namespace}}', '{{BaseServiceAbstractDirectory}}', '{{InterfaceDirectory}}', '{{InterfaceName}}', '{{ClassName}}'],
                [$this->getServiceDirectoryFromConfig() . $dir_option, $this->getServiceDirectoryFromConfig(),
                $this->getRepositoryDirectoryFromConfig() . $dir_option, $interface, $classname],
                $this->files->get($this->getServiceImplementsInterfaceStub())
            );
        } else {
            $stub = str_replace(
                ['{{Namespace}}', '{{BaseServiceAbstractDirectory}}', '{{ClassName}}'],
                [$this->getServiceDirectoryFromConfig() . $dir_option, $this->getServiceDirectoryFromConfig(), $classname],
                $this->files->get($this->getServiceStub())
            );
        }

        $this->files->put(base_path() . '/' . $this->getServiceDirectory() . $this->getDirOption() . $classname . '.php', $stub);
    }
504801
public function createState(string $name, array $state = null): StateInterface
    {
        $state = Maybe::unit($state);
        $state_implementor = $this->resolveStateImplementor($state);
        $settings = $state->settings->get() ?? [];
        $settings['_output'] = $state->output->get() ?? [];
        $state_instance = new $state_implementor(
            $name,
            new Settings($settings),
            $this->createValidator($name, $state),
            $this->expression_engine
        );
        if ($state->final->get() && !$state_instance->isFinal()) {
            throw new ConfigError("Trying to provide custom state that isn't final but marked as final in config.");
        }
        if ($state->initial->get() && !$state_instance->isInitial()) {
            throw new ConfigError("Trying to provide custom state that isn't initial but marked as initial in config.");
        }
        if ($state->interactive->get() && !$state_instance->isInteractive()) {
            throw new ConfigError(
                "Trying to provide custom state that isn't interactive but marked as interactive in config."
            );
        }
        return $state_instance;
    }
930718
public function removeInterface(string $name)
    {
        foreach ($this->interfaces as $index => $interface) {
            if ($interface === $name) {
                unset($this->interfaces[$index]);
                break;
            }
        }

        return $this;
    }
479998
protected function resolveAction($name)
    {
        if (isset($this->actions[$name])) {
            return $this->factory->make($this->actions[$name]);
        }

        throw new \InvalidArgumentException("Named action '$name' could not be found.");
    }
435397
final protected function FilterMethods(string $interface, array $methods) : array
    {
        /**
        * @var array<class-string, string[]>
        */
        $filteredMethods = $this->FilterNonZeroArray(array_map(
            [$this, 'FilterArrayOfInterfacesOrClasses'],
            array_filter(
                array_filter($methods, 'is_string', ARRAY_FILTER_USE_KEY),
                $this->MakeMethodFilter($interface),
                ARRAY_FILTER_USE_KEY
            )
        ));

        return $filteredMethods;
    }
798337
protected function getInterface($name) {
    if (isset($this->requiredInterfaces[$name])) {
      return $this->requiredInterfaces[$name];
    }
    return null;
  }
512576
protected function setResourceCreate($name, $controller, $action, $options = [])
    {
        return $this->mapResource('post', $name, $controller, 'post' . ucfirst($action));
    }
1006415
public function removeType($name): Endpoint
    {
        if ($this->hasType($name)) {
            $type = $this->getType($name);
            if ($type instanceof InterfaceDefinition) {
                unset($this->interfaces[$type->getName()]);
            }
        }

        unset($this->types[$name]);
        if (isset($this->typeMap[$name])) {
            unset($this->typeMap[$name]);
        }

        return $this;
    }
874054
public function toScene(string $name, $id): SceneInterface
    {
        $role = $this->getCurrentRole();
        $to = $this->getScene($name, $id);

        $newRole = $role->entry($to);

        if (!$role->equals($newRole)) {
            $this->currentRole = $newRole;
        }

        return $to;
    }
663117
private function describeComponents($components, $name, OutputInterface $output, $depth = 0)
    {
        if (is_array($components)) {
            $output->writeln(sprintf('%s<comment>%s</comment>', str_repeat(' ', $depth), $name));

            foreach ($components as $component) {
                $output->writeln(sprintf(
                    '%s%s',
                    str_repeat(' ', $depth + 4),
                    is_object($component) ? get_class($component) : get_class($component[0])
                ));
            }
        }
    }