Prints the current target name

@param BuildEvent $event
@see   BuildEvent::getTarget()
420821
public function targetStarted(BuildEvent $event)
    {
        if (Project::MSG_INFO <= $this->msgOutputLevel
            && $event->getTarget()->getName() != ''
        ) {
            $showLongTargets = $event->getProject()->getProperty("phing.showlongtargets");
            $msg = PHP_EOL . $event->getProject()->getName() . ' > ' . $event->getTarget()->getName() . ($showLongTargets ? ' [' . $event->getTarget()->getDescription() . ']' : '') . ':' . PHP_EOL;
            $this->printMessage($msg, $this->out, $event->getPriority());
        }
    }
1039330
public function trigger($event, $target = null, $params = null)
    {
        if (!$event instanceof Event) {
            $event = new Event($event, $target, $params);
        }

        if (false !== strpos($event->getName(), ':')) {
            $namespace = substr($event->getName(), 0, strpos($event->getName(), ':'));

            if (isset($this->listeners[$namespace])) {
                $this->fire($this->listeners[$namespace], $event);
            }
        }

        if (isset($this->listeners[$event->getName()])) {
            $this->fire($this->listeners[$event->getName()], $event);
        }

        return $event->getTarget();
    }
1002031
public function targetStarted(BuildEvent $event)
    {
        $target = $event->getTarget();

        $targetElement = $this->doc->createElement(XmlLogger::TARGET_TAG);
        $targetElement->setAttribute(XmlLogger::NAME_ATTR, $target->getName());

        $this->timesStack[] = Phing::currentTimeMillis();
        $this->elementStack[] = $targetElement;
    }
264626
private function findModelIdByPropertyName(BuildWidgetEvent $event)
    {
        if (null !== $event->getModel()->getId()) {
            return;
        }

        $environment    = $event->getEnvironment();
        $dataDefinition = $environment->getDataDefinition();
        $inputProvider  = $environment->getInputProvider();
        $sessionStorage = $environment->getSessionStorage();

        $session = $sessionStorage->get($dataDefinition->getName() . '.' . $inputProvider->getParameter('mode'));

        $model = null;
        foreach ($session['models'] as $sessionModel) {
            $model = $sessionModel;

            if (0 !== \strpos($event->getProperty()->getName(), \str_replace('::', '____', $sessionModel))) {
                continue;
            }

            break;
        }

        $modelId = ModelId::fromSerialized($model);

        $event->getModel()->setId($modelId->getId());
    }
852516
public function classNameForEvent($event): string
    {
        if ( ! isset($this->eventClasses[$event])) {
            throw new \InvalidArgumentException("Could not find a class for the event {$event}.");
        }
        return $this->eventClasses[$event];
    }
282033
public function onNameReply(Event $event)
    {
        $msg = $event->getMessage();
        $chan = $msg['params'][2];
        $names = explode(' ', $msg['params'][3]);

        foreach ($names as $nick) {
            $mode = self::REGULAR;
            $prefix = $nick[0];

            if (isset(self::$modesPrefix[$prefix])) {
                $mode |= self::$modesNum[self::$modesPrefix[$prefix]];
                $nick = substr($nick, 1);
            }

            $this->storage->setUserMode($nick, $chan, $mode);
        }
    }
871553
public function onBuildKernel(PreBuildKernelEvent $event): void
    {
        $injectedSettings = $this->configResolver->getParameter('injected_settings', 'netgen_site_legacy');
        $injectedMergeSettings = $this->configResolver->getParameter('injected_merge_settings', 'netgen_site_legacy');

        $formattedInjectedSettings = [];
        $formattedInjectedMergeSettings = [];

        foreach ($injectedSettings as $legacyIniName => $legacyIniConfig) {
            if (!is_array($legacyIniConfig) || empty($legacyIniConfig)) {
                continue;
            }

            foreach ($legacyIniConfig as $legacyIniValueName => $legacyIniValue) {
                if (!is_string($legacyIniValueName)) {
                    continue;
                }

                $formattedInjectedSettings[$legacyIniName . '/' . $legacyIniValueName] = $legacyIniValue;
            }
        }

        foreach ($injectedMergeSettings as $legacyIniName => $legacyIniConfig) {
            if (!is_array($legacyIniConfig) || empty($legacyIniConfig)) {
                continue;
            }

            foreach ($injectedMergeSettings[$legacyIniName] as $legacyIniValueName => $legacyIniValue) {
                if (!is_string($legacyIniValueName) || !is_array($legacyIniValue)) {
                    continue;
                }

                $formattedInjectedMergeSettings[$legacyIniName . '/' . $legacyIniValueName] = $legacyIniValue;
            }
        }

        $event->getParameters()->set(
            'injected-settings',
            $formattedInjectedSettings + (array) $event->getParameters()->get('injected-settings')
        );

        $event->getParameters()->set(
            'injected-merge-settings',
            $formattedInjectedMergeSettings + (array) $event->getParameters()->get('injected-merge-settings')
        );
    }
