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

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

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

            return $result;
        }
        
        $result = array_merge($result, Util::map($object, static::$resultMap), ['type' => 'file']);

        return $result;
    }
protected function normalizeResponse(array $object, $path = null)
    {
        $result = ['path' => $path ?: $this->removePathPrefix(isset($object['Key']) ? $object['Key'] : $object['Prefix'])];
        $result['dirname'] = Util::dirname($result['path']);

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

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

            return $result;
        }
        
        $result = array_merge($result, Util::map($object, static::$resultMap), ['type' => 'file']);

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

@param array  $object
@param string $path

@return array file metadata
Normalize a result from OSS .