Skip to content

Commit 395fc5b

Browse files
committed
Refactor and update class naming conventions and namespaces
- Migrated to consistent naming by replacing `NonNegativeInt`, `PositiveInt`, `TinyInt`, `JsonStr`, `NonEmptyStr`, and similar classes with their respective concise counterparts (`NonNegative`, `Positive`, `Tiny`, `Json`, `NonEmpty`, etc.). - Adjusted namespaces to ensure categorization consistency (e.g., `Integer\Alias\MariaDb`, `String\Alias\MariaDb`, `String\Uuid`). - Enhanced usage examples to align with refactored class names and namespaces. - Updated all related unit tests to reflect the changes in naming and namespaces. - Introduced new alias classes like `MariaDb\Tiny`, `Uuid\UuidV4`, and `Uuid\UuidV7` to ensure clarity and maintain compatibility. - Removed redundant classes that were replaced with aliases. - Comprehensive updates across tests, examples, and documentation to ensure consistency after refactor.
1 parent d1c24d7 commit 395fc5b

34 files changed

+196
-149
lines changed

src/Integer/Alias/MariaDb/Tiny.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PhpTypedValues\Integer\Alias\MariaDb;
6+
7+
use PhpTypedValues\Integer\MariaDb\IntegerTiny;
8+
9+
/**
10+
* Alias of IntTiny.
11+
*
12+
* Example "1"
13+
*
14+
* @psalm-immutable
15+
*/
16+
readonly class Tiny extends IntegerTiny
17+
{
18+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
*
1414
* @psalm-immutable
1515
*/
16-
readonly class NonNegativeInt extends IntegerNonNegative
16+
readonly class NonNegative extends IntegerNonNegative
1717
{
1818
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
*
1414
* @psalm-immutable
1515
*/
16-
readonly class PositiveInt extends IntegerPositive
16+
readonly class Positive extends IntegerPositive
1717
{
1818
}

src/Integer/Alias/TinyInt.php

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
* @psalm-immutable
2020
*/
21-
readonly class IntTiny extends IntType
21+
readonly class IntegerTiny extends IntType
2222
{
2323
/** @var int<-128, 127> */
2424
protected int $value;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
namespace PhpTypedValues\String\Alias;
66

7-
use PhpTypedValues\String\Json;
7+
use PhpTypedValues\String\StringJson;
88

99
/**
1010
* @psalm-immutable
1111
*/
12-
readonly class JsonStr extends Json
12+
readonly class Json extends StringJson
1313
{
1414
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace PhpTypedValues\String\Alias;
5+
namespace PhpTypedValues\String\Alias\MariaDb;
66

77
use PhpTypedValues\String\MariaDb\StringDecimal;
88

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace PhpTypedValues\String\Alias;
5+
namespace PhpTypedValues\String\Alias\MariaDb;
66

77
use PhpTypedValues\String\MariaDb\StringText;
88

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PhpTypedValues\String\Alias\MariaDb;
6+
7+
use PhpTypedValues\String\MariaDb\StringVarChar255;
8+
9+
/**
10+
* @psalm-immutable
11+
*/
12+
readonly class VarChar255 extends StringVarChar255
13+
{
14+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
*
1414
* @psalm-immutable
1515
*/
16-
readonly class NonBlankStr extends StringNonBlank
16+
readonly class NonBlank extends StringNonBlank
1717
{
1818
}

0 commit comments

Comments
 (0)