Skip to content

Commit

Permalink
Fix code style and PHPStan warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jan 11, 2020
1 parent bbbb99c commit caf5a37
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public function product(iterable ...$iterables): BaseInterface
/**
* {@inheritdoc}
*/
public static function range(int $start = 0, $end = INF, $step = 1): CollectionInterface
public static function range(float $start = 0.0, float $end = INF, float $step = 1.0): CollectionInterface
{
return (new self())->run(new Range($start, $end, $step));
}
Expand Down
8 changes: 4 additions & 4 deletions src/Contract/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ public static function iterate(callable $callback, ...$parameters): Collection;
/**
* Create a new with a range of number.
*
* @param int $start
* @param float|float|int $end
* @param int $step
* @param float $start
* @param float $end
* @param float $step
*
* @return \loophp\collection\Contract\Collection<mixed>
*/
public static function range(int $start = 0, $end = INF, $step = 1): Collection;
public static function range(float $start = 0.0, float $end = INF, float $step = 1.0): Collection;

/**
* Create a new instance by invoking the callback a given amount of times.
Expand Down
4 changes: 3 additions & 1 deletion src/Operation/Range.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
use Generator;
use loophp\collection\Contract\Operation;

use const INF;

/**
* Class Range.
*/
Expand Down Expand Up @@ -35,7 +37,7 @@ final class Range implements Operation
* @param float $end
* @param float $step
*/
public function __construct(float $start = 0, float $end = INF, float $step = 1)
public function __construct(float $start = 0.0, float $end = INF, float $step = 1.0)
{
$this->start = $start;
$this->end = $end;
Expand Down

0 comments on commit caf5a37

Please sign in to comment.