Skip to content

Commit e6bf93d

Browse files
committed
Refactor BaseIntType to IntType and update namespace structure for clarity
- Renamed `BaseIntType` to `IntType` for consistency and readability. - Updated namespaces across integer types and tests to align with the new structure. - Adjusted test expectations and dependencies to reflect changes.
1 parent fd25420 commit e6bf93d

File tree

8 files changed

+13
-14
lines changed

8 files changed

+13
-14
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22

33
declare(strict_types=1);
44

5-
namespace PhpTypedValues\Code\BaseType;
5+
namespace PhpTypedValues\Code\Integer;
66

77
use PhpTypedValues\Code\Assert\Assert;
8-
use PhpTypedValues\Code\Contract\IntTypeInterface;
98
use PhpTypedValues\Code\Exception\TypeException;
109

1110
/**
1211
* @psalm-immutable
1312
*/
14-
abstract readonly class BaseIntType implements IntTypeInterface
13+
abstract readonly class IntType implements IntTypeInterface
1514
{
1615
/**
1716
* @throws TypeException
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\Code\Contract;
5+
namespace PhpTypedValues\Code\Integer;
66

77
/**
88
* @psalm-immutable

src/Integer/Integer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
namespace PhpTypedValues\Integer;
66

7-
use PhpTypedValues\Code\BaseType\BaseIntType;
87
use PhpTypedValues\Code\Exception\TypeException;
8+
use PhpTypedValues\Code\Integer\IntType;
99

1010
/**
1111
* @psalm-immutable
1212
*/
13-
final readonly class Integer extends BaseIntType
13+
final readonly class Integer extends IntType
1414
{
1515
protected int $value;
1616

src/Integer/NonNegativeInt.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
namespace PhpTypedValues\Integer;
66

77
use PhpTypedValues\Code\Assert\Assert;
8-
use PhpTypedValues\Code\BaseType\BaseIntType;
98
use PhpTypedValues\Code\Exception\TypeException;
9+
use PhpTypedValues\Code\Integer\IntType;
1010

1111
/**
1212
* @psalm-immutable
1313
*/
14-
final readonly class NonNegativeInt extends BaseIntType
14+
final readonly class NonNegativeInt extends IntType
1515
{
1616
/** @var non-negative-int */
1717
protected int $value;

src/Integer/PositiveInt.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
namespace PhpTypedValues\Integer;
66

77
use PhpTypedValues\Code\Assert\Assert;
8-
use PhpTypedValues\Code\BaseType\BaseIntType;
98
use PhpTypedValues\Code\Exception\TypeException;
9+
use PhpTypedValues\Code\Integer\IntType;
1010

1111
/**
1212
* @psalm-immutable
1313
*/
14-
final readonly class PositiveInt extends BaseIntType
14+
final readonly class PositiveInt extends IntType
1515
{
1616
/** @var positive-int */
1717
protected int $value;

src/Integer/WeekDayInt.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
namespace PhpTypedValues\Integer;
66

77
use PhpTypedValues\Code\Assert\Assert;
8-
use PhpTypedValues\Code\BaseType\BaseIntType;
98
use PhpTypedValues\Code\Exception\TypeException;
9+
use PhpTypedValues\Code\Integer\IntType;
1010

1111
/**
1212
* @psalm-immutable
1313
*/
14-
final readonly class WeekDayInt extends BaseIntType
14+
final readonly class WeekDayInt extends IntType
1515
{
1616
/** @var int<1, 7> */
1717
protected int $value;

tests/Arch/StructureTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
use PhpTypedValues\Code\BaseType\BaseIntType;
5+
use PhpTypedValues\Code\Integer\IntType;
66

77
arch('Base classes')
88
->expect('PhpTypedValues\Code\BaseType')
@@ -12,7 +12,7 @@
1212

1313
arch('Integer classes are final and read-only')
1414
->expect('PhpTypedValues\Integer')
15-
->toExtend(BaseIntType::class)
15+
->toExtend(IntType::class)
1616
->toBeClasses()
1717
->toBeFinal()
1818
->toBeReadonly();
File renamed without changes.

0 commit comments

Comments
 (0)