Skip to content

Commit cae53ed

Browse files
committed
Added the extra parameter to ht_phasor and ht_sine.
These parameters are missing from the documentation. Verified with the source code for the Trader API.
1 parent 3f7d286 commit cae53ed

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

source/Trader.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -1503,24 +1503,26 @@ public static function hilbertTransformDominantCyclePhase(array $real): array
15031503
* Hilbert Transform - Phasor Components
15041504
*
15051505
* @param array $real Array of real values.
1506+
* @param array $inPhase Empty array, will be filled with in phase data.
15061507
*
15071508
* @return array Returns an array with calculated data or false on failure.
15081509
*/
1509-
public static function hilbertTransformPhasorComponents(array $real): array
1510+
public static function hilbertTransformPhasorComponents(array $real, array &$inPhase): array
15101511
{
1511-
return static::ht_phasor($real);
1512+
return static::ht_phasor($real, $inPhase);
15121513
}
15131514

15141515
/**
15151516
* Hilbert Transform - SineWave
15161517
*
15171518
* @param array $real Array of real values.
1519+
* @param array $sine Empty array, will be filled with sine data.
15181520
*
15191521
* @return array Returns an array with calculated data or false on failure.
15201522
*/
1521-
public static function hilbertTransformSineWave(array $real): array
1523+
public static function hilbertTransformSineWave(array $real, array &$sine): array
15221524
{
1523-
return static::ht_sine($real);
1525+
return static::ht_sine($real, $sine);
15241526
}
15251527

15261528
/**

source/TraderTrait.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -1819,13 +1819,14 @@ public static function ht_dcphase(array $real): array
18191819
/**
18201820
* Hilbert Transform - Phasor Components
18211821
*
1822-
* @param array $real Array of real values.
1822+
* @param array $real Array of real values.
1823+
* @param array $inPhase Empty array, will be filled with in phase data.
18231824
*
18241825
* @return array Returns an array with calculated data or false on failure.
18251826
*/
1826-
public static function ht_phasor(array $real): array
1827+
public static function ht_phasor(array $real, array &$inPhase): array
18271828
{
1828-
$return = trader_ht_phasor($real);
1829+
$return = trader_ht_phasor($real, $inPhase);
18291830
static::checkForError();
18301831

18311832
return $return;
@@ -1835,12 +1836,13 @@ public static function ht_phasor(array $real): array
18351836
* Hilbert Transform - SineWave
18361837
*
18371838
* @param array $real Array of real values.
1839+
* @param array $sine Empty array, will be filled with sine data.
18381840
*
18391841
* @return array Returns an array with calculated data or false on failure.
18401842
*/
1841-
public static function ht_sine(array $real): array
1843+
public static function ht_sine(array $real, array &$sine): array
18421844
{
1843-
$return = trader_ht_sine($real);
1845+
$return = trader_ht_sine($real, $sine);
18441846
static::checkForError();
18451847

18461848
return $return;

0 commit comments

Comments
 (0)