Skip to content

Commit e2bb2ce

Browse files
committed
Fix phpstan errors.
1 parent 7c5f849 commit e2bb2ce

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

src/FreeDSx/Socket/Socket.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Socket
5454
protected $errorNumber;
5555

5656
/**
57-
* @var array
57+
* @var array<string, string>
5858
*/
5959
protected $sslOptsMap = [
6060
'ssl_allow_self_signed' => 'allow_self_signed',
@@ -68,7 +68,7 @@ class Socket
6868
];
6969

7070
/**
71-
* @var array
71+
* @var array<string, bool>
7272
*/
7373
protected $sslOpts = [
7474
'allow_self_signed' => false,
@@ -79,7 +79,7 @@ class Socket
7979
];
8080

8181
/**
82-
* @var array
82+
* @var array<string, mixed>
8383
*/
8484
protected $options = [
8585
'transport' => 'tcp',
@@ -98,7 +98,7 @@ class Socket
9898

9999
/**
100100
* @param resource|null $resource
101-
* @param array $options
101+
* @param array<string, mixed> $options
102102
*/
103103
public function __construct($resource = null, array $options = [])
104104
{
@@ -269,7 +269,7 @@ public function connect(string $host)
269269
/**
270270
* Get the options set for the socket.
271271
*
272-
* @return array
272+
* @return array<string, mixed>
273273
*/
274274
public function getOptions() : array
275275
{
@@ -280,7 +280,7 @@ public function getOptions() : array
280280
* Create a socket by connecting to a specific host.
281281
*
282282
* @param string $host
283-
* @param array $options
283+
* @param array<string, mixed> $options
284284
* @return Socket
285285
* @throws ConnectionException
286286
*/
@@ -293,7 +293,7 @@ public static function create(string $host, array $options = []) : Socket
293293
* Create a UNIX based socket.
294294
*
295295
* @param string $file The full path to the unix socket.
296-
* @param array $options Any additional options.
296+
* @param array<string, mixed> $options Any additional options.
297297
* @return Socket
298298
* @throws ConnectionException
299299
*/
@@ -314,7 +314,7 @@ public static function unix(
314314
* Create a TCP based socket.
315315
*
316316
* @param string $host
317-
* @param array $options
317+
* @param array<string, mixed> $options
318318
* @return Socket
319319
* @throws ConnectionException
320320
*/
@@ -327,7 +327,7 @@ public static function tcp(string $host, array $options = []) : Socket
327327
* Create a UDP based socket.
328328
*
329329
* @param string $host
330-
* @param array $options
330+
* @param array<string, mixed> $options
331331
* @return Socket
332332
* @throws ConnectionException
333333
*/

src/FreeDSx/Socket/SocketPool.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class SocketPool
2121
{
2222
/**
23-
* @var array
23+
* @var array<string, mixed>
2424
*/
2525
protected $options = [
2626
'servers' => [],
@@ -29,7 +29,7 @@ class SocketPool
2929
];
3030

3131
/**
32-
* @var array
32+
* @var list<string>
3333
*/
3434
protected $socketOpts = [
3535
'use_ssl',
@@ -45,7 +45,7 @@ class SocketPool
4545
];
4646

4747
/**
48-
* @param array $options
48+
* @param array<string, mixed> $options
4949
*/
5050
public function __construct(array $options)
5151
{
@@ -84,7 +84,7 @@ public function connect(string $hostname = '') : Socket
8484
}
8585

8686
/**
87-
* @return array
87+
* @return array<string, mixed>
8888
*/
8989
protected function getSocketOptions() : array
9090
{

src/FreeDSx/Socket/SocketServer.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SocketServer extends Socket
2929
];
3030

3131
/**
32-
* @var array
32+
* @var array<string, mixed>
3333
*/
3434
protected $serverOpts = [
3535
'use_ssl' => false,
@@ -48,7 +48,7 @@ class SocketServer extends Socket
4848
protected $clients = [];
4949

5050
/**
51-
* @param array $options
51+
* @param array<string, mixed> $options
5252
*/
5353
public function __construct(array $options = [])
5454
{
@@ -173,7 +173,7 @@ public function removeClient(Socket $socket): void
173173
*
174174
* @param string $ip
175175
* @param int|null $port
176-
* @param array $options
176+
* @param array<string, mixed> $options
177177
* @return SocketServer
178178
* @throws ConnectionException
179179
*/
@@ -193,7 +193,7 @@ public static function bind(
193193
*
194194
* @param string $ip
195195
* @param int $port
196-
* @param array $options
196+
* @param array<string, mixed> $options
197197
* @return SocketServer
198198
* @throws ConnectionException
199199
*/
@@ -217,7 +217,7 @@ public static function bindTcp(
217217
*
218218
* @param string $ip
219219
* @param int $port
220-
* @param array $options
220+
* @param array<string, mixed> $options
221221
* @return SocketServer
222222
* @throws ConnectionException
223223
*/
@@ -240,7 +240,7 @@ public static function bindUdp(
240240
* Created a UNIX based socket server.
241241
*
242242
* @param string $socketFile
243-
* @param array $options
243+
* @param array<string, mixed> $options
244244
* @return SocketServer
245245
* @throws ConnectionException
246246
*/

0 commit comments

Comments
 (0)