Skip to content

Commit ebffd75

Browse files
author
Greg Bowler
authored
Remove getclass (#7)
* test: implement unit tests * refactor: remove unused getClass function
1 parent c04fadc commit ebffd75

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

src/NullableTypeSafeGetter.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,6 @@ function(string|int|DateTimeInterface $value) {
3535
);
3636
}
3737

38-
/**
39-
* @template T
40-
* @param class-string<T> $className
41-
* @param string $name
42-
* @return T
43-
*/
44-
public function getClass(string $className, string $name):?object {
45-
return new $className;
46-
}
47-
4838
protected function getNullableType(string $name, string|callable $type):mixed {
4939
$value = $this->get($name);
5040
if(is_null($value)) {
@@ -69,8 +59,6 @@ protected function getNullableType(string $name, string|callable $type):mixed {
6959
return call_user_func($type, $value);
7060
}
7161

72-
73-
7462
return null;
7563
}
7664
}

0 commit comments

Comments
 (0)