Skip to content

Commit ecff7f3

Browse files
committed
override min/max
1 parent 9053960 commit ecff7f3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Spark.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55

66
class Spark
77
{
8-
public static function getString(array $items)
8+
public static function getString(array $items, $min = null, $max = null)
99
{
10-
$min = min($items);
11-
$max = max($items);
10+
if (null === $min) {
11+
$min = min($items);
12+
}
13+
if (null === $max) {
14+
$max = max($items);
15+
}
1216
$delta = $max - $min;
1317

1418
if (!$delta) {

0 commit comments

Comments
 (0)