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

ProcessTitleTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A setProcessTitle() 0 9 4
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
}