Rename namespace to Tezmanian and prepare for Packagist
PHP Composer / build (push) Successful in 31s
PHP Composer / build (push) Successful in 31s
- Namespace Tez\Utils -> Tezmanian\Utils, package tez/* -> tezmanian/* - Add keywords, homepage, authors and support metadata - Drop VCS repositories (resolved via Packagist) - Remove stale composer.lock, set license holder
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2026 Development
|
Copyright (c) 2026 René Halberstadt
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||||
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
||||||
|
|||||||
@@ -1,13 +1,20 @@
|
|||||||
# tez-utils-num
|
# tez-utils-num
|
||||||
|
|
||||||
|
[](https://github.com/tezmanian/tez-utils-num/actions/workflows/php.yml)
|
||||||
|
[](https://packagist.org/packages/tezmanian/utils-num)
|
||||||
|
[](https://packagist.org/packages/tezmanian/utils-num)
|
||||||
|
[](LICENSE)
|
||||||
|
|
||||||
PHP number utilities: formatting, byte sizes, percentage, clamping, and rounding helpers (`Num`), plus arbitrary-precision decimal arithmetic via bcmath (`Bc`). PHP 8.3+, requires `ext-bcmath`.
|
PHP number utilities: formatting, byte sizes, percentage, clamping, and rounding helpers (`Num`), plus arbitrary-precision decimal arithmetic via bcmath (`Bc`). PHP 8.3+, requires `ext-bcmath`.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
composer require tez/utils-num
|
composer require tezmanian/utils-num
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Package: [`tezmanian/utils-num`](https://packagist.org/packages/tezmanian/utils-num) · Namespace: `Tezmanian\Utils\Num`
|
||||||
|
|
||||||
## Components
|
## Components
|
||||||
|
|
||||||
| Class | Purpose |
|
| Class | Purpose |
|
||||||
@@ -24,7 +31,7 @@ Formatting and rounding helpers for everyday number display.
|
|||||||
### format()
|
### format()
|
||||||
|
|
||||||
```php
|
```php
|
||||||
use Tez\Utils\Num\Num;
|
use Tezmanian\Utils\Num\Num;
|
||||||
|
|
||||||
Num::format(1234567.891); // '1,234,567.89'
|
Num::format(1234567.891); // '1,234,567.89'
|
||||||
Num::format(1234567.891, dec: ',', thousands: '.'); // '1.234.567,89'
|
Num::format(1234567.891, dec: ',', thousands: '.'); // '1.234.567,89'
|
||||||
@@ -90,7 +97,7 @@ The default scale is **8 decimal places** for all methods.
|
|||||||
### Arithmetic
|
### Arithmetic
|
||||||
|
|
||||||
```php
|
```php
|
||||||
use Tez\Utils\Num\Bc;
|
use Tezmanian\Utils\Num\Bc;
|
||||||
|
|
||||||
Bc::add('10.5', '20.3'); // '30.80000000'
|
Bc::add('10.5', '20.3'); // '30.80000000'
|
||||||
Bc::sub('20.3', '11.1'); // '9.20000000'
|
Bc::sub('20.3', '11.1'); // '9.20000000'
|
||||||
@@ -158,8 +165,17 @@ Bc::eq('5.001', '5.009'); // false
|
|||||||
|
|
||||||
- PHP 8.3+
|
- PHP 8.3+
|
||||||
- `ext-bcmath`
|
- `ext-bcmath`
|
||||||
- `tez/utils-validate` ^1.0
|
- [`tezmanian/utils-validate`](https://packagist.org/packages/tezmanian/utils-validate) ^1.0
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make build && make install
|
||||||
|
make ci # audit, PHPStan, code style, tests
|
||||||
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
MIT
|
MIT — see [LICENSE](LICENSE).
|
||||||
|
|
||||||
|
Author: René Halberstadt
|
||||||
|
|||||||
+22
-14
@@ -1,32 +1,40 @@
|
|||||||
{
|
{
|
||||||
"name": "tez/utils-num",
|
"name": "tezmanian/utils-num",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"description": "PHP number utilities: formatting, byte sizes, percentage, clamping, and rounding helpers (Num), plus arbitrary-precision decimal arithmetic via bcmath (Bc). PHP 8.3+, requires ext-bcmath.",
|
"description": "PHP number utilities: formatting, byte sizes, percentage, clamping, and rounding helpers (Num), plus arbitrary-precision decimal arithmetic via bcmath (Bc). PHP 8.3+, requires ext-bcmath.",
|
||||||
|
"keywords": [
|
||||||
|
"number",
|
||||||
|
"bcmath",
|
||||||
|
"decimal",
|
||||||
|
"format",
|
||||||
|
"php"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/tezmanian/tez-utils-num",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "René Halberstadt",
|
||||||
|
"email": "tezmanian@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/tezmanian/tez-utils-num/issues",
|
||||||
|
"source": "https://github.com/tezmanian/tez-utils-num"
|
||||||
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Tez\\Utils\\Num\\": "src/"
|
"Tezmanian\\Utils\\Num\\": "src/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Tez\\Utils\\Tests\\Num\\": "tests/"
|
"Tezmanian\\Utils\\Tests\\Num\\": "tests/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"repositories": [
|
|
||||||
{
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://gitea.root-zone.info/tez/tez-utils-validate.git"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/tezmanian/tez-utils-validate.git"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.3",
|
"php": ">=8.3",
|
||||||
"ext-bcmath": "*",
|
"ext-bcmath": "*",
|
||||||
"tez/utils-validate": "^1.0"
|
"tezmanian/utils-validate": "^1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^11.0",
|
"phpunit/phpunit": "^11.0",
|
||||||
|
|||||||
Generated
-4616
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Num;
|
namespace Tezmanian\Utils\Num;
|
||||||
|
|
||||||
use Tez\Utils\Validate\Guard;
|
use Tezmanian\Utils\Validate\Guard;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Arbitrary-precision decimal arithmetic helpers wrapping PHP's bcmath extension.
|
* Arbitrary-precision decimal arithmetic helpers wrapping PHP's bcmath extension.
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Num;
|
namespace Tezmanian\Utils\Num;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Number formatting helpers: decimal, byte sizes, percentages, and rounding.
|
* Number formatting helpers: decimal, byte sizes, percentages, and rounding.
|
||||||
|
|||||||
+2
-2
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Tests\Num;
|
namespace Tezmanian\Utils\Tests\Num;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Tez\Utils\Num\Bc;
|
use Tezmanian\Utils\Num\Bc;
|
||||||
|
|
||||||
final class BcTest extends TestCase
|
final class BcTest extends TestCase
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-2
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Tez\Utils\Tests\Num;
|
namespace Tezmanian\Utils\Tests\Num;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Tez\Utils\Num\Num;
|
use Tezmanian\Utils\Num\Num;
|
||||||
|
|
||||||
final class NumTest extends TestCase
|
final class NumTest extends TestCase
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user