locr-company/progress

A class for handling progress

1.1.3 2024-11-22 11:14 UTC

This package is auto-updated.

Last update: 2024-12-25 21:10:04 UTC


README

php codecov Mutation testing badge github_workflow_status Quality Gate Status github_tag packagist

1. Installation

composer require locr-company/progress

2. How to use

<?php

use Locr\Lib\Progress;

$progress = new Progress(totalCount: 1_000);
$progress->incrementCounter();
print $progress->Counter; // 1
print $progress->PercentageCompleted; // 0.1
print $progress->toFormattedString(); // progress => 1/1000 (0.10%); elapsed: 00:00:01; ete: 00:16:39; eta: 2021-10-10 20:00:01
$progress->setCounter(1000);
print $progress->PercentageCompleted; // 100

3. Development

Clone the repository

git clone git@github.com:locr-company/php-progress.git
cd php-progress && composer install

4. Publish a new version

# update CHANGELOG.md file

git tag -a <major>.<minor>.<patch> -m 'version <major>.<minor>.<patch>'
git push
git push origin --tags