Skip to content

Commit

Permalink
Remove getclass (#7)
Browse files Browse the repository at this point in the history
* test: implement unit tests

* refactor: remove unused getClass function
  • Loading branch information
g105b authored Jul 8, 2022
1 parent c04fadc commit ebffd75
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/NullableTypeSafeGetter.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@ function(string|int|DateTimeInterface $value) {
);
}

/**
* @template T
* @param class-string<T> $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)) {
Expand All @@ -69,8 +59,6 @@ protected function getNullableType(string $name, string|callable $type):mixed {
return call_user_func($type, $value);
}



return null;
}
}

0 comments on commit ebffd75

Please sign in to comment.