From d1b412f91342c836c036126790f991ec12e60375 Mon Sep 17 00:00:00 2001 From: Pekka Laiho Date: Sun, 6 Dec 2020 21:05:04 +0700 Subject: [PATCH] move new-function from Seq to Collection --- src/Collection.php | 6 ++++++ src/Seq.php | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Collection.php b/src/Collection.php index 0a59b4c..72116b5 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -3,6 +3,12 @@ namespace MadLisp; abstract class Collection { + public static function new(array $data = []): self + { + // late static binding + return new static($data); + } + protected array $data = []; public function __construct(array $data = []) diff --git a/src/Seq.php b/src/Seq.php index 1b4ee41..bc04873 100644 --- a/src/Seq.php +++ b/src/Seq.php @@ -3,9 +3,5 @@ namespace MadLisp; abstract class Seq extends Collection { - public static function new(array $data = []): self - { - // late static binding - return new static($data); - } + }