Merge pull request #31 from WinterSilence/patch-2

Remove redundand code in `Progress`
This commit is contained in:
simialbi 2022-01-03 08:58:09 +01:00 committed by GitHub
commit 3e9be2ecec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -166,15 +166,15 @@ class Progress extends Widget
} }
/** /**
* Generates a bar * Generates a progress bar.
* @param int $percent the percentage of the bar * @param int $percent the percentage of the bar
* @param string $label , optional, the label to display at the bar * @param string $label optional, the label to display at the bar
* @param array $options the HTML attributes of the bar * @param array $options the HTML attributes of the bar
* @return string the rendering result. * @return string the rendering result.
*/ */
protected function renderBar(int $percent, string $label = '', array $options = []): string protected function renderBar(int $percent, string $label = '', array $options = []): string
{ {
$percent = (float)trim(rtrim((string)$percent, '%'));
$options = array_merge($options, [ $options = array_merge($options, [
'role' => 'progressbar', 'role' => 'progressbar',
'aria' => [ 'aria' => [