Completed
Push — master ( 1915ce...cbef56 )
by Biao
10:02
created

ProcessTitleTrait::setProcessTitle()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 6
nc 4
nop 1
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Hhxsv5\LaravelS\Swoole\Process;
4
5
trait ProcessTitleTrait
6
{
7
    public function setProcessTitle($title)
8
    {
9
        if (PHP_OS === 'Darwin') {
10
            return;
11
        }
12
        if (function_exists('cli_set_process_title')) {
13
            cli_set_process_title($title);
14
        } elseif (function_exists('swoole_set_process_name')) {
15
            swoole_set_process_name($title);
16
        }
17
    }
18
}