Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sirn-se committed Oct 26, 2022
1 parent fe0c9dd commit ef92a6a
Show file tree
Hide file tree
Showing 20 changed files with 141 additions and 52 deletions.
49 changes: 32 additions & 17 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,61 @@ name: Acceptance
on: [push, pull_request]

jobs:
test-7-3:
test-7-4:
runs-on: ubuntu-latest
name: Test PHP 7.3
name: Test PHP 7.4
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up PHP 7.3
uses: actions/checkout@v3
- name: Set up PHP 7.4
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
php-version: '7.4'
- name: Composer
run: make install
- name: Test
run: make test

test-7-4:
test-8-0:
runs-on: ubuntu-latest
name: Test PHP 7.4
name: Test PHP 8.0
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up PHP 7.4
uses: actions/checkout@v3
- name: Set up PHP 8.0
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.0'
- name: Composer
run: make install
- name: Test
run: make test

test-8-0:
test-8-1:
runs-on: ubuntu-latest
name: Test PHP 8.0
name: Test PHP 8.1
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up PHP 8.0
uses: actions/checkout@v3
- name: Set up PHP 8.1
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
- name: Composer
run: make install
- name: Test
run: make test

test-8-2:
runs-on: ubuntu-latest
name: Test PHP 8.2
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up PHP 8.2
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: Composer
run: make install
- name: Test
Expand All @@ -53,7 +68,7 @@ jobs:
name: Code standard
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up PHP 8.0
uses: shivammathur/setup-php@v2
with:
Expand All @@ -68,7 +83,7 @@ jobs:
name: Code coverage
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up PHP 8.0
uses: shivammathur/setup-php@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test: composer.lock
./vendor/bin/phpunit

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

coverage: composer.lock build
XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
Expand Down
10 changes: 0 additions & 10 deletions codestandard.xml

This file was deleted.

11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"name": "Fredrik Liljegren"
},
{
"name": "Sören Jensen",
"email": "[email protected]"
"name": "Sören Jensen"
}
],
"autoload": {
Expand All @@ -23,11 +22,13 @@
}
},
"require": {
"php": "^7.2 | ^8.0",
"psr/log": "^1 | ^2 | ^3"
"php": "^7.4 | ^8.0",
"phrity/net-uri": "^1.0",
"psr/log": "^1.0 | ^2.0 | ^3.0",
"psr/http-message": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^8.0|^9.0",
"phpunit/phpunit": "^9.0",
"php-coveralls/php-coveralls": "^2.0",
"squizlabs/php_codesniffer": "^3.5"
}
Expand Down
7 changes: 7 additions & 0 deletions lib/BadOpcodeException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

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

namespace WebSocket;

class BadOpcodeException extends Exception
Expand Down
7 changes: 7 additions & 0 deletions lib/BadUriException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

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

namespace WebSocket;

class BadUriException extends Exception
Expand Down
2 changes: 1 addition & 1 deletion lib/Client.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Copyright (C) 2014-2021 Textalk/Abicart and contributors.
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
*
* This file is part of Websocket PHP and is free software under the ISC License.
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING
Expand Down
15 changes: 11 additions & 4 deletions lib/Connection.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
<?php

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

namespace WebSocket;

use Psr\Log\{LoggerAwareInterface, LoggerAwareTrait, LoggerInterface, NullLogger};
use WebSocket\Message\{Factory, Message};
use Psr\Log\{
LoggerAwareInterface,
LoggerAwareTrait,
LoggerInterface, NullLogger
};
use WebSocket\Message\{
Factory,
Message
};

class Connection implements LoggerAwareInterface
{
Expand Down Expand Up @@ -404,7 +411,7 @@ public function getName(): ?string
* Get name of remote socket, or null if not connected.
* @return string|null
*/
public function getPeer(): ?string
public function getRemoteName(): ?string
{
return stream_socket_get_name($this->stream, true);
}
Expand Down
7 changes: 7 additions & 0 deletions lib/ConnectionException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

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

namespace WebSocket;

use Throwable;
Expand Down
7 changes: 7 additions & 0 deletions lib/Message/Binary.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

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

namespace WebSocket\Message;

class Binary extends Message
Expand Down
7 changes: 7 additions & 0 deletions lib/Message/Close.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

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

namespace WebSocket\Message;

class Close extends Message
Expand Down
7 changes: 7 additions & 0 deletions lib/Message/Factory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

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

namespace WebSocket\Message;

use WebSocket\BadOpcodeException;
Expand Down
7 changes: 7 additions & 0 deletions lib/Message/Message.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

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

namespace WebSocket\Message;

use DateTime;
Expand Down
7 changes: 7 additions & 0 deletions lib/Message/Ping.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

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

namespace WebSocket\Message;

class Ping extends Message
Expand Down
7 changes: 7 additions & 0 deletions lib/Message/Pong.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

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

namespace WebSocket\Message;

class Pong extends Message
Expand Down
7 changes: 7 additions & 0 deletions lib/Message/Text.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

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

namespace WebSocket\Message;

class Text extends Message
Expand Down
2 changes: 1 addition & 1 deletion lib/OpcodeTrait.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Copyright (C) 2014-2021 Textalk/Abicart and contributors.
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
*
* This file is part of Websocket PHP and is free software under the ISC License.
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING
Expand Down
2 changes: 1 addition & 1 deletion lib/Server.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Copyright (C) 2014-2021 Textalk/Abicart and contributors.
* Copyright (C) 2014-2022 Textalk/Abicart and contributors.
*
* This file is part of Websocket PHP and is free software under the ISC License.
* License text: https://raw.githubusercontent.com/Textalk/websocket-php/master/COPYING
Expand Down
7 changes: 7 additions & 0 deletions lib/TimeoutException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

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

namespace WebSocket;

class TimeoutException extends ConnectionException
Expand Down
23 changes: 11 additions & 12 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="tests/bootstrap.php" colors="true">
<testsuites>
<testsuite name="Unit tests">
<directory suffix=".php">tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">lib/</directory>
</whitelist>
</filter>
<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">
<coverage>
<include>
<directory suffix=".php">lib/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Unit tests">
<directory suffix=".php">tests</directory>
</testsuite>
</testsuites>
</phpunit>

0 comments on commit ef92a6a

Please sign in to comment.