ap-lib/sanitizer
Composer 安装命令:
composer require ap-lib/sanitizer
包简介
A library that sanitize some mixed variable to simple types: int, string, array, bool, null
README 文档
README
A library that normalizes some mixed variable to simple types: int, string, array, bool, null
Installation
composer require ap-lib/sanitizer
Features
- Allowed custom sanitizers
Requirements
- PHP 8.3 or higher
Getting started
$sanitizer = new BaseSanitizer([ new ThrowableSanitizer(include_trace: false) ]); $sanitizedObject = $sanitizer->sanitize([ "message" => "some error message", "exception" => new Exception("file not found", 1543), ]); $sanitizedArray = $sanitizedObject->value; var_export($sanitizedArray); /* [ 'message' => 'some error message', 'exception' => [ 'type' => 'Exception', 'message' => 'file not found', 'file' => '/code/path/to/file.php', 'line' => 19, 'code' => 1543, ], ] */
统计信息
- 总下载量: 34
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-07