borderless() public static method

A borderless style.
public static borderless ( ) : GridStyle
return GridStyle The style.
コード例 #1
0
ファイル: LsCommandHandler.php プロジェクト: rejinka/cli
 /**
  * Prints the resources in the short style (without the "-l" option).
  *
  * @param IO                 $io        The I/O.
  * @param ResourceCollection $resources The resources.
  */
 private function listShort(IO $io, ResourceCollection $resources)
 {
     $style = GridStyle::borderless();
     $style->getBorderStyle()->setLineVCChar('  ');
     $grid = new Grid($style);
     foreach ($resources as $resource) {
         $grid->addCell($this->formatName($resource));
     }
     $grid->render($io);
 }
コード例 #2
0
ファイル: GridTest.php プロジェクト: webmozart/console
    public function testRenderNoBorder()
    {
        $grid = new Grid(GridStyle::borderless());
        $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
                                                              Cities
Charles Dickens 960-425-059-0   The Lord of the J. R. R.      80-902734-1-6
                                Rings           Tolkien
And Then There  Agatha Christie
Were None

EOF;
        $this->assertSame($expected, $this->io->fetchOutput());
    }
コード例 #3
0
ファイル: Grid.php プロジェクト: webmozart/console
 /**
  * Creates a new grid.
  *
  * @param GridStyle $style The rendering style. By default, the grid is
  *                         rendered with the style
  *                         {@link GridStyle::borderless()}.
  */
 public function __construct(GridStyle $style = null)
 {
     $this->style = $style ?: GridStyle::borderless();
 }