ap-lib/error-node 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

ap-lib/error-node

Composer 安装命令:

composer require ap-lib/error-node

包简介

A simple and lightweight PHP library for handling structured error messages, useful for validation, data processing, and API responses

README 文档

README

MIT License

A simple and lightweight PHP library for handling structured error messages, useful for validation, data processing, and API responses.

Installation

composer require ap-lib/error-node

Features

  • Structured error representation
  • Easy instantiation of single or multiple errors
  • Throwable error handling
  • Simple and extensible design

Requirements

  • PHP 8.3 or higher

Getting started

Basic usage

use AP\ErrorNode\Error;
use AP\ErrorNode\Errors;
use AP\ErrorNode\ThrowableErrors;

// Creating a single error
$error = new Error("Invalid input", ["user", "email"]);

// Creating multiple errors
$errors = new Errors([
    new Error("Field is required", ["user", "name"]),
    new Error("Invalid format", ["user", "email"]),
]);

// Handling errors
if (!empty($errors->getErrors())) {
    throw $errors->getNodeErrorsThrowable();
}

统计信息

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

GitHub 信息

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

其他信息

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