public function getEnvironmentLabel(Environment $environment, $tag = 'info')
    {
        $id = $environment->id;
        $title = $environment->title;
        $use_title = strlen($title) > 0 && $title !== $id;
        $pattern = $use_title ? '%2$s (%3$s)' : '%3$s';
        if ($tag !== false) {
            $pattern = $use_title ? '<%1$s>%2$s</%1$s> (%3$s)' : '<%1$s>%3$s</%1$s>';
        }

        return sprintf($pattern, $tag, $title, $id);
    }
public function getEnvironmentLabel(Environment $environment, $tag = 'info')
    {
        $id = $environment->id;
        $title = $environment->title;
        $use_title = strlen($title) > 0 && $title !== $id;
        $pattern = $use_title ? '%2$s (%3$s)' : '%3$s';
        if ($tag !== false) {
            $pattern = $use_title ? '<%1$s>%2$s</%1$s> (%3$s)' : '<%1$s>%3$s</%1$s>';
        }

        return sprintf($pattern, $tag, $title, $id);
    }
public function getEnvironmentLabel ( Environment $ environment , $ tag = 'info' ) { $ id = $ environment -> id ; $ title = $ environment -> title ; $ use_title = strlen ( $ title ) > 0 && $ title !== $ id ; $ pattern = $ use_title ? '%2$s (%3$s)' : '%3$s' ; if ( $ tag !== false ) { $ pattern = $ use_title ? '<%1$s>%2$s</%1$s> (%3$s)' : '<%1$s>%3$s</%1$s>' ; } return sprintf ( $ pattern , $ tag , $ title , $ id ) ; }
Returns an environment label.

@param Environment  $environment
@param string|false $tag

@return string
Returns an environment label .