Browse Source

Replaced tabs with spaces project wide.

Ako Tulu 2 years ago
parent
commit
8d9a9c1bd7
3 changed files with 61 additions and 61 deletions
  1. 7 7
      src/Connection/TcpConnection.php
  2. 9 9
      src/Protocols/Websocket.php
  3. 45 45
      src/Worker.php

+ 7 - 7
src/Connection/TcpConnection.php

@@ -1036,7 +1036,7 @@ class TcpConnection extends ConnectionInterface implements JsonSerializable
      * @param mixed $value
      */
     public static function enableCache(bool $value = true): void
-	{
+    {
         static::$enableCache = $value;
     }
 
@@ -1062,12 +1062,12 @@ class TcpConnection extends ConnectionInterface implements JsonSerializable
         ];
     }
 
-	/**
-	 * Destruct.
-	 *
-	 * @return void
-	 * @throws Throwable
-	 */
+    /**
+     * Destruct.
+     *
+     * @return void
+     * @throws Throwable
+     */
     public function __destruct()
     {
         static $mod;

+ 9 - 9
src/Protocols/Websocket.php

@@ -236,14 +236,14 @@ class Websocket
         return 0;
     }
 
-	/**
-	 * Websocket encode.
-	 *
-	 * @param mixed $buffer
-	 * @param TcpConnection $connection
-	 * @return string
-	 * @throws Throwable
-	 */
+    /**
+     * Websocket encode.
+     *
+     * @param mixed $buffer
+     * @param TcpConnection $connection
+     * @return string
+     * @throws Throwable
+     */
     public static function encode(mixed $buffer, TcpConnection $connection): string
     {
         if (!is_scalar($buffer)) {
@@ -362,7 +362,7 @@ class Websocket
                 $SecWebSocketKey = $match[1];
             } else {
                 $connection->close(
-					"HTTP/1.0 200 OK\r\nServer: workerman\r\n\r\n<div style=\"text-align:center\"><h1>WebSocket</h1><hr>workerman</div>", true);
+                    "HTTP/1.0 200 OK\r\nServer: workerman\r\n\r\n<div style=\"text-align:center\"><h1>WebSocket</h1><hr>workerman</div>", true);
                 return 0;
             }
             // Calculation websocket key.

+ 45 - 45
src/Worker.php

@@ -828,10 +828,10 @@ class Worker
         if (static::$daemonize) {
             static::safeEcho('Input "php ' . basename(static::$startFile) . ' stop" to stop. Start success.' . "\n\n");
         } else if (!empty(static::$command)) {
-			static::safeEcho("Start success.\n"); // Workerman used as library
+            static::safeEcho("Start success.\n"); // Workerman used as library
         } else {
-			static::safeEcho("Press Ctrl+C to stop. Start success.\n");
-		}
+            static::safeEcho("Press Ctrl+C to stop. Start success.\n");
+        }
     }
 
     /**
@@ -1167,12 +1167,12 @@ class Worker
         }
     }
 
-	/**
-	 * Signal handler.
-	 *
-	 * @param int $signal
-	 * @throws Throwable
-	 */
+    /**
+     * Signal handler.
+     *
+     * @param int $signal
+     * @throws Throwable
+     */
     public static function signalHandler(int $signal): void
     {
         switch ($signal) {
@@ -1300,9 +1300,9 @@ class Worker
         }
 
         static::$masterPid = posix_getpid();
-		if (false === file_put_contents(static::$pidFile, static::$masterPid)) {
-			throw new RuntimeException('can not save pid to ' . static::$pidFile);
-		}
+        if (false === file_put_contents(static::$pidFile, static::$masterPid)) {
+            throw new RuntimeException('can not save pid to ' . static::$pidFile);
+        }
     }
 
     /**
@@ -1786,12 +1786,12 @@ class Worker
         exit(0);
     }
 
-	/**
-	 * Execute reload.
-	 *
-	 * @return void
-	 * @throws Throwable
-	 */
+    /**
+     * Execute reload.
+     *
+     * @return void
+     * @throws Throwable
+     */
     protected static function reload(): void
     {
         // For master process.
@@ -1868,13 +1868,13 @@ class Worker
         }
     }
 
-	/**
-	 * Stop all.
-	 *
-	 * @param int $code
-	 * @param mixed $log
-	 * @throws Throwable
-	 */
+    /**
+     * Stop all.
+     *
+     * @param int $code
+     * @param mixed $log
+     * @throws Throwable
+     */
     public static function stopAll(int $code = 0, mixed $log = ''): void
     {
         if ($log) {
@@ -2451,12 +2451,12 @@ class Worker
         }
     }
 
-	/**
-	 * Stop current worker instance.
-	 *
-	 * @return void
-	 * @throws Throwable
-	 */
+    /**
+     * Stop current worker instance.
+     *
+     * @return void
+     * @throws Throwable
+     */
     public function stop(): void
     {
         // Try to emit onWorkerStop callback.
@@ -2485,13 +2485,13 @@ class Worker
         $this->onMessage = $this->onClose = $this->onError = $this->onBufferDrain = $this->onBufferFull = null;
     }
 
-	/**
-	 * Accept a connection.
-	 *
-	 * @param resource $socket
-	 * @return void
-	 * @throws Throwable
-	 */
+    /**
+     * Accept a connection.
+     *
+     * @param resource $socket
+     * @return void
+     * @throws Throwable
+     */
     public function acceptTcpConnection($socket): void
     {
         // Accept a connection on server socket.
@@ -2527,13 +2527,13 @@ class Worker
         }
     }
 
-	/**
-	 * For udp package.
-	 *
-	 * @param resource $socket
-	 * @return bool
-	 * @throws Throwable
-	 */
+    /**
+     * For udp package.
+     *
+     * @param resource $socket
+     * @return bool
+     * @throws Throwable
+     */
     public function acceptUdpConnection($socket): bool
     {
         set_error_handler(function () {