1 | <?php |
||
8 | class Supervisor |
||
9 | { |
||
10 | /** @var TwigEngine */ |
||
11 | protected $templating; |
||
12 | private $appDir; |
||
13 | private $name; |
||
14 | |||
15 | public function __construct($templating, $appDir, $name) |
||
21 | |||
22 | /** |
||
23 | * Сгенерировать конфиг для программы |
||
24 | * |
||
25 | * @param $fileName string file in app/supervisor dir |
||
26 | * @param $vars array array(name,command,[numprocs]) |
||
27 | * @param bool $template string non default template |
||
28 | */ |
||
29 | public function genProgrammConf($fileName, $vars, $template = false) |
||
35 | |||
36 | /** |
||
37 | * Выполняет команду супервизора |
||
38 | * |
||
39 | * @param string $cmd string supervisorctl command |
||
40 | * @return Process Завершенный процесс |
||
41 | */ |
||
42 | public function execute($cmd) |
||
50 | |||
51 | /** |
||
52 | * Перечитать конфиг и перезапустить процессы |
||
53 | */ |
||
54 | public function reloadAndUpdate() |
||
59 | |||
60 | /** |
||
61 | * Запустить демона, если он не работает |
||
62 | */ |
||
63 | public function run() |
||
72 | } |
||
73 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.