private function validateStartEnd($start, $end)
    {
        $_startEnd = [];

        if (preg_match('/[0-9]/', $start)) {
            $_startEnd[0] = (int) $start;
        } elseif ('#' === $start) {
            $_startEnd[0] = '#';
        } else {
            throw new InvalidMARCspecException(
                InvalidMARCspecException::PR.
                InvalidMARCspecException::PR7,
                $start
            );
        }

        if (preg_match('/[0-9#]/', $end)) {
            if ('#' === $end) {
                $_startEnd[1] = '#';
            } elseif (preg_match('/[0-9]/', $end)) {
                $_startEnd[1] = (int) $end;

                if ($_startEnd[1] < $_startEnd[0]) {
                    throw new InvalidMARCspecException(
                        InvalidMARCspecException::PR.
                        InvalidMARCspecException::PR8,
                        $start.'-'.$end
                    );
                }
            } else {
                throw new InvalidMARCspecException(
                    InvalidMARCspecException::PR.
                    InvalidMARCspecException::PR8,
                    $start.'-'.$end
                );
            }
        } else {
            $_startEnd[1] = null;
        }

        return $_startEnd;
    }
private function validateStartEnd($start, $end)
    {
        $_startEnd = [];

        if (preg_match('/[0-9]/', $start)) {
            $_startEnd[0] = (int) $start;
        } elseif ('#' === $start) {
            $_startEnd[0] = '#';
        } else {
            throw new InvalidMARCspecException(
                InvalidMARCspecException::PR.
                InvalidMARCspecException::PR7,
                $start
            );
        }

        if (preg_match('/[0-9#]/', $end)) {
            if ('#' === $end) {
                $_startEnd[1] = '#';
            } elseif (preg_match('/[0-9]/', $end)) {
                $_startEnd[1] = (int) $end;

                if ($_startEnd[1] < $_startEnd[0]) {
                    throw new InvalidMARCspecException(
                        InvalidMARCspecException::PR.
                        InvalidMARCspecException::PR8,
                        $start.'-'.$end
                    );
                }
            } else {
                throw new InvalidMARCspecException(
                    InvalidMARCspecException::PR.
                    InvalidMARCspecException::PR8,
                    $start.'-'.$end
                );
            }
        } else {
            $_startEnd[1] = null;
        }

        return $_startEnd;
    }
private function validateStartEnd ( $ start , $ end ) { $ _startEnd = [ ] ; if ( preg_match ( '/[0-9]/' , $ start ) ) { $ _startEnd [ 0 ] = ( int ) $ start ; } elseif ( '#' === $ start ) { $ _startEnd [ 0 ] = '#' ; } else { throw new InvalidMARCspecException ( InvalidMARCspecException :: PR . InvalidMARCspecException :: PR7 , $ start ) ; } if ( preg_match ( '/[0-9#]/' , $ end ) ) { if ( '#' === $ end ) { $ _startEnd [ 1 ] = '#' ; } elseif ( preg_match ( '/[0-9]/' , $ end ) ) { $ _startEnd [ 1 ] = ( int ) $ end ; if ( $ _startEnd [ 1 ] < $ _startEnd [ 0 ] ) { throw new InvalidMARCspecException ( InvalidMARCspecException :: PR . InvalidMARCspecException :: PR8 , $ start . '-' . $ end ) ; } } else { throw new InvalidMARCspecException ( InvalidMARCspecException :: PR . InvalidMARCspecException :: PR8 , $ start . '-' . $ end ) ; } } else { $ _startEnd [ 1 ] = null ; } return $ _startEnd ; }
Validate starting and ending position.

@internal

@param int|string $start The starting position
@param int|string $end   The ending position

@throws CK\MARCspec\Exception\InvalidMARCspecException

@return null|array $_startEnd index 0 => start, index 1 => end
Validate starting and ending position .