j45l / maybe-php
PHP的Maybe
4.1.3
2022-10-28 19:17 UTC
Requires
- php: ^7.1|~8
- j45l/functional-php: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ~3.0
- infection/infection: ^0.23.0
- jetbrains/phpstorm-attributes: ^1.0
- phpmd/phpmd: ^2.10
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^1.4
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-latest
- slevomat/coding-standard: ^7.0
- squizlabs/php_codesniffer: ~3.0
- dev-main
- v4.x-dev
- 4.1.3
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.0
- v3.x-dev
- 3.5.1
- 3.5.0
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.1
- 3.3.0
- 3.2.1
- 3.2.0
- 3.1.10.0
- 3.1.9.2
- 3.1.9.1
- 3.1.9.0
- 3.1.8.0
- 3.1.7.1
- 3.1.7.0
- 3.1.6.4
- 3.1.6.3
- 3.1.6.2
- 3.1.6.1
- 3.1.5.1
- 3.1.5.0
- 3.1.4.6
- 3.1.3.0
- 3.1.2.0
- 3.1.1.0
- 3.1.0.0
- 3.0.0.0
- v2.x-dev
- v1.x-dev
- 1.9.2.0
- 1.9.1.5
- 1.9.1.4
- 1.9.1.3
- 1.9.1.2
- 1.9.1.1
- 1.9.1.0
- 1.9.0.0
- 1.8.6.1
- 1.8.6.0
- 1.8.5.6
- 1.8.4.0
- 1.8.3.2
- 1.8.2.1
- 1.8.1.2
- 1.8.1.0
- 1.8.0.0
- 1.7.0.1
- 1.7.0.0
- 1.6.0.8
- 1.6.0.7
- 1.5.0.5
- 1.5.0.2
- 1.4.1.0
- 1.4.0.1
- 1.3.1.0
- 1.2.6.0
- 1.2.5.0
- 1.2.4.0
- 1.2.3.0
- 1.2.2.1
- v1.2.1.0
- 1.1.3.1
- dev-v1b
This package is auto-updated.
Last update: 2024-09-28 23:14:59 UTC
README
可选(受函数式编程启发),有助于
- 更好地处理异常(JustSuccess/Failure)。
- 更好的null(None/Some)使用替代方案。
- 简化错误处理中的控制流。
- 构建安全代码
- 提高可测试性。
可选
是Optional/Either/Maybe的实用版本,它提供了这类语言中的功能,并增加了一些额外的功能来解决PHP中的常见用例。
更多文献,请在Google上搜索
https://www.thoughtworks.com/en-es/insights/blog/either-data-type-alternative-throwing-exceptions
https://itnext.io/either-monad-a-functional-approach-to-error-handling-in-js-ffdc2917ab2