Debugging

The debugging middleware allows you to log the current state of the ongoing map method. The state of the json and object inputs as well as the property map will be logged to an PSR-3 compliant logger

$mapper = (new \JsonMapper\JsonMapperFactory())->default();

# Add the debug middleware with an PSR compliant logger
$logger = new \Psr\Log\Test\TestLogger();
$mapper->push(new \JsonMapper\Middleware\Debugger($logger));

$object = new \Tests\JsonMapper\Implementation\SimpleObject();
$mapper->mapObjectFromString('{ "Name": "John Doe" }', $object);

var_dump($logger->records);