File tree 2 files changed +11
-6
lines changed
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -158,12 +158,11 @@ class Container extends Component
158
158
* @throws InvalidConfigException if the class cannot be recognized or correspond to an invalid definition
159
159
* @throws NotInstantiableException If resolved to an abstract class or an interface (since 2.0.9)
160
160
*
161
- *
162
- * @template T of class-string
163
- * @psalm-param class-string<T>|array{class: class-string<T>} $class
164
- * @phpstan-param class-string<T>|array{class: class-string<T>} $class
165
- * @psalm-return T
166
- * @phpstan-return T
161
+ * @template T of object
162
+ * @psalm-param string|class-string<T>|Instance $class
163
+ * @phpstan-param string|class-string<T>|Instance $class
164
+ * @psalm-return ($class is class-string<T> ? T : object)
165
+ * @phpstan-return ($class is class-string<T> ? T : object)
167
166
*/
168
167
public function get ($ class , $ params = [], $ config = [])
169
168
{
Original file line number Diff line number Diff line change @@ -114,6 +114,12 @@ public static function of($id, $optional = false)
114
114
* @param ServiceLocator|Container|null $container the container. This will be passed to [[get()]].
115
115
* @return object the object referenced by the Instance, or `$reference` itself if it is an object.
116
116
* @throws InvalidConfigException if the reference is invalid
117
+ *
118
+ * @template T of object
119
+ * @psalm-param class-string<T>|null $type
120
+ * @phpstan-param class-string<T>|null $type
121
+ * @psalm-return ($type is null ? object : T)
122
+ * @phpstan-return ($type is null ? object : T)
117
123
*/
118
124
public static function ensure ($ reference , $ type = null , $ container = null )
119
125
{
You can’t perform that action at this time.
0 commit comments