Procházet zdrojové kódy

Enforce array type hint

Joanhey před 6 roky
rodič
revize
56bff58441

+ 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);