Skip to content

Commit

Permalink
we're green on PHP 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Jan 15, 2021
1 parent 0a13d61 commit 48e7055
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ jobs:
include:
- php: 7.2.34
pthreads-version: 46962cf9c2d30b6e1e1ea50ca36de3df5d6d4e58
phpstan-config: php7
- php: 7.3.25
pthreads-version: 34d7e6b91ed92a625760fedd667e7cba2009e463
phpstan-config: php7
- php: 7.4.13
pthreads-version: 34d7e6b91ed92a625760fedd667e7cba2009e463
phpstan-config: php7
- php: 8.0.1
pthreads-version: bc16ee7b5a21faee9bd1743f830f7135b763fb56
phpstan-config: php8

name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -56,4 +62,4 @@ jobs:
run: composer install --prefer-dist --no-interaction

- name: Run PHPStan
run: ./vendor/bin/phpstan analyze --no-progress
run: ./vendor/bin/phpstan analyze --no-progress -c phpstan.${{ matrix.phpstan-config }}.neon
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "library",
"license": "GPL-3.0",
"require": {
"php": ">=7.2.0",
"php": "^7.2 || ^8.0",
"php-ipv6": "*",
"php-64bit": "*",
"ext-pthreads": "~3.2.0",
Expand Down
6 changes: 6 additions & 0 deletions phpstan.php7.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
includes:
- phpstan.shared.neon

parameters:
typeAliases:
PhpSocket: resource
8 changes: 8 additions & 0 deletions phpstan.php8.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
includes:
- phpstan.shared.neon
- tests/phpstan/configs/php8-changes.neon

parameters:
phpVersion: 80000
typeAliases:
PhpSocket: '\Socket'
File renamed without changes.
6 changes: 5 additions & 1 deletion src/server/UDPServerSocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@
use const SOL_UDP;

class UDPServerSocket{
/** @var resource */
/**
* @var resource
* @phpstan-var PhpSocket
*/
protected $socket;
/**
* @var InternetAddress
Expand Down Expand Up @@ -77,6 +80,7 @@ public function getBindAddress() : InternetAddress{

/**
* @return resource
* @phpstan-return PhpSocket
*/
public function getSocket(){
return $this->socket;
Expand Down
12 changes: 12 additions & 0 deletions tests/phpstan/configs/php8-changes.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
parameters:
ignoreErrors:
-
message: "#^Call to function assert\\(\\) with true will always evaluate to true\\.$#"
count: 1
path: ../../../src/server/Session.php

-
message: "#^Strict comparison using \\!\\=\\= between array\\<int, string\\> and false will always evaluate to true\\.$#"
count: 1
path: ../../../src/server/Session.php

0 comments on commit 48e7055

Please sign in to comment.