Skip to content

Commit 83ed959

Browse files
authored
Merge pull request #5 from JackWH/master
Replace "integer" types with "int", to suppress warnings in PHP 7.4 and PHP 8.0
2 parents a9deaf2 + d81d9f0 commit 83ed959

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

source/Trader.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,7 @@ public static function exponentialMovingAverage(array $real, int $timePeriod): a
15041504
* @return int Returns the error code identified by one of the TRADER_ERR_* constants.
15051505
* @throws \Exception
15061506
*/
1507-
public static function errorNumber(): integer
1507+
public static function errorNumber(): int
15081508
{
15091509
return static::errno();
15101510
}
@@ -1547,7 +1547,7 @@ public static function mathFloor(array $real): array
15471547
* @return int Returns the compatibility mode id which can be identified by TRADER_COMPATIBILITY_* series of constants.
15481548
* @throws \Exception
15491549
*/
1550-
public static function getCompatibilityMode(): integer
1550+
public static function getCompatibilityMode(): int
15511551
{
15521552
return static::get_compat();
15531553
}
@@ -1562,7 +1562,7 @@ public static function getCompatibilityMode(): integer
15621562
* @return int Returns the unstable period factor for the corresponding function.
15631563
* @throws \Exception
15641564
*/
1565-
public static function getUnstablePeriod(integer $functionId): integer
1565+
public static function getUnstablePeriod(int $functionId): int
15661566
{
15671567
return static::get_unstable_period($functionId);
15681568
}
@@ -2242,7 +2242,7 @@ public static function parabolicSARExtended(array $high, array $low, float $star
22422242
*
22432243
* @throws \Exception
22442244
*/
2245-
public static function setCompatibilityMode(integer $compatId)
2245+
public static function setCompatibilityMode(int $compatId)
22462246
{
22472247
static::set_compat($compatId);
22482248
}
@@ -2256,7 +2256,7 @@ public static function setCompatibilityMode(integer $compatId)
22562256
*
22572257
* @throws \Exception
22582258
*/
2259-
public static function setUnstablePeriod(integer $functionId, int $timePeriod)
2259+
public static function setUnstablePeriod(int $functionId, int $timePeriod)
22602260
{
22612261
static::set_unstable_period($functionId, $timePeriod);
22622262
}

source/TraderTrait.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,7 +1776,7 @@ public static function ema(array $real, int $timePeriod = null): array
17761776
* @return int Returns the error code identified by one of the TRADER_ERR_* constants.
17771777
* @throws \Exception
17781778
*/
1779-
public static function errno(): integer
1779+
public static function errno(): int
17801780
{
17811781
$return = trader_errno();
17821782
static::checkForError();
@@ -1825,7 +1825,7 @@ public static function floor(array $real): array
18251825
* @return int Returns the compatibility mode id which can be identified by TRADER_COMPATIBILITY_* series of constants.
18261826
* @throws \Exception
18271827
*/
1828-
public static function get_compat(): integer
1828+
public static function get_compat(): int
18291829
{
18301830
$return = trader_get_compat();
18311831
static::checkForError();
@@ -1842,7 +1842,7 @@ public static function get_compat(): integer
18421842
* @return int Returns the unstable period factor for the corresponding function.
18431843
* @throws \Exception
18441844
*/
1845-
public static function get_unstable_period(integer $functionId): integer
1845+
public static function get_unstable_period(int $functionId): int
18461846
{
18471847
$return = trader_get_unstable_period($functionId);
18481848
static::checkForError();
@@ -2707,7 +2707,7 @@ public static function sarext(array $high, array $low, float $startValue = null,
27072707
*
27082708
* @throws \Exception
27092709
*/
2710-
public static function set_compat(integer $compatId)
2710+
public static function set_compat(int $compatId)
27112711
{
27122712
trader_set_compat($compatId);
27132713
static::checkForError();
@@ -2722,7 +2722,7 @@ public static function set_compat(integer $compatId)
27222722
*
27232723
* @throws \Exception
27242724
*/
2725-
public static function set_unstable_period(integer $functionId, int $timePeriod)
2725+
public static function set_unstable_period(int $functionId, int $timePeriod)
27262726
{
27272727
trader_set_unstable_period($functionId, $timePeriod);
27282728
static::checkForError();

0 commit comments

Comments
 (0)