Skip to content

Commit 2357105

Browse files
authored
chore: enable ambiguous-function-call rule, and make all call sites explicit (#706)
1 parent 7fadecb commit 2357105

29 files changed

Lines changed: 72 additions & 25 deletions

src/Psl/Encoding/Base64/DecodingReadHandle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ private function fillBuffer(CancellationTokenInterface $cancellation = new NullC
262262
$this->eof = true;
263263
// Decode any remaining bytes.
264264
if ($this->remainder !== '') {
265-
$this->buffer .= decode($this->remainder, $this->variant, $this->padding);
265+
$this->buffer .= namespace\decode($this->remainder, $this->variant, $this->padding);
266266
$this->remainder = '';
267267
}
268268

@@ -279,7 +279,7 @@ private function fillBuffer(CancellationTokenInterface $cancellation = new NullC
279279
$usable = $length - ($length % 4);
280280

281281
if ($usable > 0) {
282-
$this->buffer .= decode(substr($data, 0, $usable), $this->variant, $this->padding);
282+
$this->buffer .= namespace\decode(substr($data, 0, $usable), $this->variant, $this->padding);
283283
$this->remainder = substr($data, $usable);
284284
} else {
285285
$this->remainder = $data;

src/Psl/Encoding/Base64/DecodingWriteHandle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function tryWrite(string $bytes): int
4444
$usable = $dataLength - ($dataLength % 4);
4545

4646
if ($usable > 0) {
47-
$decoded = decode(substr($data, 0, $usable), $this->variant, $this->padding);
47+
$decoded = namespace\decode(substr($data, 0, $usable), $this->variant, $this->padding);
4848
$this->handle->writeAll($decoded);
4949
$this->remainder = substr($data, $usable);
5050
} else {
@@ -70,7 +70,7 @@ public function write(string $bytes, CancellationTokenInterface $cancellation =
7070
public function flush(): void
7171
{
7272
if ($this->remainder !== '') {
73-
$decoded = decode($this->remainder, $this->variant, $this->padding);
73+
$decoded = namespace\decode($this->remainder, $this->variant, $this->padding);
7474
$this->remainder = '';
7575
$this->handle->writeAll($decoded);
7676
}

src/Psl/Encoding/Base64/EncodingReadHandle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,14 @@ private function fillBuffer(CancellationTokenInterface $cancellation = new NullC
258258
// @codeCoverageIgnoreEnd
259259
}
260260

261-
$chunk = $this->handle->read(CHUNK_SIZE, $cancellation);
261+
$chunk = $this->handle->read(namespace\CHUNK_SIZE, $cancellation);
262262
if ($chunk === '' && $this->handle->reachedEndOfDataSource()) {
263263
$this->eof = true;
264264
return;
265265
}
266266

267267
if ($chunk !== '') {
268-
$this->buffer .= encode($chunk, $this->variant, $this->padding) . LINE_ENDING;
268+
$this->buffer .= namespace\encode($chunk, $this->variant, $this->padding) . namespace\LINE_ENDING;
269269
}
270270
}
271271
}

src/Psl/Encoding/Base64/EncodingWriteHandle.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ public function tryWrite(string $bytes): int
3636
$data = $this->remainder . $bytes;
3737

3838
$dataLength = strlen($data);
39-
while ($dataLength >= CHUNK_SIZE) {
40-
$chunk = substr($data, 0, CHUNK_SIZE);
41-
$data = substr($data, CHUNK_SIZE);
42-
$dataLength -= CHUNK_SIZE;
39+
while ($dataLength >= namespace\CHUNK_SIZE) {
40+
$chunk = substr($data, 0, namespace\CHUNK_SIZE);
41+
$data = substr($data, namespace\CHUNK_SIZE);
42+
$dataLength -= namespace\CHUNK_SIZE;
4343

44-
$encoded = encode($chunk, $this->variant, $this->padding) . LINE_ENDING;
44+
$encoded = namespace\encode($chunk, $this->variant, $this->padding) . namespace\LINE_ENDING;
4545
$this->handle->writeAll($encoded);
4646
}
4747

@@ -63,7 +63,7 @@ public function write(string $bytes, CancellationTokenInterface $cancellation =
6363
public function flush(): void
6464
{
6565
if ($this->remainder !== '') {
66-
$encoded = encode($this->remainder, $this->variant, $this->padding) . LINE_ENDING;
66+
$encoded = namespace\encode($this->remainder, $this->variant, $this->padding) . namespace\LINE_ENDING;
6767
$this->remainder = '';
6868
$this->handle->writeAll($encoded);
6969
}

src/Psl/Encoding/EncodedWord/Internal/decode_payload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function decode_payload(string $encoding, string $text): string
3131
}
3232

3333
if ($encoding === EncodedWord\Q_ENCODING) {
34-
return q_decode($text);
34+
return namespace\q_decode($text);
3535
}
3636

3737
// @codeCoverageIgnoreStart

src/Psl/Encoding/EncodedWord/Internal/encode_q_words.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function encode_q_words(string $text, string $prefix, string $suffix, int $maxPa
2121

2222
for ($i = 0; $i < $len; $i++) {
2323
$byte = $text[$i];
24-
$encoded = q_encode_byte($byte);
24+
$encoded = namespace\q_encode_byte($byte);
2525
$encodedLen = strlen($encoded);
2626

2727
// @codeCoverageIgnoreStart

src/Psl/Encoding/Hex/DecodingReadHandle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ private function fillBuffer(CancellationTokenInterface $cancellation = new NullC
261261
// Decode any remaining bytes.
262262
if ($this->remainder !== '') {
263263
// @codeCoverageIgnoreStart
264-
$this->buffer .= decode($this->remainder);
264+
$this->buffer .= namespace\decode($this->remainder);
265265
$this->remainder = '';
266266
// @codeCoverageIgnoreEnd
267267
}
@@ -276,7 +276,7 @@ private function fillBuffer(CancellationTokenInterface $cancellation = new NullC
276276
$usable = $length - ($length % 2);
277277

278278
if ($usable > 0) {
279-
$this->buffer .= decode(substr($data, 0, $usable));
279+
$this->buffer .= namespace\decode(substr($data, 0, $usable));
280280
$this->remainder = substr($data, $usable);
281281
} else {
282282
// @codeCoverageIgnoreStart

src/Psl/Encoding/Hex/DecodingWriteHandle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function tryWrite(string $bytes): int
3939
$usable = $dataLength - ($dataLength % 2);
4040

4141
if ($usable > 0) {
42-
$decoded = decode(substr($data, 0, $usable));
42+
$decoded = namespace\decode(substr($data, 0, $usable));
4343
$this->handle->writeAll($decoded);
4444
$this->remainder = substr($data, $usable);
4545
} else {
@@ -66,7 +66,7 @@ public function flush(): void
6666
{
6767
if ($this->remainder !== '') {
6868
// @codeCoverageIgnoreStart
69-
$decoded = decode($this->remainder);
69+
$decoded = namespace\decode($this->remainder);
7070
$this->remainder = '';
7171
$this->handle->writeAll($decoded);
7272
// @codeCoverageIgnoreEnd

src/Psl/Encoding/Hex/EncodingReadHandle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ private function fillBuffer(CancellationTokenInterface $cancellation = new NullC
262262
}
263263

264264
if ($chunk !== '') {
265-
$this->buffer .= encode($chunk);
265+
$this->buffer .= namespace\encode($chunk);
266266
}
267267
}
268268
}

src/Psl/Encoding/Hex/EncodingWriteHandle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function tryWrite(string $bytes): int
3131
$length = strlen($bytes);
3232

3333
if ($length > 0) {
34-
$encoded = encode($bytes);
34+
$encoded = namespace\encode($bytes);
3535
$this->handle->writeAll($encoded);
3636
}
3737

0 commit comments

Comments
 (0)