Skip to content

Commit ef92a6a

Browse files
committed
Updates
1 parent fe0c9dd commit ef92a6a

20 files changed

+141
-52
lines changed

.github/workflows/acceptance.yml

+32-17
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,61 @@ name: Acceptance
33
on: [push, pull_request]
44

55
jobs:
6-
test-7-3:
6+
test-7-4:
77
runs-on: ubuntu-latest
8-
name: Test PHP 7.3
8+
name: Test PHP 7.4
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v2
12-
- name: Set up PHP 7.3
11+
uses: actions/checkout@v3
12+
- name: Set up PHP 7.4
1313
uses: shivammathur/setup-php@v2
1414
with:
15-
php-version: '7.3'
15+
php-version: '7.4'
1616
- name: Composer
1717
run: make install
1818
- name: Test
1919
run: make test
2020

21-
test-7-4:
21+
test-8-0:
2222
runs-on: ubuntu-latest
23-
name: Test PHP 7.4
23+
name: Test PHP 8.0
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v2
27-
- name: Set up PHP 7.4
26+
uses: actions/checkout@v3
27+
- name: Set up PHP 8.0
2828
uses: shivammathur/setup-php@v2
2929
with:
30-
php-version: '7.4'
30+
php-version: '8.0'
3131
- name: Composer
3232
run: make install
3333
- name: Test
3434
run: make test
3535

36-
test-8-0:
36+
test-8-1:
3737
runs-on: ubuntu-latest
38-
name: Test PHP 8.0
38+
name: Test PHP 8.1
3939
steps:
4040
- name: Checkout
41-
uses: actions/checkout@v2
42-
- name: Set up PHP 8.0
41+
uses: actions/checkout@v3
42+
- name: Set up PHP 8.1
4343
uses: shivammathur/setup-php@v2
4444
with:
45-
php-version: '8.0'
45+
php-version: '8.1'
46+
- name: Composer
47+
run: make install
48+
- name: Test
49+
run: make test
50+
51+
test-8-2:
52+
runs-on: ubuntu-latest
53+
name: Test PHP 8.2
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v3
57+
- name: Set up PHP 8.2
58+
uses: shivammathur/setup-php@v2
59+
with:
60+
php-version: '8.2'
4661
- name: Composer
4762
run: make install
4863
- name: Test
@@ -53,7 +68,7 @@ jobs:
5368
name: Code standard
5469
steps:
5570
- name: Checkout
56-
uses: actions/checkout@v2
71+
uses: actions/checkout@v3
5772
- name: Set up PHP 8.0
5873
uses: shivammathur/setup-php@v2
5974
with:
@@ -68,7 +83,7 @@ jobs:
6883
name: Code coverage
6984
steps:
7085
- name: Checkout
71-
uses: actions/checkout@v2
86+
uses: actions/checkout@v3
7287
- name: Set up PHP 8.0
7388
uses: shivammathur/setup-php@v2
7489
with:

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test: composer.lock
99
./vendor/bin/phpunit
1010

1111
cs-check: composer.lock
12-
./vendor/bin/phpcs --standard=codestandard.xml lib tests examples
12+
./vendor/bin/phpcs --standard=PSR1,PSR12 --encoding=UTF-8 --report=full --colors lib tests examples
1313

1414
coverage: composer.lock build
1515
XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml

codestandard.xml

-10
This file was deleted.

composer.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
"name": "Fredrik Liljegren"
99
},
1010
{
11-
"name": "Sören Jensen",
12-
"email": "[email protected]"
11+
"name": "Sören Jensen"
1312
}
1413
],
1514
"autoload": {
@@ -23,11 +22,13 @@
2322
}
2423
},
2524
"require": {
26-
"php": "^7.2 | ^8.0",
27-
"psr/log": "^1 | ^2 | ^3"
25+
"php": "^7.4 | ^8.0",
26+
"phrity/net-uri": "^1.0",
27+
"psr/log": "^1.0 | ^2.0 | ^3.0",
28+
"psr/http-message": "^1.0"
2829
},
2930
"require-dev": {
30-
"phpunit/phpunit": "^8.0|^9.0",
31+
"phpunit/phpunit": "^9.0",
3132
"php-coveralls/php-coveralls": "^2.0",
3233
"squizlabs/php_codesniffer": "^3.5"
3334
}

lib/BadOpcodeException.php

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?php
22

3+
/**
4+
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
5+
*
6+
* This file is part of Websocket PHP and is free software under the ISC License.
7+
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING
8+
*/
9+
310
namespace WebSocket;
411

512
class BadOpcodeException extends Exception

lib/BadUriException.php

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?php
22

3+
/**
4+
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
5+
*
6+
* This file is part of Websocket PHP and is free software under the ISC License.
7+
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING
8+
*/
9+
310
namespace WebSocket;
411

