Skip to content

Commit

Permalink
Merge pull request #309 from netglue/remove-psr-container-psalm-plugin
Browse files Browse the repository at this point in the history
Replace dev dependency on `lctrs/psalm-psr-container-plugin` with a stub file
  • Loading branch information
gsteel authored Jan 5, 2024
2 parents 6e0db78 + f52c385 commit 145f35c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 82 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
/test/ export-ignore
/.laminas-ci/ export-ignore
/.laminas-ci.json export-ignore
/.psr-container.php.stub export-ignore
2 changes: 1 addition & 1 deletion .laminas-ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ignore_php_platform_requirements": {
"8.3": true
"8.3": false
}
}
24 changes: 24 additions & 0 deletions .psr-container.php.stub
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

namespace Psr\Container {
/**
* Provides automatic type inference for Psalm when retrieving a service from a container using a FQCN
*/
interface ContainerInterface
{
/**
* @param string|class-string $id
* @return bool
*/
public function has(string $id);

/**
* @template T
* @psalm-param string|class-string<T> $id
* @psalm-return ($id is class-string ? T : mixed)
*/
public function get(string $id);
}
}
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"helmich/phpunit-psr7-assert": "^4.4.1",
"laminas/laminas-config-aggregator": "^1.14",
"laminas/laminas-servicemanager": "^3.22.1",
"lctrs/psalm-psr-container-plugin": "^1.9",
"mezzio/mezzio-fastroute": "^3.11",
"php-http/curl-client": "^2.3.1",
"php-http/mock-client": "^1.6",
Expand Down
80 changes: 1 addition & 79 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
</projectFiles>
<plugins>
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
<pluginClass class="Lctrs\PsalmPsrContainerPlugin\Plugin"/>
</plugins>
<stubs>
<file name=".psr-container.php.stub"/>
</stubs>
</psalm>

0 comments on commit 145f35c

Please sign in to comment.