Вход Регистрация
Файл: vendor/laravel/framework/src/Illuminate/Console/View/Components/Line.php
Строк: 65
<?php

namespace IlluminateConsoleViewComponents;

use 
IlluminateConsoleContractsNewLineAware;
use 
SymfonyComponentConsoleOutputOutputInterface;

class 
Line extends Component
{
    
/**
     * The possible line styles.
     *
     * @var array<string, array<string, string>>
     */
    
protected static $styles = [
        
'info' => [
            
'bgColor' => 'blue',
            
'fgColor' => 'white',
            
'title' => 'info',
        ],
        
'warn' => [
            
'bgColor' => 'yellow',
            
'fgColor' => 'black',
            
'title' => 'warn',
        ],
        
'error' => [
            
'bgColor' => 'red',
            
'fgColor' => 'white',
            
'title' => 'error',
        ],
    ];

    
/**
     * Renders the component using the given arguments.
     *
     * @param  string  $style
     * @param  string  $string
     * @param  int  $verbosity
     * @return void
     */
    
public function render($style$string$verbosity OutputInterface::VERBOSITY_NORMAL)
    {
        
$string $this->mutate($string, [
            
MutatorsEnsureDynamicContentIsHighlighted::class,
            
MutatorsEnsurePunctuation::class,
            
MutatorsEnsureRelativePaths::class,
        ]);

        
$this->renderView('line'array_merge(static::$styles[$style], [
            
'marginTop' => ($this->output instanceof NewLineAware && $this->output->newLineWritten()) ? 1,
            
'content' => $string,
        ]), 
$verbosity);
    }
}
Онлайн: 1
Реклама