Passed
Push — master ( cbb991...62e47c )
by Albert
07:16 queued 05:08
created

FSOutput   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A format() 0 7 2
1
<?php
2
3
namespace SwooleTW\Http\HotReload;
4
5
/**
6
 * Class FSOutput
7
 */
8
class FSOutput
9
{
10
    /**
11
     * @param \SwooleTW\Http\HotReload\FSEvent $event
12
     *
13
     * @return string
14
     */
15
    public static function format(FSEvent $event): string
16
    {
17
        $item = is_dir($event->getPath()) ? 'Directory' : 'File';
18
        $events = implode(', ', $event->getTypes());
19
        $time = $event->getWhen()->format('Y.m.d H:i:s');
20
21
        return sprintf('%s: %s %s at %s', $item, $event->getPath(), $events, $time);
22
    }
23
}