Skip to content

Commit

Permalink
Enhanced for the client in the callbacks to be Conveyor's.
Browse files Browse the repository at this point in the history
Fixed tests.
Updated version.
  • Loading branch information
lotharthesavior committed Dec 3, 2023
1 parent 757616e commit a6d148e
Show file tree
Hide file tree
Showing 8 changed files with 356 additions and 52 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
extensions: openswoole, pcov

- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
Expand Down
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ Once installed, the following example shows how it works to use this package.

```php
use Kanata\ConveyorServerClient\Client;
use WebSocket\Client as WsClient;

$options = [
'onMessageCallback' => function(WsClient $currentClient, string $message) {
'onMessageCallback' => function(Client $currentClient, string $message) {
echo 'Message received: ' . $message . PHP_EOL;
},
];
Expand Down Expand Up @@ -140,6 +139,22 @@ This package has the following options (showing its respective defaults):
]
```

This is this package's Conveyor Client interface:

```php
namespace Kanata\ConveyorServerClient;

use WebSocket\Client;

interface ClientInterface
{
public function connect(): void;
public function getClient(): ?Client;
public function close(): void;
public function send(string $message): void;
}
```

## Author

👤 **Savio Resende**
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
}
},
"require": {
"php": "^8",
"php": "^8.2",
"textalk/websocket": "^1.5"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"codedungeon/phpunit-result-printer": "^0.32.0",
"openswoole/ide-helper": "^4.11",
"kanata-php/socket-conveyor": "^1.1"
"openswoole/ide-helper": "^22.0",
"kanata-php/socket-conveyor": "^1.1",
"openswoole/core": "^22.1"
},
"scripts": {
"test": [
Expand Down
262 changes: 250 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a6d148e

Please sign in to comment.