azjezz / psl
PHP Standard Library
Fund package maintenance!
Open Collective
Installs: 1 441 487
Dependents: 47
Suggesters: 0
Security: 0
Stars: 1 032
Watchers: 21
Forks: 62
Open Issues: 23
Requires
- php: ~8.1.0 || ~8.2.0
- ext-bcmath: *
- ext-intl: *
- ext-json: *
- ext-mbstring: *
- ext-sodium: *
- revolt/event-loop: ^1.0.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.4.0
- php-coveralls/php-coveralls: ^2.5.2
- php-standard-library/psalm-plugin: ^2.2
- phpbench/phpbench: ^1.2.3
- phpunit/phpunit: ^9.5.16
- roave/infection-static-analysis-plugin: ^1.26.0
- squizlabs/php_codesniffer: ^3.6.2
- vimeo/psalm: ^5.0.0
Suggests
- php-standard-library/psalm-plugin: Psalm integration
- dev-next
- 2.6.0
- 2.5.x-dev
- 2.5.0
- 2.4.x-dev
- 2.4.1
- 2.4.0
- 2.3.x-dev
- 2.3.1
- 2.3.0
- 2.2.x-dev
- 2.2.0
- 2.1.x-dev
- 2.1.0
- 2.0.x-dev
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 2.0.0-rc2
- 2.0.0-rc1
- 1.9.x-dev
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.x-dev
- 1.8.2
- 1.8.1
- 1.8.0
- 1.7.x-dev
- 1.7.4
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.x-dev
- 1.6.3
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.x-dev
- 1.5.0
- 1.4.x-dev
- 1.4.1
- 1.4.0
- 1.3.x-dev
- 1.3.1
- 1.3.0
- 1.2.x-dev
- 1.2.0
- 1.1.x-dev
- 1.1.1
- 1.1.0
- 1.0.x-dev
- 1.0.0
- 0.1.x-dev
- 0.1.2
- 0.1.1
- 0.1.0
- dev-ext
- dev-phantom
- dev-string-deprecations
- dev-ci/examples
This package is auto-updated.
Last update: 2023-05-23 07:45:11 UTC
README
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.