1249273
public function messageLogged(BuildEvent $event)
    {
        $priority = $event->getPriority();
        if ($priority <= $this->msgOutputLevel) {
            $msg = "";
            if ($event->getTask() !== null && !$this->emacsMode) {
                $name = $event->getTask();
                $name = $name->getTaskName();
                $msg = str_pad("[$name] ", self::LEFT_COLUMN_SIZE, " ", STR_PAD_LEFT);
            }

            $msg .= $event->getMessage();

            if ($priority != Project::MSG_ERR) {
                $this->printMessage($msg, $this->out, $priority);
            } else {
                $this->printMessage($msg, $this->err, $priority);
            }
        }
    }
127443
public function handle(UpdatedEvent $event)
    {
        if ($event->oldemail === $event->user->email) {
            $data = sprintf('**Verified:** _<%s>_', $event->user->email);
        } else {
            $data = implode("\n", [
                sprintf('**Updated:** _<%s>_', $event->user->email),
                sprintf('**Old:** _<%s>_', $event->oldemail),
            ]);
        }

        $this->track(Settings::TYPEID_UPDATED, $event->user->id, 25, $data);
    }
289409
protected String extractProjectName(final BuildEvent event) {
        final Project project = event.getProject();
        return (project != null) ? project.getName() : null;
    }
554133
public function printTargets($project)
    {
        // find the target with the longest name
        $maxLength = 0;
        $targets = $project->getTargets();
        $targetName = null;
        $targetDescription = null;
        $currentTarget = null;

        // split the targets in top-level and sub-targets depending
        // on the presence of a description

        $subNames = [];
        $topNameDescMap = [];

        foreach ($targets as $currentTarget) {
            $targetName = $currentTarget->getName();
            $targetDescription = $currentTarget->getDescription();
            if ($currentTarget->isHidden()) {
                continue;
            }

            // subtargets are targets w/o descriptions
            if ($targetDescription === null) {
                $subNames[] = $targetName;
            } else {
                // topNames and topDescriptions are handled later
                // here we store in hash map (for sorting purposes)
                $topNameDescMap[$targetName] = $targetDescription;
                if (strlen($targetName) > $maxLength) {
                    $maxLength = strlen($targetName);
                }
            }
        }

        // Sort the arrays
        sort($subNames); // sort array values, resetting keys (which are numeric)
        ksort($topNameDescMap); // sort the keys (targetName) keeping key=>val associations

        $topNames = array_keys($topNameDescMap);
        $topDescriptions = array_values($topNameDescMap);

        $defaultTarget = $project->getDefaultTarget();

        if ($defaultTarget !== null && $defaultTarget !== "") {
            $defaultName = [];
            $defaultDesc = [];
            $defaultName[] = $defaultTarget;

            $indexOfDefDesc = array_search($defaultTarget, $topNames, true);
            if ($indexOfDefDesc !== false && $indexOfDefDesc >= 0) {
                $defaultDesc = [];
                $defaultDesc[] = $topDescriptions[$indexOfDefDesc];
            }

            $this->_printTargets($defaultName, $defaultDesc, "Default target:", $maxLength);
        }
        $this->_printTargets($topNames, $topDescriptions, "Main targets:", $maxLength);
        $this->_printTargets($subNames, null, "Subtargets:", 0);
    }
1310723
private function fireEvent($event)
    {
        $env = $this->formatEventName($event);

        if (emitter()->bound($env)) {
            emitter()->emit($env, $this);
        }
    }
322002
private function printHeaderOnBeforeEvent(Formatter $formatter, ScenarioLikeTested $event, $eventName)
    {
        if ($this->beforeEventName !== $eventName || !$event instanceof AfterSetup) {
            return;
        }

        if ($this->setupPrinter) {
            $this->setupPrinter->printSetup($formatter, $event->getSetup());
        }

        $this->scenarioPrinter->printHeader($formatter, $event->getFeature(), $event->getScenario());
    }
873759
protected function getEventName($event)
    {
        if (Assert::instanceOf($event, '\\One\\Event\\Event')) {
            return $event->getName();
        } elseif (Assert::string($event)) {
            return $event;
        }

        throw new InvalidArgumentException(
            '`Event` must be `string` or extends class `One\Event\Event`'
        );
    }
911359
public function buildCommand(Event $event)
    {
        if ($event->runInBackground) {
            return $this->buildBackgroundCommand($event);
        }

        return $this->buildForegroundCommand($event);
    }
487838
protected function buildMessage($event)
    {
        $builder = new MessageBuilder();

        $builder->setUsername("Comment on PR");
        $builder->createAttachment()
            ->setColor('#C9C9C9')
            ->setText($event->comment->body)
            ->setTitle(
                "#%s %s by %s",
                $event->issue->number,
                $event->issue->title,
                $event->issue->user->login
            )
            ->setTitleLink($event->comment->html_url)
            ->setThumbUrl($event->comment->user->avatar_url)
            ->addField("Repository", $event->repository->full_name, true)
            ->addField("Comment by", $event->comment->user->login, true)
            ->attach();

        return $builder->getMessage();
    }
961667
public function buildStarted(BuildEvent $event)
    {
        $this->startTime = Phing::currentTimeMillis();
        if ($this->msgOutputLevel >= Project::MSG_INFO) {
            $this->printMessage(
                "Buildfile: " . $event->getProject()->getProperty("phing.file"),
                $this->out,
                Project::MSG_INFO
            );
        }
    }