Skip to content

Commit

Permalink
Type hinting update for IDEs
Browse files Browse the repository at this point in the history
- Close #11: The instantiate method in DependencyInjector has been enhanced with PHPDoc annotations that use templates. This enhancement is aimed to support improved autocompletion in IDEs like PhpStorm. Now, IDEs should be able to provide method suggestions based on the specific class being instantiated, helping developers write more accurate code more quickly. This change does not affect the functionality of the instantiate method, but greatly enhances developer experience
  • Loading branch information
tlmcclatchey committed Jul 1, 2023
1 parent da7cfe9 commit 4eb80a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/DependencyInjector.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ public function __construct()
}

/**
* @param class-string $className The fully qualified class name to instantiate
* @template T
* @param class-string<T> $className The fully qualified class name to instantiate
* @param array $parameters The parameters to pass to the constructor
* @return object The instantiated object.
* @return T The instantiated object.
* @throws ClassNotDefinedException
* @throws ClassNotInstantiableException
* @throws ParameterDiscoveryFailedException
Expand Down

0 comments on commit 4eb80a9

Please sign in to comment.