]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/PidFile.php
spelling: nonexistent
[friendica.git] / src / Util / PidFile.php
index 38408bcf4bbf498aafd36fe32d19ec6a8aeb2c2d..1d9019d73497afc8360b1175cb03f5b365f1994d 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -31,9 +31,10 @@ class PidFile
         *
         * @param string $file Filename of pid file
         *
-        * @return boolean|string PID or "false" if noexistent
+        * @return boolean|string PID or "false" if nonexistent
         */
-       static private function pidFromFile($file) {
+       private static function pidFromFile(string $file)
+       {
                if (!file_exists($file)) {
                        return false;
                }
@@ -48,7 +49,8 @@ class PidFile
         *
         * @return boolean Is it running?
         */
-       static public function isRunningProcess($file) {
+       public static function isRunningProcess(string $file): bool
+       {
                $pid = self::pidFromFile($file);
 
                if (!$pid) {
@@ -72,7 +74,8 @@ class PidFile
         *
         * @return boolean Was it killed successfully?
         */
-       static public function killProcess($file) {
+       public static function killProcess(string $file): bool
+       {
                $pid = self::pidFromFile($file);
 
                // We don't have a process id? then we quit
@@ -97,7 +100,7 @@ class PidFile
         *
         * @return boolean|string PID or "false" if not created
         */
-       static public function create(string $file)
+       public static function create(string $file)
        {
                $pid = self::pidFromFile($file);
 
@@ -120,7 +123,7 @@ class PidFile
         *
         * @return boolean Is it running?
         */
-       static public function delete(string $file): bool
+       public static function delete(string $file): bool
        {
                return @unlink($file);
        }