Skip to content

Commit 61782e9

Browse files
authored
Merge pull request #21 from pottertech/master
Update Core.php to fix array size being too small.
2 parents a88e985 + 5f383ca commit 61782e9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source/TALib/Core/Core.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ public static function construct(): void
9696
/* when measuring distance between parts of candles or width of gaps "equal" means "<= 5% of the average of the 5 previous candles' high-low range" */
9797
new CandleSetting(CandleSettingType::Equal, RangeType::HighLow, 5, 0.05),
9898
];
99-
static::$unstablePeriod = \array_pad([], UnstablePeriodFunctionID::ALL - 2, 0);
99+
// Changed to correct array size to avoid the "Uncaught ErrorException: Undefined array key 22"
100+
// static::$unstablePeriod = \array_pad([], UnstablePeriodFunctionID::ALL - 2, 0);
101+
static::$unstablePeriod = \array_pad([], UnstablePeriodFunctionID::ALL, 0);
100102
}
101103

102104
public static function setUnstablePeriod(int $functionID, int $unstablePeriod): void

0 commit comments

Comments
 (0)