Skip to content

Commit

Permalink
Add custom Psalm stub to get service container generics
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jul 17, 2024
1 parent edfcb7b commit 6c5159b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions monorepo/stubs/Application.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Illuminate\Foundation;

class Application
{
/**
* @template T
*
* @param class-string<T> $abstract
* @return T
*/
public function make(string $abstract)
{
}
}
3 changes: 3 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@
<plugins>
<pluginClass class="Psalm\LaravelPlugin\Plugin"/>
</plugins>
<stubs>
<file name="monorepo/stubs/Application.php" />
</stubs>
</psalm>

0 comments on commit 6c5159b

Please sign in to comment.