Executing methods prolog, getResult and epilog included traits

@param string $type prolog, getResult or epilog
179406
private function executeTraits($type)
    {
        if (empty($this->usedTraits))
        {
            return;
        }

        switch ($type)
        {
            case 'prolog':
                $type = 'Prolog';
            break;

            case 'main':
                $type = 'Main';
            break;

            default:
                $type = 'Epilog';
            break;
        }

        foreach ($this->usedTraits as $trait => $name)
        {
            $method = 'execute'.$type.$name;

            if (method_exists($trait, $method))
            {
                $this->$method();
            }
        }
    }
674925
private function resolveTypes($type)
    {
        $actionTypes = [];

        do {
            $actionTypes[] = $actionType = $this->actionRegistry[$type];
        } while (($type = $actionType->getParent()) !== null);

        return $actionTypes;
    }
807912
public function syncPackages($type)
    {
        $criteria      = ['type' => $type];
        $em            = $this->getDoctrineHelper()->getEntityManager();
        $searchResults = $this->getHelper()->getPackages($criteria);

        foreach ($searchResults as $result) {
            $package = $this->getHelper()->getPackage($result);
            $this->syncPackage($package);
        }
        
        $em->flush();
    }
960445
protected function invokeAction($type = self::MASTER_REQUEST)
    {
        $this->dispatch('frontcontroller.request');

        $request = $this->getRequest();
        $controllerResolver = $this->getApplication()->getContainer()->get('controller_resolver');
        $controller = $controllerResolver->getController($request);

        // logout Event dispatch
        if (
            null !== $request->get('logout')
            && true === $request->get('logout')
            && true === $this->getApplication()->getSecurityContext()->isGranted('IS_AUTHENTICATED_FULLY')
        ) {
            $this->dispatch('frontcontroller.request.logout');
        }

        if (null !== $controller) {
            $dispatcher = $this->application->getEventDispatcher();

            // dispatch kernel.controller event
            $event = new FilterControllerEvent($this, $controller, $request, $type);
            $dispatcher->dispatch(KernelEvents::CONTROLLER, $event);

            // a listener could have changed the controller
            $controller = $event->getController();

            $eventName = $this->getControllerActionEventName($controller[0], $request->attributes->get('_action'));
            $dispatcher->dispatch($eventName.'.precall', new Event\PreRequestEvent($request));

            // get controller action arguments
            $actionArguments = $controllerResolver->getArguments($request, $controller);

            $response = call_user_func_array($controller, $actionArguments);
            if (!($response instanceof Response)) {
                $this->application->warning(sprintf(
                    'Action %s from controller %s should return an object Response, got %s.',
                    $request->attributes->get('_action'),
                    get_class($controller[0]),
                    gettype($response)
                ));

                $response = new Response();
            }
            $dispatcher->dispatch($eventName.'.postcall', new Event\PostResponseEvent($response, $request));

            return $response;
        } else {
            throw new FrontControllerException(
                sprintf('Unknown action `%s`.', $request->attributes->get('_action')),
                FrontControllerException::BAD_REQUEST
            );
        }
    }
915233
public function removeType(string $type)
    {
        if (!$this->removing && Type::hasType($type)) {
            $this->removing = true;
            Type::overrideType($type, null);
        }

        $this->removing = false;
        unset($this->types[$type]);
    }
15428
protected function typeToPDOParamType($type)
    {
        switch ($type) {
        case "boolean":
            return PDO::PARAM_BOOL;
        case "integer":
            return PDO::PARAM_STR;
        case "NULL":
            return PDO::PARAM_NULL;
        case "resource":
            return PDO::PARAM_LOB;
        case "double":
        case "string":
        default:
            return PDO::PARAM_STR;
        }
    }
408747
public static function getExecMethod(string $type) : string
    {
        $valid = ['php' => 'executePhpAction', 'cli' => 'executeCliAction'];

        if (!isset($valid[$type])) {
            throw new RuntimeException('invalid action type: ' . $type);
        }
        return $valid[$type];
    }
927921
public function fetchAll($type = self::FETCH_TYPE_NUM)
    {
        if ($this->_allFetched) {
            return $this->buffer;
        }
        $results = $this->statement->fetchAll($type);
        if ($results !== false) {
            $this->buffer = array_merge($this->buffer, $results);
        }
        $this->_allFetched = true;
        $this->statement->closeCursor();

        return $this->buffer;
    }
824799
public function setLogType($type)
    {
        if (empty($type)) {
            $type = 'log';
        }

        $this->log_type = $type;
        $this->function = 'console.' . $this->log_type;
    }
300014
public function run($type = 'all')
    {
        $cleanDivision = false;
        $this->stdout("clean {$type}:\n", Console::FG_GREEN);
        switch ($type) {
            case 'all':
                foreach ($this->ipv4->getQueries() as $name => $query) {
                    if (DatabaseQuery::is_a($query)) {
                        $cleanDivision = true;
                    }
                    $this->clean($query, $name);
                }
                break;
            case 'file':
                foreach ($this->ipv4->getQueries() as $name => $query) {
                    if (FileQuery::is_a($query)) {
                        $this->clean($query, $name);
                    }
                }
                break;
            case 'database':
                foreach ($this->ipv4->getQueries() as $name => $query) {
                    if (DatabaseQuery::is_a($query)) {
                        $cleanDivision = true;
                        $this->clean($query, $name);
                    }
                }
                break;
            default:
                $this->stderr("Unknown type \"{$type}\".", Console::FG_GREY, Console::BG_RED);
                break;
        }
        if ($cleanDivision) {
            $this->cleanDivision();
        }
    }
36267
public function fetch($type = parent::FETCH_TYPE_NUM)
    {
        $callback = $this->_callback;
        $row = $this->_statement->fetch($type);

        return $row === false ? $row : $callback($row);
    }
835145
public function setType($type)
    {
        foreach ($this->results as $name) {
            $this->columns->offsetGet($name)->setType($type);
        }

        return $this;
    }
533653
public function getPDOParamType($type)
	{
		switch($type)
		{
			case 'b':
				return PDO::PARAM_BOOL;
			case 'd':
				return PDO::PARAM_INT;
			case 'l':
				return PDO::PARAM_LOB;
			default:
				return PDO::PARAM_STR;
		}
	}
98031
public function addLogProcessor($type)
    {
        switch ($type) {
            case 'web':
                $this->pushProcessor(new WebProcessor());
                break;

            case 'intro':
            case 'introspection':
                $this->pushProcessor(new IntrospectionProcessor());
                break;

            default:
                throw new \Exception('Unknown Log Processor', 1);
                break;
        }
    }
1270148
public static function typeToEnglish($type)
    {
        switch ($type) {
            case self::EOF_TYPE:
                return 'end of template';
            case self::TEXT_TYPE:
                return 'text';
            case self::BLOCK_START_TYPE:
                return 'begin of statement block';
            case self::VAR_START_TYPE:
                return 'begin of print statement';
            case self::BLOCK_END_TYPE:
                return 'end of statement block';
            case self::VAR_END_TYPE:
                return 'end of print statement';
            case self::NAME_TYPE:
                return 'name';
            case self::NUMBER_TYPE:
                return 'number';
            case self::STRING_TYPE:
                return 'string';
            case self::OPERATOR_TYPE:
                return 'operator';
            case self::PUNCTUATION_TYPE:
                return 'punctuation';
            case self::INTERPOLATION_START_TYPE:
                return 'begin of string interpolation';
            case self::INTERPOLATION_END_TYPE:
                return 'end of string interpolation';
            default:
                throw new LogicException(sprintf('Token of type "%s" does not exist.', $type));
        }
    }
1140879
public function afterConsume(int $type): void
    {
        // Put in escaping mode if it were not escaping and there is a backslash token.
        if (! $this->currentlyEscaping && $type === AnnotationLexer::T_BACKSLASH) {
            $this->currentlyEscaping = true;
        } else {
            $this->currentlyEscaping = false;
        }
    }
1113961
public function withType(string $type): self
    {
        $metadata = clone $this;
        $metadata->type = $type;

        return $metadata;
    }