protected function prepareData(RequestInterface $request, User $user)
    {
        $userId = $user->getIdentifier();
        if ($userId === null) {
            $userId = get_class($user);
        }

        return [
            RequestLogService::USER_ID => $userId,
            RequestLogService::USER_ROLES => ','. implode(',', $user->getRoles()). ',',
            RequestLogService::ACTION => $request->getUri()->getPath(),
            RequestLogService::EVENT_TIME => microtime(true),
            RequestLogService::DETAILS => json_encode([
                'method' => $request->getMethod(),
                'query' => $request->getUri()->getQuery(),
            ]),
        ];
    }
protected function prepareData(RequestInterface $request, User $user)
    {
        $userId = $user->getIdentifier();
        if ($userId === null) {
            $userId = get_class($user);
        }

        return [
            RequestLogService::USER_ID => $userId,
            RequestLogService::USER_ROLES => ','. implode(',', $user->getRoles()). ',',
            RequestLogService::ACTION => $request->getUri()->getPath(),
            RequestLogService::EVENT_TIME => microtime(true),
            RequestLogService::DETAILS => json_encode([
                'method' => $request->getMethod(),
                'query' => $request->getUri()->getQuery(),
            ]),
        ];
    }
protected function prepareData ( RequestInterface $ request , User $ user ) { $ userId = $ user -> getIdentifier ( ) ; if ( $ userId === null ) { $ userId = get_class ( $ user ) ; } return [ RequestLogService :: USER_ID => $ userId , RequestLogService :: USER_ROLES => ',' . implode ( ',' , $ user -> getRoles ( ) ) . ',' , RequestLogService :: ACTION => $ request -> getUri ( ) -> getPath ( ) , RequestLogService :: EVENT_TIME => microtime ( true ) , RequestLogService :: DETAILS => json_encode ( [ 'method' => $ request -> getMethod ( ) , 'query' => $ request -> getUri ( ) -> getQuery ( ) , ] ) , ] ; }
Prepare data to log

@param RequestInterface $request
@param User $user
@return array
Prepare data to log