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