Webmozart\Console\UI\Style\GridStyle::solidBorder PHP Méthode

solidBorder() public static méthode

A style that uses Unicode characters for drawing solid borders.
public static solidBorder ( ) : GridStyle
Résultat GridStyle The style.
    public static function solidBorder()
    {
        if (!self::$solidBorder) {
            self::$solidBorder = new static();
            self::$solidBorder->cellFormat = ' %s ';
            self::$solidBorder->borderStyle = BorderStyle::solid();
        }
        return clone self::$solidBorder;
    }

Usage Example

Exemple #1
0
    public function testRenderSolidBorder()
    {
        $grid = new Grid(GridStyle::solidBorder());
        $grid->addCells(array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri', '9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens', '960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien', '80-902734-1-6', 'And Then There Were None', 'Agatha Christie'));
        $grid->render($this->io);
        $expected = <<<'EOF'
┌──────────────────┬─────────────────┬─────────────────────┬─────────────────┐
│ 99921-58-10-7    │ Divine Comedy   │ Dante Alighieri     │ 9971-5-0210-0   │
├──────────────────┼─────────────────┼─────────────────────┼─────────────────┤
│ A Tale of Two    │ Charles Dickens │ 960-425-059-0       │ The Lord of the │
│ Cities           │                 │                     │ Rings           │
├──────────────────┼─────────────────┼─────────────────────┼─────────────────┤
│ J. R. R. Tolkien │ 80-902734-1-6   │ And Then There Were │ Agatha Christie │
│                  │                 │ None                │                 │
└──────────────────┴─────────────────┴─────────────────────┴─────────────────┘

EOF;
        $this->assertSame($expected, $this->io->fetchOutput());
    }