@param null|string $name of the action event
@param string|object $target of the action event
@param null|array|\ArrayAccess $params with which the event is initialized

@return ActionEvent that can be triggered by the ActionEventEmitter
199521
public function getNewActionEvent(string $name = null, $target = null, $params = null): ActionEvent
    {
        if ($name === null) {
            $name = 'action_event';
        }

        return new DefaultActionEvent($name, $target, $params);
    }
995872
protected function getSymfonyFormFromParams($params, $name, $throwException = false)
    {
        $sfForm = $this->getParam($params, $name);

        if (null === $sfForm && false === $throwException) {
            return null;
        }

        if (!$sfForm instanceof SymfonyForm) {
            throw new \InvalidArgumentException(
                sprintf(
                    "%s parameter must be an instance of " .
                    "\Symfony\Component\Form\Form, instance of %s found",
                    $name,
                    is_object($sfForm) ? get_class($sfForm) : gettype($sfForm)
                )
            );
        }

        return $sfForm;
    }
1089765
public function controller($controller_name)
    {
        // Retrieving the class and method to launch.
        if (is_null($controller_name)) {
            return null;
        }

        $parts = preg_split('/::|@/', $controller_name);

        if (count($parts) == 1) {
            $parts[1] = '__invoke';
        }

        list($class, $method) = $parts;

        if (!class_exists($class, true)) {
            $class = sprintf('%s\\%s', $this->namespaces['controller'], ucfirst($class));
        }

        $injections = $this->injector($class, $method);

        return [
            'action' => [new $class(), $method],
            'injection' => $injections
        ];
    }
758118
protected function resolveMethod(string $name, \ReflectionClass $target)
    {
        $class = ClassGenerator::from($target->getName());

        $hasMethod = false;

        foreach ($class->getMethods() as $method) {
            if ($method->getName() === $name) {
                $hasMethod = true;
                break;
            }
        }

        if ($hasMethod === true) {
            return $class->getMethod($name);
        }

        $parentClass = $target->getParentClass();

        if ($parentClass === false) {
            return null;
        }

        return $this->resolveMethod($name, $parentClass);
    }
686272
public static function __callstatic($name, $params)
    {
        if (!in_array($name, static::getKnownBorders())) {
            throw new Exception("Unknown border function name $name");
        }

        // target string is expected to be:
        $targetString = $params[0][0];
        $functionName = '__' . $name;

        return static::$functionName($targetString);
    }
1214998
public function registerEvent(string $name, ?string $table = null, \Closure $action): void
    {
        $this->connection->getEventHandler()->registerEvent($name, $table, $action);
    }
505119
protected function loadCollector($name, array $params = null) {
		$locator = $this->getCollectorsLocator();
		
		try {
			return $locator->get(ucfirst($name), $params);
		} catch (Exception $exception) {
			$this->pushException($exception);
		}
	}
761651
public function trigger( $eventName, $event = null )
    {
        if ( null === $event )
        {
            $event = new SeedEvent( $this );
        }

        return EventManager::trigger( $eventName, $event );
    }
616687
function setTarget($target)
    {
        if (!$target instanceof aSapi)
            throw new \InvalidArgumentException(sprintf(
                'Application Target Must Instanceof aSapi; given: (%s).'
                , \Poirot\Std\flatten($target)
            ));

        parent::setTarget($target);
        return $this;
    }
172935
public function addTarget(Target $target, string $name = null)
    {
        if ($name === null) {
            $this->_targets[] = $target;
        } else {
            $this->_targets[$name] = $target;
        }
    }
642858
public function moveTo(string $target): ?string
    {
        $ret = $this->handle->rpoplpush($this->name, $target);
        return (false === $ret) ? null : $ret;
    }
348956
public static function get($name = null, $target = '')
    {
        if (!func_num_args()) {
            return static::$_matchers;
        }
        if ($target === true) {
            return isset(static::$_matchers[$name]) ? static::$_matchers[$name] : [];
        }
        if ($target === '') {
            if (isset(static::$_matchers[$name][''])) {
                return static::$_matchers[$name][''];
            }
            throw new Exception("Unexisting default matcher attached to `'{$name}'`.");
        }
        if (isset(static::$_matchers[$name][$target])) {
            return static::$_matchers[$name][$target];
        } elseif (isset(static::$_matchers[$name][''])) {
            return static::$_matchers[$name][''];
        }
        throw new Exception("Unexisting matcher attached to `'{$name}'` for `{$target}`.");
    }
797851
public function process_action($target, $action) {
        return self::do_process_action($target, $action, $this->course->id);
    }
157620
public function addOrReplaceTarget($targetName, &$target)
    {
        $this->log("  +Target: $targetName", Project::MSG_DEBUG);
        $target->setProject($this);
        $this->targets[$targetName] = $target;

        $ctx = $this->getReference(ProjectConfigurator::PARSING_CONTEXT_REFERENCE);
        $current = $ctx->getCurrentTargets();
        $current[$targetName] = $target;
    }
399035
public function targetSerialize($target = self::SER_DEFAULT, $params = null)
    {
        return $this->format($this->format);
    }
706173
public static function __callstatic($name, $params)
    {
        if (!in_array($name, static::getDisplayableStructures())) {
            throw new Exception("Unknown structure function name $name");
        }

        // target string is expected to be:
        $target       = $params[0][0];
        $functionName = '__' . $name;

        return static::$functionName($target);
    }
267864
public function trigger($event, $params = array()) {
        $eventObject = is_object($event) ? $event : new GenericEvent($event, $params);
        foreach ($this->getListeners($eventObject) as $callback) {
            if (is_array($callback) && count($callback) == 2) {
                list($key, $function) = $callback;
                if (is_string($key) && !class_exists($key) && $this->getServiceManager()->has($key)) {
                    $service = $this->getServiceManager()->get($key);
                    $callback = [$service, $function];
                }
            }
            call_user_func($callback, $eventObject);
        }
    }