Lines 100.00% 6 / 6
Functions and Methods 100.00% 2 / 2
Classes and Traits 100.00% 1 / 1
Name Lines Functions and Methods CRAP Classes and Traits
Edge 100.00% 6 / 6 100.00% 2 / 2 6 100.00% 1 / 1
 emitsLeading 100.00% 3 / 3 100.00% 1 / 1 3
 emitsTrailing 100.00% 3 / 3 100.00% 1 / 1 3
1<?php
2
3declare(strict_types=1);
4
5namespace Stewart\Contracts\Stream;
6
7enum Edge: string
8{
9    case Leading = 'leading';
10    case Trailing = 'trailing';
11    case Both = 'both';
12
13    public function emitsLeading(): bool
14    {
15        return match ($this) {
16            self::Leading, self::Both => true,
17            self::Trailing => false,
18        };
19    }
20
21    public function emitsTrailing(): bool
22    {
23        return match ($this) {
24            self::Trailing, self::Both => true,
25            self::Leading => false,
26        };
27    }
28}