<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2024, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
*
* @param string $file Filename of pid file
*
- * @return boolean|string PID or "false" if not existent
+ * @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;
}
*
* @return boolean Is it running?
*/
- static public function isRunningProcess($file) {
+ public static function isRunningProcess(string $file): bool
+ {
$pid = self::pidFromFile($file);
if (!$pid) {
*
* @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
*
* @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
*
* @return boolean Is it running?
*/
- static public function delete($file) {
+ public static function delete(string $file): bool
+ {
return @unlink($file);
}
}