/** * @throws ParseException * @param string $line * @return bool */ public function isMainAgency($line) { if ($this->encoding->strlen($line) < self::TYPE_OFFSET + self::TYPE_LENGTH) { throw new ParseException("Invalid line length."); } return $this->encoding->substr($line, self::ISMAIN_OFFSET, 1) === '1'; }