Browse Source

Enforce array type hint

Joanhey 6 năm trước cách đây
mục cha
commit
56bff58441
4 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 1 1
      Connection/AsyncTcpConnection.php
  2. 1 1
      Connection/TcpConnection.php
  3. 1 1
      WebServer.php
  4. 1 1
      Worker.php

+ 1 - 1
Connection/AsyncTcpConnection.php

@@ -109,7 +109,7 @@ class AsyncTcpConnection extends TcpConnection
      * @param array $context_option
      * @throws Exception
      */
-    public function __construct($remote_address, $context_option = null)
+    public function __construct($remote_address, array $context_option = null)
     {
         $address_info = \parse_url($remote_address);
         if (!$address_info) {

+ 1 - 1
Connection/TcpConnection.php

@@ -269,7 +269,7 @@ class TcpConnection extends ConnectionInterface
      * @param array  $arguments
      * @return void
      */
-    public function __call($name, $arguments) {
+    public function __call($name, array $arguments) {
         // Try to emit custom function within protocol
         if (\method_exists($this->protocol, $name)) {
             try {

+ 1 - 1
WebServer.php

@@ -65,7 +65,7 @@ class WebServer extends Worker
      * @param string $socket_name
      * @param array  $context_option
      */
-    public function __construct($socket_name, $context_option = array())
+    public function __construct($socket_name, array $context_option = array())
     {
         list(, $address) = \explode(':', $socket_name, 2);
         parent::__construct('http:' . $address, $context_option);

+ 1 - 1
Worker.php

@@ -2144,7 +2144,7 @@ class Worker
      * @param string $socket_name
      * @param array  $context_option
      */
-    public function __construct($socket_name = '', $context_option = array())
+    public function __construct($socket_name = '', array $context_option = array())
     {
         // Save all worker instances.
         $this->workerId                    = \spl_object_hash($this);