Skip to content

Commit

Permalink
move psalm integration to integration directory (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
azjezz committed Feb 16, 2021
1 parent 434da8e commit 78289a1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,16 @@ The goal of Psl is to provide a consistent, centralized, well-typed set of APIs

declare(strict_types=1);

use Psl\Arr;
use Psl\Str;
use Psl\{Dict, Str, Vec};

/**
* @psalm-param iterable<?int> $codes
*/
function foo(iterable $codes): string
{
/** @var list<int> $codes */
$codes = Arr\filter_nulls($codes);
/** @var list<string> $chars */
$chars = Arr\map($codes, fn(int $code): string => Str\chr($code));
$codes = Vec\filter_nulls($codes);

$chars = Dict\map($codes, fn(int $code): string => Str\chr($code));

return Str\join($chars, ', ');
}
Expand Down Expand Up @@ -61,7 +59,7 @@ To enable the Psalm plugin, add the `Psl\Internal\Psalm\Plugin` class to your ps
...
<plugins>
...
<pluginClass class="Psl\Internal\Psalm\Plugin"/>
<pluginClass class="Psl\Integration\Psalm\Plugin" />
</plugins>
</psalm>

Expand Down
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
},
"autoload": {
"psr-4": {
"Psl\\": "src/Psl"
"Psl\\": "src/Psl",
"Psl\\Integration\\": "integration"
},
"files": [
"src/bootstrap.php"
Expand Down Expand Up @@ -64,7 +65,11 @@
},
"extra": {
"psalm": {
"pluginClass": "Psl\\Internal\\Psalm\\Plugin"
"pluginClass": "Psl\\Integration\\Psalm\\Plugin"
},
"thanks": {
"name": "hhvm/hsl",
"url": "https://github.com/hhvm/hsl"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Psl\Internal\Psalm\EventHandler;
namespace Psl\Integration\Psalm\EventHandler;

use Psalm\Plugin\EventHandler\Event\FunctionReturnTypeProviderEvent;
use Psalm\Plugin\EventHandler\FunctionReturnTypeProviderInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Psl\Internal\Psalm;
namespace Psl\Integration\Psalm;

use Psalm\Plugin\PluginEntryPointInterface;
use Psalm\Plugin\RegistrationInterface;
Expand Down
3 changes: 2 additions & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
>
<projectFiles>
<directory name="src" />
<directory name="integration" />
<ignoreFiles>
<directory name="vendor" />
<file name="src/bootstrap.php"/>
Expand Down Expand Up @@ -56,6 +57,6 @@
</issueHandlers>

<plugins>
<pluginClass class="Psl\Internal\Psalm\Plugin"/>
<pluginClass class="Psl\Integration\Psalm\Plugin"/>
</plugins>
</psalm>

0 comments on commit 78289a1

Please sign in to comment.