From ebffd758e69b8a0eebcad30f3daf408915b9ddf3 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Fri, 8 Jul 2022 18:17:42 +0100 Subject: [PATCH] Remove getclass (#7) * test: implement unit tests * refactor: remove unused getClass function --- src/NullableTypeSafeGetter.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/NullableTypeSafeGetter.php b/src/NullableTypeSafeGetter.php index f8664d5..a9ce8ff 100644 --- a/src/NullableTypeSafeGetter.php +++ b/src/NullableTypeSafeGetter.php @@ -35,16 +35,6 @@ function(string|int|DateTimeInterface $value) { ); } - /** - * @template T - * @param class-string $className - * @param string $name - * @return T - */ - public function getClass(string $className, string $name):?object { - return new $className; - } - protected function getNullableType(string $name, string|callable $type):mixed { $value = $this->get($name); if(is_null($value)) { @@ -69,8 +59,6 @@ protected function getNullableType(string $name, string|callable $type):mixed { return call_user_func($type, $value); } - - return null; } }