@@ -488,9 +488,11 @@ public function extend($abstract, Closure $closure)
488488    /** 
489489     * Register an existing instance as shared in the container. 
490490     * 
491+      * @template TInstance of mixed 
492+      * 
491493     * @param  string  $abstract 
492-      * @param  mixed   $instance 
493-      * @return mixed  
494+      * @param  TInstance   $instance 
495+      * @return TInstance  
494496     */ 
495497    public  function  instance ($ abstract$ instance
496498    {
@@ -719,8 +721,10 @@ protected function getClassForCallable($callback)
719721    /** 
720722     * Get a closure to resolve the given type from the container. 
721723     * 
722-      * @param  string  $abstract 
723-      * @return \Closure 
724+      * @template TClass 
725+      * 
726+      * @param  string|class-string<TClass>  $abstract 
727+      * @return ($abstract is class-string<TClass> ? \Closure(): TClass : \Closure(): mixed) 
724728     */ 
725729    public  function  factory ($ abstract
726730    {
@@ -730,9 +734,11 @@ public function factory($abstract)
730734    /** 
731735     * An alias function name for make(). 
732736     * 
733-      * @param  string|callable  $abstract 
737+      * @template TClass 
738+      * 
739+      * @param  string|class-string<TClass>|callable  $abstract 
734740     * @param  array  $parameters 
735-      * @return mixed 
741+      * @return ($abstract is class-string<TClass> ? TClass :  mixed)  
736742     * 
737743     * @throws \Illuminate\Contracts\Container\BindingResolutionException 
738744     */ 
@@ -744,9 +750,11 @@ public function makeWith($abstract, array $parameters = [])
744750    /** 
745751     * Resolve the given type from the container. 
746752     * 
747-      * @param  string  $abstract 
753+      * @template TClass 
754+      * 
755+      * @param  string|class-string<TClass>  $abstract 
748756     * @param  array  $parameters 
749-      * @return mixed 
757+      * @return ($abstract is class-string<TClass> ? TClass :  mixed)  
750758     * 
751759     * @throws \Illuminate\Contracts\Container\BindingResolutionException 
752760     */ 
@@ -758,7 +766,10 @@ public function make($abstract, array $parameters = [])
758766    /** 
759767     * {@inheritdoc} 
760768     * 
761-      * @return mixed 
769+      * @template TClass 
770+      * 
771+      * @param  string|class-string<TClass>  $id 
772+      * @return ($id is class-string<TClass> ? TClass : mixed) 
762773     */ 
763774    public  function  get (string  $ id
764775    {
@@ -776,10 +787,12 @@ public function get(string $id)
776787    /** 
777788     * Resolve the given type from the container. 
778789     * 
779-      * @param  string|callable  $abstract 
790+      * @template TClass 
791+      * 
792+      * @param  string|class-string<TClass>|callable  $abstract 
780793     * @param  array  $parameters 
781794     * @param  bool  $raiseEvents 
782-      * @return mixed 
795+      * @return ($abstract is class-string<TClass> ? TClass :  mixed)  
783796     * 
784797     * @throws \Illuminate\Contracts\Container\BindingResolutionException 
785798     * @throws \Illuminate\Contracts\Container\CircularDependencyException 
@@ -919,8 +932,10 @@ protected function isBuildable($concrete, $abstract)
919932    /** 
920933     * Instantiate a concrete instance of the given type. 
921934     * 
922-      * @param  \Closure|string  $concrete 
923-      * @return mixed 
935+      * @template TClass 
936+      * 
937+      * @param  \Closure(static, array): TClass|class-string<TClass>  $concrete 
938+      * @return TClass 
924939     * 
925940     * @throws \Illuminate\Contracts\Container\BindingResolutionException 
926941     * @throws \Illuminate\Contracts\Container\CircularDependencyException 
0 commit comments