protected function pack($data, $statusCode=200, $message=null)
    {
        $packBody = [];

        // Status Code
        if ($statusCode) {
            
            $packBody['code'] = $statusCode;
        }
        // Message
        if ($message) {
            
            $packBody['message'] = $message;
        }
        // Data
        if (is_array($data) || is_string($data)) {
            
            $packBody['data'] = $data;
        }
        
        return $packBody;
    }
protected function pack($data, $statusCode=200, $message=null)
    {
        $packBody = [];

        // Status Code
        if ($statusCode) {
            
            $packBody['code'] = $statusCode;
        }
        // Message
        if ($message) {
            
            $packBody['message'] = $message;
        }
        // Data
        if (is_array($data) || is_string($data)) {
            
            $packBody['data'] = $data;
        }
        
        return $packBody;
    }
protected function pack ( $ data , $ statusCode = 200 , $ message = null ) { $ packBody = [ ] ; // Status Code if ( $ statusCode ) { $ packBody [ 'code' ] = $ statusCode ; } // Message if ( $ message ) { $ packBody [ 'message' ] = $ message ; } // Data if ( is_array ( $ data ) || is_string ( $ data ) ) { $ packBody [ 'data' ] = $ data ; } return $ packBody ; }
Pack array data into body format

You could override this method for your application standard

@param array|mixed $data Original data
@param int HTTP Status Code
@param string Callback message
@return array Packed data
@example
$packedData = pack(['bar'=>'foo], 401, 'Login Required');
Pack array data into body format