Skip to content

Commit b61d817

Browse files
committed
Rename rename arguments to match CS rules
1 parent cfeae45 commit b61d817

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

phpcs.xml.dist

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,4 @@
162162
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
163163
<exclude-pattern>/docs/examples/codecs/</exclude-pattern>
164164
</rule>
165-
166-
<!-- **************************************** -->
167-
<!-- Exclude certain rules for stream wrapper -->
168-
<!-- **************************************** -->
169-
<rule ref="Squiz.NamingConventions.ValidVariableName.NotCamelCaps">
170-
<exclude-pattern>/src/GridFS/StreamWrapper.php</exclude-pattern>
171-
</rule>
172165
</ruleset>

src/GridFS/StreamWrapper.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,20 @@ public static function register(string $protocol = 'gridfs'): void
9898
*
9999
* @return bool True on success or false on failure.
100100
*/
101-
public function rename(string $path_from, string $path_to): bool
101+
public function rename(string $fromPath, string $toPath): bool
102102
{
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);
106106
}
107107

108108
try {
109-
$this->stream_open($path_from, 'r', 0, $openedPath);
109+
$this->stream_open($fromPath, 'r', 0, $openedPath);
110110
} catch (FileNotFoundException $e) {
111111
return false;
112112
}
113113

114-
$newName = explode('/', $path_to, 4)[3] ?? '';
114+
$newName = explode('/', $toPath, 4)[3] ?? '';
115115
assert($this->stream instanceof ReadableStream);
116116

117117
return $this->stream->rename($newName) > 0;

0 commit comments

Comments
 (0)