Skip to content

[11.x] fix: specify type of TClass generic in Container #54545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

MrMeshok
Copy link
Contributor

After #54543 docblocks for App facade generated incorrect return values (void). With this PR diff looks like that

--- a/src/Illuminate/Support/Facades/App.php
+++ b/src/Illuminate/Support/Facades/App.php
@@ -53,7 +53,7 @@
  * @method static void loadDeferredProviders()
  * @method static void loadDeferredProvider(string $service)
  * @method static void registerDeferredProvider(string $provider, string|null $service = null)
- * @method static mixed make(string $abstract, array $parameters = [])
+ * @method static object|mixed make(string $abstract, array $parameters = [])
  * @method static bool bound(string $abstract)
  * @method static bool isBooted()
  * @method static void boot()
@@ -120,10 +120,10 @@
  * @method static mixed refresh(string $abstract, mixed $target, string $method)
  * @method static \Closure wrap(\Closure $callback, array $parameters = [])
  * @method static mixed call(callable|string $callback, array $parameters = [], string|null $defaultMethod = null)
- * @method static \Closure factory(string $abstract)
- * @method static mixed makeWith(string|callable $abstract, array $parameters = [])
- * @method static mixed get(string $id)
- * @method static mixed build(\Closure|string $concrete)
+ * @method static \Closure|\Closure factory(string $abstract)
+ * @method static object|mixed makeWith(string|callable $abstract, array $parameters = [])
+ * @method static object|mixed get(string $id)
+ * @method static object build(\Closure|string $concrete)
  * @method static mixed resolveFromAttribute(\ReflectionAttribute $attribute)
  * @method static void beforeResolving(\Closure|string $abstract, \Closure|null $callback = null)
  * @method static void resolving(\Closure|string $abstract, \Closure|null $callback = null)
@method static \Closure|\Closure factory(string $abstract)

factory looks a little weird, maybe it could be fixed in facade-documenter

I also changed generics in app() and resolve() helper for consistency

@taylorotwell taylorotwell merged commit 0ea7856 into laravel:11.x Feb 10, 2025
46 checks passed
@MrMeshok MrMeshok deleted the container-generics-facade branch February 10, 2025 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants