Skip to content

Commit

Permalink
use class-string typehints
Browse files Browse the repository at this point in the history
  • Loading branch information
filecage committed Dec 2, 2021
1 parent f4930db commit 5371744
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ function __construct (ResourceRegistry $resourceRegistry = null) {
}

/**
* @param string $className
* @template className
* @param class-string<className> $className
* @param bool $forceInstance Whether the class will be loaded from (or stored to) registry
*
* @throws Unresolvable
* @return object
* @return className
*/
function create ($className, $forceInstance = false) {
function create ($className, $forceInstance = false) : object {
return (new Creation($className, ($forceInstance) ? $this->resourceRegistry->cloneWithout($className) : $this->resourceRegistry))->create();
}

Expand Down

0 comments on commit 5371744

Please sign in to comment.