marcuwynu23/php-inspector

A PHP-friendly developer tool for logging and inspecting PHP classes, objects, and data structures.

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/marcuwynu23/php-inspector

v1.0.2 2025-11-05 00:10 UTC

This package is auto-updated.

Last update: 2025-12-11 05:52:28 UTC


README

PHP Inspector

Stars Badge Forks Badge Issues Badge License Badge

A PHP-friendly developer tool for logging and inspecting PHP classes, objects, and data structures.

Features

  • Log detailed information about a class or object:
    • Class name and parent
    • Interfaces and traits
    • Constants, methods, and properties
  • Pretty-printed JSON output for easier debugging
  • Can handle objects, classes, arrays, and primitives
  • Simple integration with Laravel's logging system (or standard output)

Installation

Install via Composer:

composer require marcuwynu23/php-inspector

For developrnent and testing:

composer require --dev phpunit/phpunit

Usage

Log a Class

use Marcuwynu23\PHPInspector\PHPInspector;

PHPInspector::log(\DateTime::class);

Log an Object

$obj = new stdClass();
$obj->foo = 'bar';

PHPInspector::log($obj);

Log an Array or Primitive

PHPInspector::log(['foo' => 'bar']);
PHPInspector::log('Hello World');

All output will be printed in JSON format to stdout (or Laravel log if used in Laravel).

Running Tests

This library uses PHPUnit 10 for testing. Run tests using Composer.

composer test

This will execute:

vendor\bin\phpunit.bat --colors=always