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
Requires
- php: ^8.0
- illuminate/support: ^12.0
Requires (Dev)
- phpunit/phpunit: ^10.0
README
PHP Inspector
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