Skip to content

Commit

Permalink
Use self keyword.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jan 6, 2020
1 parent 7737e07 commit 59b6fa8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function distinct(): BaseInterface
*/
public static function empty(): CollectionInterface
{
return new Collection();
return new self();
}

/**
Expand Down Expand Up @@ -269,7 +269,7 @@ public function intersperse($element, int $every = 1, int $startAt = 0): BaseInt
*/
public static function iterate(callable $callback, ...$parameters): CollectionInterface
{
return (new Collection())->run(new Iterate($callback, $parameters));
return (new self())->run(new Iterate($callback, $parameters));
}

/**
Expand Down Expand Up @@ -407,7 +407,7 @@ public function product(iterable ...$iterables): BaseInterface
*/
public static function range(int $start = 0, $end = INF, $step = 1): CollectionInterface
{
return (new Collection())->run(new Range($start, $end, $step));
return (new self())->run(new Range($start, $end, $step));
}

/**
Expand Down Expand Up @@ -561,7 +561,7 @@ public function walk(callable ...$callbacks): BaseInterface
*/
public static function with($data = [], ...$parameters): CollectionInterface
{
return new Collection($data, ...$parameters);
return new self($data, ...$parameters);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Contract/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static function iterate(callable $callback, ...$parameters): Collection;
* Create a new with a range of number.
*
* @param int $start
* @param float|int $end
* @param float|float|int $end
* @param int $step
*
* @return \loophp\collection\Contract\Collection<mixed>
Expand Down

0 comments on commit 59b6fa8

Please sign in to comment.