Command/ClientStatsCommand.php
private function setDateContext(\DateTime $dateContext = null)
    {
        if (!$dateContext) { // we havent set context so we need the default to be: now minus 15 mins, rounded to 5 min increment.
            $now = new \DateTime();
            $now->sub(new \DateInterval('PT15M'));
            // round down to 5 minute increment
            $now->setTime($now->format('H'), floor($now->format('i') / 5) * 5, 0);
            $dateContext = $now;
        }
        $this->dateContext = $dateContext;
    }
private function setDateContext(\DateTime $dateContext = null)
    {
        if (!$dateContext) { // we havent set context so we need the default to be: now minus 15 mins, rounded to 5 min increment.
            $now = new \DateTime();
            $now->sub(new \DateInterval('PT15M'));
            // round down to 5 minute increment
            $now->setTime($now->format('H'), floor($now->format('i') / 5) * 5, 0);
            $dateContext = $now;
        }
        $this->dateContext = $dateContext;
    }
private function setDateContext ( \ DateTime $ dateContext = null ) { if ( ! $ dateContext ) { // we havent set context so we need the default to be: now minus 15 mins, rounded to 5 min increment. $ now = new \ DateTime ( ) ; $ now -> sub ( new \ DateInterval ( 'PT15M' ) ) ; // round down to 5 minute increment $ now -> setTime ( $ now -> format ( 'H' ) , floor ( $ now -> format ( 'i' ) / 5 ) * 5 , 0 ) ; $ dateContext = $ now ; } $ this -> dateContext = $ dateContext ; }
This becomes the dateAdded value to use in report stats table
This will be the default To date,  which a From date is calculated by subtracting 4 mins 59s.

@param \DateTime|null $dateContext

@throws \Exception
This becomes the dateAdded value to use in report stats table This will be the default To date which a From date is calculated by subtracting 4 mins 59s .