@@ -98,20 +98,20 @@ public static function register(string $protocol = 'gridfs'): void
98
98
*
99
99
* @return bool True on success or false on failure.
100
100
*/
101
- public function rename (string $ path_from , string $ path_to ): bool
101
+ public function rename (string $ fromPath , string $ toPath ): bool
102
102
{
103
- $ prefix = implode ('/ ' , array_slice (explode ('/ ' , $ path_from , 4 ), 0 , 3 )) . '/ ' ;
104
- if (! str_starts_with ($ path_to , $ prefix )) {
105
- throw LogicException::renamePathMismatch ($ path_from , $ path_to );
103
+ $ prefix = implode ('/ ' , array_slice (explode ('/ ' , $ fromPath , 4 ), 0 , 3 )) . '/ ' ;
104
+ if (! str_starts_with ($ toPath , $ prefix )) {
105
+ throw LogicException::renamePathMismatch ($ fromPath , $ toPath );
106
106
}
107
107
108
108
try {
109
- $ this ->stream_open ($ path_from , 'r ' , 0 , $ openedPath );
109
+ $ this ->stream_open ($ fromPath , 'r ' , 0 , $ openedPath );
110
110
} catch (FileNotFoundException $ e ) {
111
111
return false ;
112
112
}
113
113
114
- $ newName = explode ('/ ' , $ path_to , 4 )[3 ] ?? '' ;
114
+ $ newName = explode ('/ ' , $ toPath , 4 )[3 ] ?? '' ;
115
115
assert ($ this ->stream instanceof ReadableStream);
116
116
117
117
return $ this ->stream ->rename ($ newName ) > 0 ;
0 commit comments