Skip to content

Commit f68cc34

Browse files
committed
Adding getIntStrict() helper method (returing a forced integer with default)
1 parent f528757 commit f68cc34

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.1.3 - WIP
4+
- Adding `getIntStrict()` helper method (returing a forced integer with default)
5+
6+
37
## 1.1.2 - 2026-02-02
48
- Adding `MessageResponse` for typing responses with message data
59
- Fixing upload assets endpoint URL

src/Data/BaseData.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ public function getInt(
6565
return $defaultValue;
6666
}
6767

68+
public function getIntStrict(
69+
int|string $key,
70+
int $defaultValue = 0,
71+
string $charNestedKey = ".",
72+
): int {
73+
return (int) $this->getInt($key, $defaultValue, $charNestedKey);
74+
}
75+
6876
public function getBoolean(
6977
int|string $key,
7078
bool $defaultValue = false,

0 commit comments

Comments
 (0)