<?php
function pr( $str, $b_obecjt=false )
{
    if( !$b_obecjt )
    {
        echo "<pre>";
        print_r( $str );
        echo "</pre>";
    }
    else
    {
        echo "<pre>";
        var_dump( $str );
        echo "</pre>";
    }
}

use Peru\Jne\DniFactory;

require 'vendor/autoload.php';

$dni = '41288353';

$factory = new DniFactory();
$cs = $factory->create();

$person = $cs->get($dni);
if (!$person) {
    echo 'Not found';
    return;
}

pr( $person );