Skip to content

Commit 251faa4

Browse files
author
nejc
committed
refactor: improve type safety in abstract classes
- Add explicit return types to AbstractNativeInteger methods - Add explicit return types to AbstractBigInteger methods - Improve method signatures for better type safety - Maintain backward compatibility while enhancing type checking
1 parent 8d7ad9c commit 251faa4

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/Abstract/AbstractBigInteger.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ protected function setValue(int|string $value): void
7979
}
8080

8181

82+
8283
/**
8384
* @param BigIntegerInterface|NativeIntegerInterface $other
8485
* @param callable $operation

src/Abstract/AbstractNativeInteger.php

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

55
namespace Nejcc\PhpDatatypes\Abstract;
66

7+
use Nejcc\PhpDatatypes\Attributes\Range;
78
use Nejcc\PhpDatatypes\Interfaces\NativeIntegerInterface;
89
use Nejcc\PhpDatatypes\Traits\NativeArithmeticOperationsTrait;
910
use Nejcc\PhpDatatypes\Traits\NativeIntegerComparisonTrait;
@@ -72,6 +73,7 @@ protected function setValue(int $value): void
7273
$this->value = $value;
7374
}
7475

76+
7577
/**
7678
* @param NativeIntegerInterface $other
7779
* @param callable $operation

0 commit comments

Comments
 (0)