protected function normalizeResponse(array $response, $path = null)
    {
        $result = [
            'path' => $path ?: $this->removePathPrefix(
                isset($response['Key']) ? $response['Key'] : $response['Prefix']
            ),
        ];
        $result = array_merge($result, Util::pathinfo($result['path']));

        if (isset($response['LastModified'])) {
            $result['timestamp'] = strtotime($response['LastModified']);
        }

        if (substr($result['path'], -1) === '/') {
            $result['type'] = 'dir';
            $result['path'] = rtrim($result['path'], '/');

            return $result;
        }

        return array_merge($result, Util::map($response, static::$resultMap), ['type' => 'file']);
    }
protected function normalizeResponse(array $response, $path = null)
    {
        $result = [
            'path' => $path ?: $this->removePathPrefix(
                isset($response['Key']) ? $response['Key'] : $response['Prefix']
            ),
        ];
        $result = array_merge($result, Util::pathinfo($result['path']));

        if (isset($response['LastModified'])) {
            $result['timestamp'] = strtotime($response['LastModified']);
        }

        if (substr($result['path'], -1) === '/') {
            $result['type'] = 'dir';
            $result['path'] = rtrim($result['path'], '/');

            return $result;
        }

        return array_merge($result, Util::map($response, static::$resultMap), ['type' => 'file']);
    }
protected function normalizeResponse ( array $ response , $ path = null ) { $ result = [ 'path' => $ path ? : $ this -> removePathPrefix ( isset ( $ response [ 'Key' ] ) ? $ response [ 'Key' ] : $ response [ 'Prefix' ] ) , ] ; $ result = array_merge ( $ result , Util :: pathinfo ( $ result [ 'path' ] ) ) ; if ( isset ( $ response [ 'LastModified' ] ) ) { $ result [ 'timestamp' ] = strtotime ( $ response [ 'LastModified' ] ) ; } if ( substr ( $ result [ 'path' ] , - 1 ) === '/' ) { $ result [ 'type' ] = 'dir' ; $ result [ 'path' ] = rtrim ( $ result [ 'path' ] , '/' ) ; return $ result ; } return array_merge ( $ result , Util :: map ( $ response , static :: $ resultMap ) , [ 'type' => 'file' ] ) ; }
Normalize the object result array.

@param array  $response
@param string $path

@return array
Normalize the object result array .