Psl is a standard library for PHP, inspired by hhvm/hsl.
The goal of Psl is to provide a consistent, centralized, well-typed set of APIs for PHP programmers.
<?php
declare(strict_types=1);
use Psl\{Str, Vec};
/**
* @psalm-param iterable<?int> $codes
*/
function foo(iterable $codes): string
{
$codes = Vec\filter_nulls($codes);
$chars = Vec\map($codes, fn(int $code): string => Str\chr($code));
return Str\join($chars, ', ');
}
foo([95, 96, null, 98]);
// 'a, b, d'
Supported installation method is via composer:
composer require azjezz/psl
Please refer to the php-standard-library/psalm-plugin
repository.
You can read through the API documentation in docs/
directory.
Have a look at CONTRIBUTING.md
.
Thanks to our sponsors and supporters:
JetBrains |
---|
The MIT License (MIT). Please see LICENSE
for more information.