<?php
namespace App\Sabre\LineParser\Types; class Integer extends \App\Utils\BaseParser\TextParser\Types\Integer { protected $extractRegexp = "/^(?P<rawData>[0-9 ]__LENGHTS__)/"; protected function formatExtractedData($str, $matchesObj) { if (ltrim($str, ' ')==='') { return ''; } elseif (ltrim($str, '0')!=='') { return (int)$str; } else { return 0; } return null; } } 