src/Database.php
public function parseUnitInterval($unit_interval)
    {
        if (array_has(self::$static_unit_interval, $unit_interval)) {
            return array_get(self::$static_unit_interval, $unit_interval);
        }

        $unit = preg_replace('/([A-Za-z]*?)/', '', $unit_interval);
        $interval = preg_replace('/([0-9]*?)/', '', $unit_interval);

        $interval = $this->convertInterval($interval);

        if ($unit > 0 && $interval !== false) {
            return [$unit, $interval];
        }

        return [null, null];
    }
public function parseUnitInterval($unit_interval)
    {
        if (array_has(self::$static_unit_interval, $unit_interval)) {
            return array_get(self::$static_unit_interval, $unit_interval);
        }

        $unit = preg_replace('/([A-Za-z]*?)/', '', $unit_interval);
        $interval = preg_replace('/([0-9]*?)/', '', $unit_interval);

        $interval = $this->convertInterval($interval);

        if ($unit > 0 && $interval !== false) {
            return [$unit, $interval];
        }

        return [null, null];
    }
Converts a unit/interval string to the correct INTERVAL constant.

eg 1y = [1, YEAR]

@return array|null