From e0491f12dd42d210d817bae8d33a0fd768f097e2 Mon Sep 17 00:00:00 2001 From: Jack Date: Sat, 10 Apr 2021 14:15:00 +0100 Subject: [PATCH 1/2] Update TraderTrait to use correct scalar types --- source/TraderTrait.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/TraderTrait.php b/source/TraderTrait.php index e2dee1c..d64515f 100644 --- a/source/TraderTrait.php +++ b/source/TraderTrait.php @@ -1776,7 +1776,7 @@ public static function ema(array $real, int $timePeriod = null): array * @return int Returns the error code identified by one of the TRADER_ERR_* constants. * @throws \Exception */ - public static function errno(): integer + public static function errno(): int { $return = trader_errno(); static::checkForError(); @@ -1825,7 +1825,7 @@ public static function floor(array $real): array * @return int Returns the compatibility mode id which can be identified by TRADER_COMPATIBILITY_* series of constants. * @throws \Exception */ - public static function get_compat(): integer + public static function get_compat(): int { $return = trader_get_compat(); static::checkForError(); @@ -1842,7 +1842,7 @@ public static function get_compat(): integer * @return int Returns the unstable period factor for the corresponding function. * @throws \Exception */ - public static function get_unstable_period(integer $functionId): integer + public static function get_unstable_period(int $functionId): int { $return = trader_get_unstable_period($functionId); static::checkForError(); @@ -2707,7 +2707,7 @@ public static function sarext(array $high, array $low, float $startValue = null, * * @throws \Exception */ - public static function set_compat(integer $compatId) + public static function set_compat(int $compatId) { trader_set_compat($compatId); static::checkForError(); @@ -2722,7 +2722,7 @@ public static function set_compat(integer $compatId) * * @throws \Exception */ - public static function set_unstable_period(integer $functionId, int $timePeriod) + public static function set_unstable_period(int $functionId, int $timePeriod) { trader_set_unstable_period($functionId, $timePeriod); static::checkForError(); From d81d9f0edd35e94d42e40616004001df9b1ac3ab Mon Sep 17 00:00:00 2001 From: Jack Date: Sat, 10 Apr 2021 14:16:18 +0100 Subject: [PATCH 2/2] Update Trader to use the correct scalar types --- source/Trader.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/Trader.php b/source/Trader.php index 850dcc6..6704327 100644 --- a/source/Trader.php +++ b/source/Trader.php @@ -1504,7 +1504,7 @@ public static function exponentialMovingAverage(array $real, int $timePeriod): a * @return int Returns the error code identified by one of the TRADER_ERR_* constants. * @throws \Exception */ - public static function errorNumber(): integer + public static function errorNumber(): int { return static::errno(); } @@ -1547,7 +1547,7 @@ public static function mathFloor(array $real): array * @return int Returns the compatibility mode id which can be identified by TRADER_COMPATIBILITY_* series of constants. * @throws \Exception */ - public static function getCompatibilityMode(): integer + public static function getCompatibilityMode(): int { return static::get_compat(); } @@ -1562,7 +1562,7 @@ public static function getCompatibilityMode(): integer * @return int Returns the unstable period factor for the corresponding function. * @throws \Exception */ - public static function getUnstablePeriod(integer $functionId): integer + public static function getUnstablePeriod(int $functionId): int { return static::get_unstable_period($functionId); } @@ -2242,7 +2242,7 @@ public static function parabolicSARExtended(array $high, array $low, float $star * * @throws \Exception */ - public static function setCompatibilityMode(integer $compatId) + public static function setCompatibilityMode(int $compatId) { static::set_compat($compatId); } @@ -2256,7 +2256,7 @@ public static function setCompatibilityMode(integer $compatId) * * @throws \Exception */ - public static function setUnstablePeriod(integer $functionId, int $timePeriod) + public static function setUnstablePeriod(int $functionId, int $timePeriod) { static::set_unstable_period($functionId, $timePeriod); }