public function trim($log)
    {
        $period = new \DateTime('-7 day');
        if ($log === 'change') {
            $this->changeRepository->trimLog($period);
        } elseif ($log === 'system') {
            $this->systemRepository->trimLog($period);
        } else {
            throw new \UnexpectedValueException("Invalid log type requested: $log");
        }
    }
public function trim($log)
    {
        $period = new \DateTime('-7 day');
        if ($log === 'change') {
            $this->changeRepository->trimLog($period);
        } elseif ($log === 'system') {
            $this->systemRepository->trimLog($period);
        } else {
            throw new \UnexpectedValueException("Invalid log type requested: $log");
        }
    }
public function trim ( $ log ) { $ period = new \ DateTime ( '-7 day' ) ; if ( $ log === 'change' ) { $ this -> changeRepository -> trimLog ( $ period ) ; } elseif ( $ log === 'system' ) { $ this -> systemRepository -> trimLog ( $ period ) ; } else { throw new \ UnexpectedValueException ( "Invalid log type requested: $log" ) ; } }
Trim the log.

@param string $log

@throws \UnexpectedValueException
Trim the log .