承接 xakki/reflection-info 相关项目开发

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

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

xakki/reflection-info

最新稳定版本:1.1

Composer 安装命令:

composer require xakki/reflection-info

包简介

PHP - Reflection information from object

README 文档

README

Latest Stable Version Total Downloads License

A PHP library for deep, recursive analysis of variables, objects, and classes using reflection. It provides a structured and detailed view of your data, making it ideal for debugging, logging, and serialization tasks.

Features

  • Recursive Analysis: Traverses nested objects and arrays to build a complete data tree.
  • Circular Reference Protection: Detects and handles recursion to prevent infinite loops.
  • Depth Control: Allows you to set a maximum depth for the analysis to manage performance and output size.
  • Detailed Class Information: Extracts class name, parent class, interfaces, traits, constants, file path, and doc comments.
  • Comprehensive Property Details: Gathers property names, visibility, values, static status, and doc comments.
  • In-depth Method Analysis: Retrieves method names, visibility, parameters (with types and default values), static/final/abstract status, and doc comments.
  • Structured DTOs: Returns the analysis result as a clean and easy-to-navigate tree of Data Transfer Objects (DTOs).

Installation

Install the library using Composer:

composer require xakki/reflection-info

Usage

Using the library is straightforward. Instantiate the Analyzer and pass the variable you want to inspect to the analyze() method.

<?php

require 'vendor/autoload.php';

use Xakki\ReflectionInfo\Analyzer;
use Xakki\ReflectionInfo\ReflectionInfo;

class MyClass {
    private string $secret = 's3cr3t';
    public int $publicProp = 123;
    
    public function doSomething(string $param1, bool $param2 = true): void
    {
        // ...
    }
}

$myObject = new MyClass();

ReflectionInfo::renderObjectInfo($myObject);

License

This library is licensed under the MIT License.

统计信息

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

GitHub 信息

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

其他信息

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