Skip to content

Commit

Permalink
refactor: Deprecate Collection::with() static constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jun 11, 2021
1 parent b3b3c62 commit 8060689
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,9 @@ public function window(int $size): CollectionInterface
return $this->pipe(Window::of()($size));
}

/**
* @deprecated Use other static constructors instead.
*/
public static function with($data = [], ...$parameters): CollectionInterface
{
return new self($data, ...$parameters);
Expand Down
2 changes: 2 additions & 0 deletions src/Contract/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ public static function fromString(string $string, string $delimiter = ''): Colle
public function getIterator(): ClosureIterator;

/**
* @deprecated Use other static constructors instead.
*
* @psalm-template NewTKey
* @psalm-template NewTKey of array-key
* @psalm-template NewT
Expand Down

0 comments on commit 8060689

Please sign in to comment.