Skip to content

Commit 4e76aa3

Browse files
committed
[Console] added ProgressBar (to replace the stateful ProgressHelper class)
1 parent 65c9aca commit 4e76aa3

File tree

6 files changed

+752
-3
lines changed

6 files changed

+752
-3
lines changed

UPGRADE-3.0.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,31 @@ UPGRADE FROM 2.x to 3.0
2323
* The methods `isQuiet`, `isVerbose`, `isVeryVerbose` and `isDebug` were added
2424
to `Symfony\Component\Console\Output\OutputInterface`.
2525

26+
* `ProgressHelper` has been removed in favor of `ProgressBar`.
27+
28+
Before:
29+
30+
```
31+
$h = new ProgressHelper();
32+
$h->start($output, 10);
33+
for ($i = 1; $i < 5; $i++) {
34+
usleep(200000);
35+
$h->advance();
36+
}
37+
$h->finish();
38+
```
39+
40+
After:
41+
42+
```
43+
$bar = new ProgressBar($output, 10);
44+
$bar->start();
45+
for ($i = 1; $i < 5; $i++) {
46+
usleep(200000);
47+
$bar->advance();
48+
}
49+
```
50+
2651
### EventDispatcher
2752

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

src/Symfony/Component/Console/CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ CHANGELOG
44
2.5.0
55
-----
66

7-
* added a way to set a default command instead of `ListCommand`
8-
* added a way to set the process name of a command
7+
* deprecated ProgressHelper in favor of ProgressBar
8+
* added a way to set a default command instead of `ListCommand`
9+
* added a way to set the process name of a command
910

1011
2.4.0
1112
-----

src/Symfony/Component/Console/Helper/Helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function getHelperSet()
4747
*
4848
* @return integer The length of the string
4949
*/
50-
protected function strlen($string)
50+
public static function strlen($string)
5151
{
5252
if (!function_exists('mb_strlen')) {
5353
return strlen($string);

0 commit comments

Comments
 (0)