| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public static function toEvent(string $event): ?FSEvent |
||
| 24 | { |
||
| 25 | if (preg_match(static::REGEX, $event, $matches)) { |
||
| 26 | $date = Carbon::parse($matches[static::DATE]); |
||
| 27 | $path = $matches[static::PATH]; |
||
| 28 | $events = explode(' ', $matches[static::EVENTS]); |
||
| 29 | $events = array_intersect(FSEvent::getPossibleTypes(), $events); |
||
| 30 | asort($events); |
||
| 31 | |||
| 32 | return new FSEvent($date, $path, $events); |
||
| 33 | } |
||
| 34 | |||
| 35 | return null; |
||
| 36 | } |
||
| 37 | } |