Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.3'
extensions: openssl,mbstring
coverage: xdebug

- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Install Composer Dependencies
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader

- name: Cache Dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer Dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Run Static Analysis
run: composer run-script analyse

Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest]
php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
php-versions: ['8.1', '8.2', '8.3', '8.4', '8.5']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
- name: Checkout
Expand All @@ -20,22 +20,18 @@ jobs:

- name: Get Composer Cache Directory
id: composer-cache
shell: bash
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Install Composer dependencies
if: ${{ matrix.php-versions != '8.1' }}
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader

- name: Install Composer dependencies (8.1)
if: ${{ matrix.php-versions == '8.1' }}
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader --ignore-platform-reqs

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Run Specs
run: composer run-script test
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"php": ">=7.1"
},
"require-dev": {
"phpspec/phpspec": "^5.1|^6.1|^7.1",
"phpspec/phpspec": "^7.1|^8.0",
"freedsx/asn1": "^0.4.0",
"friends-of-phpspec/phpspec-code-coverage": "^4.3|^6.1",
"phpstan/phpstan": "^0.12"
"friends-of-phpspec/phpspec-code-coverage": "^6.1|^7.0",
"phpstan/phpstan": "^2.0"
},
"suggest": {
"ext-openssl": "For SSL/TLS support.",
Expand Down
5 changes: 2 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ parameters:
level: 6
paths:
- %currentWorkingDirectory%/src
checkMissingIterableValueType: false
treatPhpDocTypesAsCertain: false
checkGenericClassInNonGenericObjectType: false
phpVersion: 70100
treatPhpDocTypesAsCertain: false
18 changes: 9 additions & 9 deletions src/FreeDSx/Socket/Socket.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Socket
protected $errorNumber;

/**
* @var array
* @var array<string, string>
*/
protected $sslOptsMap = [
'ssl_allow_self_signed' => 'allow_self_signed',
Expand All @@ -68,7 +68,7 @@ class Socket
];

/**
* @var array
* @var array<string, bool>
*/
protected $sslOpts = [
'allow_self_signed' => false,
Expand All @@ -79,7 +79,7 @@ class Socket
];

/**
* @var array
* @var array<string, mixed>
*/
protected $options = [
'transport' => 'tcp',
Expand All @@ -98,7 +98,7 @@ class Socket

/**
* @param resource|null $resource
* @param array $options
* @param array<string, mixed> $options
*/
public function __construct($resource = null, array $options = [])
{
Expand Down Expand Up @@ -269,7 +269,7 @@ public function connect(string $host)
/**
* Get the options set for the socket.
*
* @return array
* @return array<string, mixed>
*/
public function getOptions() : array
{
Expand All @@ -280,7 +280,7 @@ public function getOptions() : array
* Create a socket by connecting to a specific host.
*
* @param string $host
* @param array $options
* @param array<string, mixed> $options
* @return Socket
* @throws ConnectionException
*/
Expand All @@ -293,7 +293,7 @@ public static function create(string $host, array $options = []) : Socket
* Create a UNIX based socket.
*
* @param string $file The full path to the unix socket.
* @param array $options Any additional options.
* @param array<string, mixed> $options Any additional options.
* @return Socket
* @throws ConnectionException
*/
Expand All @@ -314,7 +314,7 @@ public static function unix(
* Create a TCP based socket.
*
* @param string $host
* @param array $options
* @param array<string, mixed> $options
* @return Socket
* @throws ConnectionException
*/
Expand All @@ -327,7 +327,7 @@ public static function tcp(string $host, array $options = []) : Socket
* Create a UDP based socket.
*
* @param string $host
* @param array $options
* @param array<string, mixed> $options
* @return Socket
* @throws ConnectionException
*/
Expand Down
8 changes: 4 additions & 4 deletions src/FreeDSx/Socket/SocketPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class SocketPool
{
/**
* @var array
* @var array<string, mixed>
*/
protected $options = [
'servers' => [],
Expand All @@ -29,7 +29,7 @@ class SocketPool
];

/**
* @var array
* @var list<string>
*/
protected $socketOpts = [
'use_ssl',
Expand All @@ -45,7 +45,7 @@ class SocketPool
];

/**
* @param array $options
* @param array<string, mixed> $options
*/
public function __construct(array $options)
{
Expand Down Expand Up @@ -84,7 +84,7 @@ public function connect(string $hostname = '') : Socket
}

/**
* @return array
* @return array<string, mixed>
*/
protected function getSocketOptions() : array
{
Expand Down
12 changes: 6 additions & 6 deletions src/FreeDSx/Socket/SocketServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SocketServer extends Socket
];

/**
* @var array
* @var array<string, mixed>
*/
protected $serverOpts = [
'use_ssl' => false,
Expand All @@ -48,7 +48,7 @@ class SocketServer extends Socket
protected $clients = [];

/**
* @param array $options
* @param array<string, mixed> $options
*/
public function __construct(array $options = [])
{
Expand Down Expand Up @@ -173,7 +173,7 @@ public function removeClient(Socket $socket): void
*
* @param string $ip
* @param int|null $port
* @param array $options
* @param array<string, mixed> $options
* @return SocketServer
* @throws ConnectionException
*/
Expand All @@ -193,7 +193,7 @@ public static function bind(
*
* @param string $ip
* @param int $port
* @param array $options
* @param array<string, mixed> $options
* @return SocketServer
* @throws ConnectionException
*/
Expand All @@ -217,7 +217,7 @@ public static function bindTcp(
*
* @param string $ip
* @param int $port
* @param array $options
* @param array<string, mixed> $options
* @return SocketServer
* @throws ConnectionException
*/
Expand All @@ -240,7 +240,7 @@ public static function bindUdp(
* Created a UNIX based socket server.
*
* @param string $socketFile
* @param array $options
* @param array<string, mixed> $options
* @return SocketServer
* @throws ConnectionException
*/
Expand Down
Loading