Skip to content

Commit

Permalink
Support PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Dec 6, 2021
1 parent 01b4151 commit d406c88
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 20 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
strategy:
matrix:
php:
- 8.1
- 8.0
- 7.4
- 7.3
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"react/event-loop": "^1.2",
"react/promise": "^2.7",
"react/promise-stream": "^1.1",
"react/promise-timer": "^1.5",
"react/promise-timer": "^1.8",
"react/socket": "^1.9"
},
"require-dev": {
Expand Down
10 changes: 2 additions & 8 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@

<!-- PHPUnit configuration file with new format for PHPUnit 9.3+ -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
backupStaticAttributes="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheResult="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
colors="true"
processIsolation="false"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
convertDeprecationsToExceptions="true">
<testsuites>
<testsuite name="React.MySQL Test Suite">
<directory>./tests/</directory>
Expand Down
11 changes: 2 additions & 9 deletions phpunit.xml.legacy
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@

<!-- PHPUnit configuration file with old format for PHPUnit 9.2 or older -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
backupStaticAttributes="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/4.8/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/4.8/phpunit.xsd">
colors="true">
<testsuites>
<testsuite name="React.MySQL Test Suite">
<directory>./tests/</directory>
Expand Down
2 changes: 1 addition & 1 deletion src/Io/LazyConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class LazyConnection extends EventEmitter implements ConnectionInterface
public function __construct(Factory $factory, $uri, LoopInterface $loop)
{
$args = [];
\parse_str(\parse_url($uri, \PHP_URL_QUERY), $args);
\parse_str((string) \parse_url($uri, \PHP_URL_QUERY), $args);
if (isset($args['idle'])) {
$this->idlePeriod = (float)$args['idle'];
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ResultQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function testSelectStaticValueWillBeReturnedAsIs($value)
*/
public function testSelectStaticValueWillBeReturnedAsIsWithNoBackslashEscapesSqlMode($value)
{
if (strpos($value, '\\') !== false) {
if ($value !== null && strpos($value, '\\') !== false) {
// TODO: strings such as '%\\' work as-is when string contains percent?!
$this->markTestIncomplete('Escaping backslash not supported when using NO_BACKSLASH_ESCAPES SQL mode');
}
Expand Down

0 comments on commit d406c88

Please sign in to comment.