Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39c495f

Browse files
committed
[Console] deprecated TableHelper in favor of Table
1 parent 554b28d commit 39c495f

File tree

6 files changed

+1034
-276
lines changed

6 files changed

+1034
-276
lines changed

UPGRADE-3.0.md

+36
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,42 @@ UPGRADE FROM 2.x to 3.0
4848
}
4949
```
5050

51+
* `TableHelper` has been removed in favor of `Table`.
52+
53+
Before:
54+
55+
```
56+
$table = $app->getHelperSet()->get('table');
57+
$table
58+
->setHeaders(array('ISBN', 'Title', 'Author'))
59+
->setRows(array(
60+
array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
61+
array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'),
62+
array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'),
63+
array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
64+
))
65+
;
66+
$table->render($output);
67+
```
68+
69+
After:
70+
71+
```
72+
use Symfony\Component\Console\Helper\Table;
73+
74+
$table = new Table($output);
75+
$table
76+
->setHeaders(array('ISBN', 'Title', 'Author'))
77+
->setRows(array(
78+
array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
79+
array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'),
80+
array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'),
81+
array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
82+
))
83+
;
84+
$table->render();
85+
```
86+
5187
### EventDispatcher
5288

5389
* The interface `Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface`

src/Symfony/Component/Console/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CHANGELOG
44
2.5.0
55
-----
66

7+
* deprecated TableHelper in favor of Table
78
* deprecated ProgressHelper in favor of ProgressBar
89
* added a way to set a default command instead of `ListCommand`
910
* added a way to set the process name of a command

0 commit comments

Comments
 (0)