Go to file
2021-07-24 11:23:08 +01:00
.github stop testing on windows 2021-07-10 03:01:37 +01:00
docs [RandomSequence] Introduce random sequence component 2021-07-10 03:16:29 +01:00
integration/Psalm [Regex] add first_match() and every_match() functions (#151) 2021-04-09 20:24:01 +01:00
src [Math] don't perform operations on possible numeric-string (#220) 2021-07-24 11:23:08 +01:00
tests [RandomSequence] Introduce random sequence component 2021-07-10 03:16:29 +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 Suggest Psalm plugin (#217) 2021-07-04 22:05:09 +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 chore: update make file 2021-07-10 02:46:28 +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.