Exemplo n.º 1
0
 public function __construct(VarDumpParser $parser)
 {
     $string = $parser->readUntil(")");
     if ($string === "true") {
         $this->bool = true;
     } elseif ($string === "false") {
         $this->bool = false;
     } else {
         throw new \Exception("Unknown boolean representation: {$string}");
     }
     $parser->skip(1);
 }
 public function __construct(VarDumpParser $parser)
 {
     $this->class = $parser->readUntil(")#");
     $parser->skip(2);
     $this->id = intval($parser->readUntil(" ("));
     $parser->skip(2);
     $count = intval($parser->readUntil(")"));
     $parser->readUntil("{");
     $parser->skip(1);
     $parser->ltrim();
     $this->readArray($count, $parser);
     $parser->readUntil("}");
     $parser->skip(1);
     $parser->ltrim();
 }
 public function __construct(VarDumpParser $parser)
 {
     $length = intval(trim($parser->readUntil(")")));
     $parser->readUntil("\"");
     $parser->skip(1);
     $this->string = $parser->read($length);
     $parser->skip(1);
     $parser->ltrim();
 }
Exemplo n.º 4
0
 protected function readArray($count, VarDumpParser $parser)
 {
     for ($i = 0; $i < $count; $i++) {
         $parser->skip(1);
         // [
         $key = $parser->readUntil("]=>");
         if (substr($key, 0, 1) === "\"" and substr($key, -1) === "\"") {
             $key = substr($key, 1, -1);
             $this->hasStringKey = true;
         }
         $parser->skip(4);
         $parser->ltrim();
         $value = $parser->readVar();
         $this->array[$key] = $value;
         $parser->ltrim();
     }
 }
 public function __construct(VarDumpParser $parser)
 {
     $parser->ltrim();
 }
Exemplo n.º 6
0
 public function __construct(VarDumpParser $parser)
 {
     $this->int = intval($parser->readUntil(")"));
     $parser->skip(1);
     $parser->ltrim();
 }