Skip to content

Commit

Permalink
Merge pull request #228 from remicollet/issue-php82
Browse files Browse the repository at this point in the history
fix 8.2 deprecations
  • Loading branch information
bluca authored Jan 6, 2023
2 parents ee5fbc6 + 68d4bf0 commit 84f0720
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions tests/007-addremovepoll.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ $z = create_client();
$socket_server = stream_socket_server("tcp://127.0.0.1:5858", $errno, $errstr);

if (!$socket_server) {
echo "Failed to create socket server: ${errstr}" . PHP_EOL;
echo "Failed to create socket server: {$errstr}" . PHP_EOL;
exit (1);
}

$socket_client = stream_socket_client("tcp://127.0.0.1:5858", $errno, $errstr);

if (!$socket_client) {
echo "Failed to create socket client: ${errstr}" . PHP_EOL;
echo "Failed to create socket client: {$errstr}" . PHP_EOL;
exit (1);
}

Expand Down Expand Up @@ -73,4 +73,4 @@ array(1) {
[0]=>
string(3) "r:%d"
}
int(0)
int(0)
8 changes: 4 additions & 4 deletions tests/036-device.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class CbStateData
protected $_name;

public function __construct ($name) {
$this->name = $name;
$this->_name = $name;
}

public function getName () {
return $this->name;
return $this->_name;
}

public function increment ()
Expand Down Expand Up @@ -58,7 +58,7 @@ $orig_cb = function ($user_data) use (&$last_called, $device) {
$time_elapsed = (proper_microtime () - $last_called) + 1;

if ($time_elapsed < $device->getTimerTimeout ()) {
echo "Called too early, only ${time_elapsed}ms elapsed, expected {$device->getTimerTimeout ()}" . PHP_EOL;
echo "Called too early, only {$time_elapsed}ms elapsed, expected {$device->getTimerTimeout ()}" . PHP_EOL;
}

$device->setTimerTimeout ($device->getTimerTimeout () + 50);
Expand Down Expand Up @@ -100,4 +100,4 @@ Triggered for 160ms timeout
timer function called 2 times
Triggered for 210ms timeout
timer function called 3 times
OK
OK
4 changes: 2 additions & 2 deletions tests/037-device-deprecated.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $device = new ZMQDevice($s1, $ctx->getSocket(ZMQ::SOCKET_PUB));

// Setup callback and user data for callback
$device->setIdleTimeout (100);
$device->setIdleCallback (function ($user_data) { echo "Called: ${user_data}" . PHP_EOL; return false; }, "test");
$device->setIdleCallback (function ($user_data) { echo "Called: {$user_data}" . PHP_EOL; return false; }, "test");

// Run first time
$device->run ();
Expand All @@ -24,4 +24,4 @@ echo "OK";
--EXPECTF--
Deprecated: ZMQDevice::setidlecallback(): The signature for setIdleCallback has changed, please update your code in %s on line %d
Called: test
OK
OK
6 changes: 3 additions & 3 deletions tests/048-pollsetitems.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ $poll = new ZMQPoll();
$socket_server = stream_socket_server("tcp://127.0.0.1:5858", $errno, $errstr);

if (!$socket_server) {
echo "Failed to create socket server: ${errstr}" . PHP_EOL;
echo "Failed to create socket server: {$errstr}" . PHP_EOL;
exit (1);
}

$socket_client = stream_socket_client("tcp://127.0.0.1:5858", $errno, $errstr);

if (!$socket_client) {
echo "Failed to create socket client: ${errstr}" . PHP_EOL;
echo "Failed to create socket client: {$errstr}" . PHP_EOL;
exit (1);
}

Expand Down Expand Up @@ -58,4 +58,4 @@ array(3) {
}
array(0) {
}
OK
OK

0 comments on commit 84f0720

Please sign in to comment.