Skip to content

Commit

Permalink
Update ht_phasor & ht_sine method so they accept only one argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgenii Nasyrov committed Apr 5, 2018
1 parent 8114bc4 commit ce38ad3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
6 changes: 2 additions & 4 deletions src/Contracts/Trader.php
Original file line number Diff line number Diff line change
Expand Up @@ -1230,21 +1230,19 @@ public function ht_dcphase(array $real): array;
* Hilbert Transform - Phasor Components.
*
* @param array $open Opening price, array of real values.
* @param array $close Closing price, array of real values.
*
* @return array Returns an array with calculated data.
*/
public function ht_phasor(array $open, array $close): array;
public function ht_phasor(array $open): array;

/**
* Hilbert Transform - Phasor Components.
*
* @param array $open Opening price, array of real values.
* @param array $close Closing price, array of real values.
*
* @return array Returns an array with calculated data.
*/
public function ht_sine(array $open, array $close): array;
public function ht_sine(array $open): array;

/**
* Hilbert Transform - Instantaneous Trendline.
Expand Down
10 changes: 4 additions & 6 deletions src/Trader.php
Original file line number Diff line number Diff line change
Expand Up @@ -1838,12 +1838,11 @@ public function ht_dcphase(array $real): array
/**
* Hilbert Transform - Phasor Components.
*
* @param array $open Opening price, array of real values.
* @param array $close Closing price, array of real values.
* @param array $open Opening price, array of real values.
*
* @return array Returns an array with calculated data.
*/
public function ht_phasor(array $open, array $close): array
public function ht_phasor(array $open): array
{
$result = trader_ht_phasor($open, $close);

Expand All @@ -1856,13 +1855,12 @@ public function ht_phasor(array $open, array $close): array
* Hilbert Transform - Phasor Components.
*
* @param array $open Opening price, array of real values.
* @param array $close Closing price, array of real values.
*
* @return array Returns an array with calculated data.
*/
public function ht_sine(array $open, array $close): array
public function ht_sine(array $open): array
{
$result = trader_ht_sine($open, $close);
$result = trader_ht_sine($open);

$this->handleErrors();

Expand Down
12 changes: 4 additions & 8 deletions tests/Unit/TraderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -920,22 +920,18 @@ public function it_executes_ht_dcphase_correctly()
/** @test */
public function it_executes_ht_phasor_correctly()
{
$inPhase1 = [];
$inPhase2 = [];
$this->assertEquals(
trader_ht_phasor(static::$close, $inPhase1),
static::$trader->ht_phasor(static::$close, $inPhase2)
trader_ht_phasor(static::$close),
static::$trader->ht_phasor(static::$close)
);
}

/** @test */
public function it_executes_ht_sine_correctly()
{
$sine1 = [];
$sine2 = [];
$this->assertEquals(
trader_ht_sine(static::$close, $sine1),
static::$trader->ht_sine(static::$close, $sine2)
trader_ht_sine(static::$close),
static::$trader->ht_sine(static::$close)
);
}

Expand Down

0 comments on commit ce38ad3

Please sign in to comment.