src/ClientBase.php
protected function verifyDates($from, $to, $format = 'YmdHs')
    {
        if (!DateTime::createFromFormat($format, $from)) {
            $message = 'The $from date is improperly formatted. Please use "YmdHs".';
            throw new \InvalidArgumentException($message);
        }
        if (!DateTime::createFromFormat($format, $to)) {
            $message = 'The $to date is improperly formatted. Please use "YmdHs".';
            throw new \InvalidArgumentException($message);
        }
        if (new DateTime($from) > new DateTime($to)) {
            $message = 'The $from date cannot be a later date than the $to date.';
            throw new \InvalidArgumentException($message);
        }
    }
protected function verifyDates($from, $to, $format = 'YmdHs')
    {
        if (!DateTime::createFromFormat($format, $from)) {
            $message = 'The $from date is improperly formatted. Please use "YmdHs".';
            throw new \InvalidArgumentException($message);
        }
        if (!DateTime::createFromFormat($format, $to)) {
            $message = 'The $to date is improperly formatted. Please use "YmdHs".';
            throw new \InvalidArgumentException($message);
        }
        if (new DateTime($from) > new DateTime($to)) {
            $message = 'The $from date cannot be a later date than the $to date.';
            throw new \InvalidArgumentException($message);
        }
    }
protected function verifyDates ( $ from , $ to , $ format = 'YmdHs' ) { if ( ! DateTime :: createFromFormat ( $ format , $ from ) ) { $ message = 'The $from date is improperly formatted. Please use "YmdHs".' ; throw new \ InvalidArgumentException ( $ message ) ; } if ( ! DateTime :: createFromFormat ( $ format , $ to ) ) { $ message = 'The $to date is improperly formatted. Please use "YmdHs".' ; throw new \ InvalidArgumentException ( $ message ) ; } if ( new DateTime ( $ from ) > new DateTime ( $ to ) ) { $ message = 'The $from date cannot be a later date than the $to date.' ; throw new \ InvalidArgumentException ( $ message ) ; } }
Helper function to verify the dates are valid.

@param string $from
The beginning date.
@param $to
The end date.
@param string $format
The date format to verify.

@throws \InvalidArgumentException
Helper function to verify the dates are valid .