Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 86eb0d1

Browse filesBrowse files
authored
Merge branch 'master' into create-pull-request/patch
2 parents f9494a3 + 8190071 commit 86eb0d1
Copy full SHA for 86eb0d1

File tree

Expand file treeCollapse file tree

8 files changed

+40
-34
lines changed
Filter options
Expand file treeCollapse file tree

8 files changed

+40
-34
lines changed

‎composer.json

Copy file name to clipboardExpand all lines: composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"phpstan/phpstan": "*",
3131
"phpunit/phpunit": "*",
3232
"squizlabs/php_codesniffer": "*",
33-
"vimeo/psalm": ">=5.26.1"
33+
"vimeo/psalm": ">=5.26.1,<6.7"
3434
},
3535
"suggest": {
3636
"ext-mbstring": "*"

‎scripts/make_release_requirements.txt

Copy file name to clipboardExpand all lines: scripts/make_release_requirements.txt
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ deprecated==1.2.14
1919
gitdb==4.0.11
2020
# via gitpython
2121
gitpython==3.1.44
22-
# via -r make_release_requirements.in
22+
# via -r scripts/make_release_requirements.in
2323
idna==3.7
2424
# via requests
2525
pycparser==2.22
2626
# via cffi
27-
pygithub==2.5.0
28-
# via -r make_release_requirements.in
27+
pygithub==2.6.0
28+
# via -r scripts/make_release_requirements.in
2929
pyjwt[crypto]==2.8.0
3030
# via pygithub
3131
pynacl==1.5.0

‎src/Curl/Curl.php

Copy file name to clipboardExpand all lines: src/Curl/Curl.php
+14-13Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public function download($url, $mixed_filename)
328328
// Attempt to resume download only when a temporary download file exists and is not empty.
329329
if (is_file($download_filename) && $filesize = filesize($download_filename)) {
330330
$first_byte_position = $filesize;
331-
$range = $first_byte_position . '-';
331+
$range = (string)$first_byte_position . '-';
332332
$this->setRange($range);
333333
$this->fileHandle = fopen($download_filename, 'ab');
334334
} else {
@@ -385,7 +385,7 @@ public function fastDownload($url, $filename, $connections = 4)
385385
}
386386

387387
// Divide chunk_size across the number of connections.
388-
$chunk_size = ceil($content_length / $connections);
388+
$chunk_size = (int)ceil($content_length / $connections);
389389

390390
// Keep track of file name parts.
391391
$part_file_names = [];
@@ -399,9 +399,9 @@ public function fastDownload($url, $filename, $connections = 4)
399399
if ($part_number === $connections) {
400400
$range_end = '';
401401
}
402-
$range = $range_start . '-' . $range_end;
402+
$range = (string)$range_start . '-' . (string)$range_end;
403403

404-
$part_file_name = $filename . '.part' . $part_number;
404+
$part_file_name = $filename . '.part' . (string)$part_number;
405405

406406
// Save the file name of this part.
407407
$part_file_names[] = $part_file_name;
@@ -1294,27 +1294,27 @@ public function diagnose($return = false)
12941294
$response_headers_count = count($this->responseHeaders);
12951295

12961296
echo
1297-
'Request contained ' . $request_options_count . ' ' . (
1297+
'Request contained ' . (string)$request_options_count . ' ' . (
12981298
$request_options_count === 1 ? 'option:' : 'options:'
12991299
) . "\n";
13001300
if ($request_options_count) {
13011301
$i = 1;
13021302
foreach ($this->options as $option => $value) {
1303-
echo ' ' . $i . ' ';
1303+
echo ' ' . (string)$i . ' ';
13041304
$this->displayCurlOptionValue($option, $value);
13051305
$i += 1;
13061306
}
13071307
}
13081308

13091309
echo
13101310
'Sent an HTTP ' . $request_method . ' request to "' . $request_url . '".' . "\n" .
1311-
'Request contained ' . $request_headers_count . ' ' . (
1311+
'Request contained ' . (string)$request_headers_count . ' ' . (
13121312
$request_headers_count === 1 ? 'header:' : 'headers:'
13131313
) . "\n";
13141314
if ($request_headers_count) {
13151315
$i = 1;
13161316
foreach ($this->requestHeaders as $key => $value) {
1317-
echo ' ' . $i . ' ' . $key . ': ' . $value . "\n";
1317+
echo ' ' . (string)$i . ' ' . $key . ': ' . $value . "\n";
13181318
$i += 1;
13191319
}
13201320
}
@@ -1346,13 +1346,13 @@ public function diagnose($return = false)
13461346
}
13471347

13481348
echo
1349-
'Response contains ' . $response_headers_count . ' ' . (
1349+
'Response contains ' . (string)$response_headers_count . ' ' . (
13501350
$response_headers_count === 1 ? 'header:' : 'headers:'
13511351
) . "\n";
13521352
if ($this->responseHeaders !== null) {
13531353
$i = 1;
13541354
foreach ($this->responseHeaders as $key => $value) {
1355-
echo ' ' . $i . ' ' . $key . ': ' . $value . "\n";
1355+
echo ' ' . (string)$i . ' ' . $key . ': ' . $value . "\n";
13561356
$i += 1;
13571357
}
13581358
}
@@ -1409,12 +1409,13 @@ public function diagnose($return = false)
14091409
$messages_count = count($messages);
14101410
if ($messages_count) {
14111411
echo
1412-
'Found ' . $messages_count . ' ' . ($messages_count === 1 ? 'message' : 'messages') .
1412+
'Found ' . (string)$messages_count . ' ' .
1413+
($messages_count === 1 ? 'message' : 'messages') .
14131414
' in response:' . "\n";
14141415

14151416
$i = 1;
14161417
foreach ($messages as $message) {
1417-
echo ' ' . $i . ' ' . $message . "\n";
1418+
echo ' ' . (string)$i . ' ' . $message . "\n";
14181419
$i += 1;
14191420
}
14201421
}
@@ -1713,7 +1714,7 @@ public function displayCurlOptionValue($option, $value = null)
17131714
if (is_string($value)) {
17141715
echo ' "' . $value . '"' . "\n";
17151716
} elseif (is_int($value)) {
1716-
echo ' ' . $value;
1717+
echo ' ' . (string)$value;
17171718

17181719
$bit_flag_lookups = [
17191720
'CURLOPT_HTTPAUTH' => 'CURLAUTH_',

‎src/Curl/MultiCurl.php

Copy file name to clipboardExpand all lines: src/Curl/MultiCurl.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function addDownload($url, $mixed_filename)
111111
// Attempt to resume download only when a temporary download file exists and is not empty.
112112
if (is_file($download_filename) && $filesize = filesize($download_filename)) {
113113
$first_byte_position = $filesize;
114-
$range = $first_byte_position . '-';
114+
$range = (string)$first_byte_position . '-';
115115
$curl->setRange($range);
116116
$curl->fileHandle = fopen($download_filename, 'ab');
117117

@@ -587,7 +587,7 @@ public function setRateLimit($rate_limit)
587587
$interval_seconds = $interval * 3600;
588588
}
589589

590-
$this->rateLimit = $max_requests . '/' . $interval . $unit;
590+
$this->rateLimit = (string)$max_requests . '/' . (string)$interval . $unit;
591591
$this->rateLimitEnabled = true;
592592
$this->maxRequests = $max_requests;
593593
$this->interval = $interval;

‎tests/PHPCurlClass/PHPCurlClassTest.php

Copy file name to clipboardExpand all lines: tests/PHPCurlClass/PHPCurlClassTest.php
+3-15Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3186,33 +3186,21 @@ public function testCookieJarAfterClose()
31863186
$this->assertNotEmpty($cookies);
31873187
}
31883188

3189-
/**
3190-
* @requires PHPUnit < 10
3191-
* @expectedException \PHPUnit\Framework\Error\Warning
3192-
*/
3193-
public function testRequiredOptionCurlOptReturnTransferEmitsWarning()
3194-
{
3195-
$this->expectWarning(\PHPUnit\Framework\Error\Warning::class);
3196-
3197-
$curl = new Curl();
3198-
$curl->setOpt(CURLOPT_RETURNTRANSFER, false);
3199-
}
3200-
32013189
/**
32023190
* @requires PHPUnit >= 10
32033191
*/
3192+
#[RequiresPhpunit('>= 10')]
32043193
public function testRequiredOptionCurlOptReturnTransferEmitsWarningPHPUnit10Plus()
32053194
{
32063195
set_error_handler(static function (int $errno, string $errstr): never {
3196+
restore_error_handler();
32073197
throw new \Exception($errstr, $errno);
32083198
}, E_USER_WARNING);
32093199

32103200
$this->expectExceptionMessage('CURLOPT_RETURNTRANSFER is a required option');
32113201

32123202
$curl = new Curl();
32133203
$curl->setOpt(CURLOPT_RETURNTRANSFER, false);
3214-
3215-
restore_error_handler();
32163204
}
32173205

32183206
public function testRequestMethodSuccessiveGetRequests()
@@ -3966,7 +3954,7 @@ public function testMock()
39663954

39673955
$curl->expects($this->once())
39683956
->method('getRawResponse')
3969-
->will($this->returnValue('[]'));
3957+
->willReturn('[]');
39703958

39713959
$this->assertEquals('[]', $curl->getRawResponse());
39723960
}

‎tests/psalm.xml

Copy file name to clipboardExpand all lines: tests/psalm.xml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0"?>
22
<!-- TODO: Use errorLevel="1" -->
33
<psalm
4+
ensureOverrideAttribute="false"
45
errorLevel="4"
56
resolveFromConfigFile="true"
67
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

‎tests/run.sh

Copy file name to clipboardExpand all lines: tests/run.sh
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ source "run_static_analysis_check_phpstan.sh"
3333

3434
source "run_static_analysis_check_psalm.sh"
3535

36+
set +x
37+
3638
source "display_errors.inc.sh"
3739

3840
if [[ "${CI_PHP_FUTURE_RELEASE}" != "true" ]]; then

‎tests/run_phpunit.sh

Copy file name to clipboardExpand all lines: tests/run_phpunit.sh
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ phpunit_v10_shim() {
5757
remove_expectWarning
5858
}
5959

60+
phpunit_v11_shim() {
61+
:;
62+
}
63+
64+
phpunit_v12_shim() {
65+
remove_expectWarning
66+
}
67+
6068
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6169
cd "${SCRIPT_DIR}"
6270

@@ -101,6 +109,12 @@ elif [[ "${phpunit_version}" == "9."* ]]; then
101109
elif [[ "${phpunit_version}" == "10."* ]]; then
102110
phpunit_v10_shim
103111
phpunit_args=" --display-incomplete --display-skipped --display-deprecations --display-errors --display-notices --display-warnings --fail-on-risky ${extra_args}"
112+
elif [[ "${phpunit_version}" == "11."* ]]; then
113+
phpunit_v11_shim
114+
phpunit_args=" --display-incomplete --display-skipped --display-deprecations --display-errors --display-notices --display-warnings --fail-on-risky ${extra_args}"
115+
elif [[ "${phpunit_version}" == "12."* ]]; then
116+
phpunit_v12_shim
117+
phpunit_args=" --display-incomplete --display-skipped --display-deprecations --display-errors --display-notices --display-warnings --fail-on-risky ${extra_args}"
104118
fi
105119

106120
# Run tests.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.