File: /home/xedaptot/work.naniguide.com/vendor/gitonomy/gitlib/src/Gitonomy/Git/Parser/TreeParser.php
<?php
/**
* This file is part of Gitonomy.
*
* (c) Alexandre Salomé <[email protected]>
* (c) Julien DIDIER <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Gitonomy\Git\Parser;
class TreeParser extends ParserBase
{
public $entries = [];
protected function doParse()
{
while (!$this->isFinished()) {
$vars = $this->consumeRegexp('/\d{6}/A');
$mode = $vars[0];
$this->consume(' ');
$vars = $this->consumeRegexp('/(blob|tree|commit)/A');
$type = $vars[0];
$this->consume(' ');
$hash = $this->consumeHash();
$this->consume("\t");
$name = $this->consumeTo("\n");
$this->consumeNewLine();
$this->entries[] = [$mode, $type, $hash, $name];
}
}
}