for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/**
* File: ProgressBarRenderer.php
*
* @author Maciej Sławik <[email protected]>
* @copyright Copyright (C) 2019 Lizard Media (http://lizardmedia.pl)
*/
namespace LizardMedia\VarnishWarmer\Model\ProgressHandler;
use LizardMedia\VarnishWarmer\Api\ProgressHandler\ProgressBarRendererInterface;
use LizardMedia\VarnishWarmer\Api\ProgressHandler\ProgressDataInterface;
* Class ProgressBarRenderer
* @package LizardMedia\VarnishWarmer\Model\ProgressHandler
class ProgressBarRenderer implements ProgressBarRendererInterface
{
* @param ProgressDataInterface $progressData
* @return string
public function getProgressHtml(ProgressDataInterface $progressData): string
return $progressData->getCurrent()
? "{$progressData->getProcessType()} progress: "
. "<progress max=\"{$progressData->getTotal()}\" value=\"{$progressData->getCurrent()}\"></progress> "
. "({$progressData->getCurrent()}/{$progressData->getTotal()})"
: '';
}