512
class BadUriException extends Exception

lib/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Copyright (C) 2014-2021 Textalk/Abicart and contributors.
4+
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
55
*
66
* This file is part of Websocket PHP and is free software under the ISC License.
77
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING

lib/Connection.php

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
<?php
22

33
/**
4-
* Copyright (C) 2014-2021 Textalk/Abicart and contributors.
4+
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
55
*
66
* This file is part of Websocket PHP and is free software under the ISC License.
77
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING
88
*/
99

1010
namespace WebSocket;
1111

12-
use Psr\Log\{LoggerAwareInterface, LoggerAwareTrait, LoggerInterface, NullLogger};
13-
use WebSocket\Message\{Factory, Message};
12+
use Psr\Log\{
13+
LoggerAwareInterface,
14+
LoggerAwareTrait,
15+
LoggerInterface, NullLogger
16+
};
17+
use WebSocket\Message\{
18+
Factory,
19+
Message
20+
};
1421

1522
class Connection implements LoggerAwareInterface
1623
{
@@ -404,7 +411,7 @@ public function getName(): ?string
404411
* Get name of remote socket, or null if not connected.
405412
* @return string|null
406413
*/
407-
public function getPeer(): ?string
414+
public function getRemoteName(): ?string
408415
{
409416
return stream_socket_get_name($this->stream, true);
410417
}

lib/ConnectionException.php

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?php
22

3+
/**
4+
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
5+
*
6+
* This file is part of Websocket PHP and is free software under the ISC License.
7+
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING
8+
*/
9+
310
namespace WebSocket;
411

512
use Throwable;

lib/Message/Binary.php

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?php
22

3+
/**
4+
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
5+
*
6+
* This file is part of Websocket PHP and is free software under the ISC License.
7+
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING
8+
*/
9+
310
namespace WebSocket\Message;
411

512
class Binary extends Message

lib/Message/Close.php

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?php
22

3+
/**
4+
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
5+
*
6+
* This file is part of Websocket PHP and is free software under the ISC License.
7+
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING
8+
*/
9+
310
namespace WebSocket\Message;
411

512
class Close extends Message

lib/Message/Factory.php

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?php
22

3+
/**
4+
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
5+
*
6+
* This file is part of Websocket PHP and is free software under the ISC License.
7+
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING
8+
*/
9+
310
namespace WebSocket\Message;
411

512
use WebSocket\BadOpcodeException;

lib/Message/Message.php

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?php
22

3+
/**
4+
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
5+
*
6+
* This file is part of Websocket PHP and is free software under the ISC License.
7+
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING
8+
*/
9+
310
namespace WebSocket\Message;
411

512
use DateTime;

lib/Message/Ping.php

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?php
22

3+
/**
4+
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
5+
*
6+
* This file is part of Websocket PHP and is free software under the ISC License.
7+
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING
8+
*/
9+
310
namespace WebSocket\Message;
411

512
class Ping extends Message

lib/Message/Pong.php

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?php
22

3+
/**
4+
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
5+
*
6+
* This file is part of Websocket PHP and is free software under the ISC License.
7+
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING
8+
*/
9+
310
namespace WebSocket\Message;
411

512
class Pong extends Message

lib/Message/Text.php

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?php
22

3+
/**
4+
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
5+
*
6+
* This file is part of Websocket PHP and is free software under the ISC License.
7+
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING
8+
*/
9+
310
namespace WebSocket\Message;
411

512
class Text extends Message

lib/OpcodeTrait.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Copyright (C) 2014-2021 Textalk/Abicart and contributors.
4+
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
55
*
66
* This file is part of Websocket PHP and is free software under the ISC License.
77
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING

lib/Server.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Copyright (C) 2014-2021 Textalk/Abicart and contributors.
4+
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
55
*
66
* This file is part of Websocket PHP and is free software under the ISC License.
77
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING

lib/TimeoutException.php

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?php
22

3+
/**
4+
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
5+
*
6+
* This file is part of Websocket PHP and is free software under the ISC License.
7+
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING
8+
*/
9+
310
namespace WebSocket;
411

512
class TimeoutException extends ConnectionException

phpunit.xml.dist

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit bootstrap="tests/bootstrap.php" colors="true">
4-
<testsuites>
5-
<testsuite name="Unit tests">
6-
<directory suffix=".php">tests</directory>
7-
</testsuite>
8-
</testsuites>
9-
<filter>
10-
<whitelist>
11-
<directory suffix=".php">lib/</directory>
12-
</whitelist>
13-
</filter>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">lib/</directory>
6+
</include>
7+
</coverage>
8+
<testsuites>
9+
<testsuite name="Unit tests">
10+
<directory suffix=".php">tests</directory>
11+
</testsuite>
12+
</testsuites>
1413
</phpunit>

0 commit comments

Comments
 (0)