feature #35611 [Console] Moved estimated & remaining calculation logic to separate get method (peterjaap)
feature #35611 [Console] Moved estimated & remaining calculation logic to separate get method (peterjaap)

This PR was squashed before being merged into the 5.1-dev branch.

Discussion
----------

[Console] Moved estimated & remaining calculation logic to separate get method

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT

This way, we can use `getEstimated()`and `getRemaining()` to get easy access to the estimated / remaining number of seconds to be used in our placeholder definition set with `setPlaceholderFormatterDefinition` without having to redefine the calculation ourself.

Example before;

```php
ProgressBar::setPlaceholderFormatterDefinition(
    'eta',
    function (ProgressBar $progressBar) {
        $estimated = round((time() - $progressBar->getStartTime()) / ($progressBar->getProgress() ?: 0.1) * $progressBar->getMaxSteps());
        return date('H:i:s', strtotime('+' . $estimated . ' seconds'));
    }
);
```

Example after;

```php
ProgressBar::setPlaceholderFormatterDefinition(
    'eta',
    function (ProgressBar $progressBar) {
        return date('H:i:s', strtotime('+' . $this->getEstimated() . ' seconds'));
    }
);
```

Commits
-------

19958fba5a [Console] Moved estimated & remaining calculation logic to separate get method

symfony/Console