Skip to content
/ psl Public
forked from azjezz/psl

PHP Standard Library - a modern, consistent, centralized, well-typed set of APIs for PHP programmers.

License

Notifications You must be signed in to change notification settings

zerkms/psl

This branch is 21 commits behind azjezz/psl:next.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6683d60 ยท Sep 13, 2024
Sep 13, 2024
Sep 3, 2024
Sep 3, 2024
May 29, 2024
Sep 13, 2024
Sep 3, 2024
Dec 12, 2021
Mar 28, 2021
Oct 30, 2021
Dec 12, 2021
Jul 19, 2023
Mar 28, 2021
Oct 30, 2021
Dec 2, 2022
Sep 13, 2024
Nov 15, 2023
Mar 28, 2021
Mar 31, 2024
Sep 3, 2024

Repository files navigation

Important

๐Ÿ‡ต๐Ÿ‡ธ Support Palestine ๐Ÿ‡ต๐Ÿ‡ธ

In light of recent events in Gaza, I encourage everyone to educate themselves on the ongoing issues in Palestine and consider supporting the people there. Here are some resources and donation links:

Thank you for taking a moment to bring awareness and make a difference. ๐Ÿ‡ต๐Ÿ‡ธโค๏ธ

Psl - PHP Standard Library

Unit tests status Static analysis status Security analysis status Coding standards status Coding standards status CII Best Practices Coverage Status MSI 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\Async;
use Psl\TCP;
use Psl\IO;
use Psl\Shell;
use Psl\Str;

Async\main(static function(): int {
    IO\write_line('Hello, World!');

    [$version, $connection] = Async\concurrently([
        static fn() => Shell\execute('php', ['-v']),
        static fn() => TCP\connect('localhost', 1337),
    ]);

    $messages = Str\split($version, "\n");
    foreach($messages as $message) {
        $connection->writeAll($message);
    }

    $connection->close();

    return 0;
});

Installation

Supported installation method is via composer:

composer require azjezz/psl

Psalm Integration

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

PHPStan Integration

Please refer to the php-standard-library/phpstan-extension 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.

About

PHP Standard Library - a modern, consistent, centralized, well-typed set of APIs for PHP programmers.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.9%
  • Makefile 0.1%