Go to file
Saif Eddin Gmati b4669e5f4a
Merge pull request #199 from azjezz/dependabot/github_actions/actions/cache-2.1.6
[ga]: Bump actions/cache from 2.1.5 to 2.1.6
2021-05-28 18:44:08 +01:00
.github [ga]: Bump actions/cache from 2.1.5 to 2.1.6 2021-05-28 06:14:32 +00:00
docs Merge branch '1.6.x' into 1.7.x 2021-05-19 12:55:09 +01:00
integration/Psalm [Regex] add first_match() and every_match() functions (#151) 2021-04-09 20:24:01 +01:00
src fixed mismatching psalm assert variables (#197) 2021-05-24 21:30:20 +01:00
tests Merge branch '1.6.x' into 1.7.x 2021-05-19 12:55:09 +01:00
tools Improve functions signature using union types and mixed (#191) 2021-05-15 19:47:10 +01:00
.editorconfig move tools to a sub directory 2021-03-28 09:29:08 +01:00
.gitattributes move tools to a sub directory 2021-03-28 09:29:08 +01:00
.gitignore require php 8.0 2021-05-14 18:03:29 +01:00
CODE_OF_CONDUCT.md add contributors guidlines 2021-03-28 09:29:08 +01:00
composer.json Introduce Class, Trait, and Interface components 2021-05-14 18:03:29 +01:00
CONTRIBUTING.md add static analysis tests (#180) 2021-04-11 17:12:01 +01:00
LICENSE Initial commit 2019-12-24 02:01:46 +01:00
Makefile Improve functions signature using union types and mixed (#191) 2021-05-15 19:47:10 +01:00
README.md add cii badge 2021-05-23 19:09:30 +01:00
SECURITY.md add contributors guidlines 2021-03-28 09:29:08 +01:00

Psl - PHP Standard Library

Unit tests status Static analysis status Security analysis status Coding standards status Coding standards status CII Best Practices Coverage Status Type Coverage Total Downloads Latest Stable Version License

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.

Example

<?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'

Installation

Supported installation method is via composer:

composer require azjezz/psl

Psalm Integration

Please refer to the php-standard-library/psalm-plugin repository.

Documentation

You can read through the API documentation in docs/ directory.

Interested in contributing?

Have a look at CONTRIBUTING.md.

Sponsors

Thanks to our sponsors and supporters:

JetBrains

License

The MIT License (MIT). Please see LICENSE for more information.