承接 ap-lib/normalizer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ap-lib/normalizer

Composer 安装命令:

composer require ap-lib/normalizer

包简介

A library that normalizes some mixed variable to simple types: int, string, array, bool, null

README 文档

README

MIT License

A library that normalizes some mixed variable to simple types: int, string, array, bool, null

Installation

composer require ap-lib/normalizer

Features

  • Allowed custom normalizers

Requirements

  • PHP 8.3 or higher

Getting started

$normalizer = new BaseNormalizer([
    new ThrowableNormalizer(include_trace: false)
]);

$normalizedObject = $normalizer->normalize([
    "message"   => "some error message",
    "exception" => new Exception("file not found", 1543),
]);

$normalizedArray = $normalizedObject->value;

var_export($normalizedArray);
/*
[
    'message'   => 'some error message',
    'exception' =>
        [
            'type'    => 'Exception',
            'message' => 'file not found',
            'file'    => '/code/path/to/file.php',
            'line'    => 19,
            'code'    => 1543,
        ],
]
*/

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-02