]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/PidFile.php
Security: Use htmlspecialchars() for user input in Arguments class
[friendica.git] / src / Util / PidFile.php
index 7f7a4fb0357840023598f337c9882a508b85c353..649a156793c5ba70a7f0f36b8d4dc3adc70f35d0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -33,7 +33,8 @@ class PidFile
         *
         * @return boolean|string PID or "false" if not existent
         */
-       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,8 @@ class PidFile
         *
         * @return boolean|string PID or "false" if not created
         */
-       static public function create($file) {
+       public static function create(string $file)
+       {
                $pid = self::pidFromFile($file);
 
                // We have a process id? then we quit
@@ -119,7 +123,8 @@ class PidFile
         *
         * @return boolean Is it running?
         */
-       static public function delete($file) {
+       public static function delete(string $file): bool
+       {
                return @unlink($file);
        }
 }