Beispiel #1
0
function parse($bytesAsString)
{
    $lastParseException = null;
    $parsers = [Metric::parser(), Binary::parser()];
    foreach ($parsers as $parser) {
        try {
            return $parser->parse($bytesAsString);
        } catch (\Exception $e) {
            $lastParseException = $e;
        }
    }
    throw $lastParseException;
}
Beispiel #2
0
 /**
  * parse method
  *
  * @param $bytesAsString
  * @return $this
  */
 public static function parse($bytesAsString)
 {
     return parent::parse($bytesAsString);
 }