• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sirn-se / websocket-php / 8346487915

19 Mar 2024 04:15PM UTC coverage: 22.584% (-77.4%) from 100.0%
8346487915

push

github

sirn-se
Temp test verification

2 of 2 new or added lines in 1 file covered. (100.0%)

742 existing lines in 32 files now uncovered.

222 of 983 relevant lines covered (22.58%)

0.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Frame/Frame.php
1
<?php
2

3
/**
4
 * Copyright (C) 2014-2024 Textalk and contributors.
5
 * This file is part of Websocket PHP and is free software under the ISC License.
6
 */
7

8
namespace WebSocket\Frame;
9

10
use Stringable;
11
use WebSocket\Trait\StringableTrait;
12

13
/**
14
 * WebSocket\Frame\Frame class.
15
 * Represent a single frame sent or received as part of websocket message.
16
 */
17
class Frame implements Stringable
18
{
19
    use StringableTrait;
20

21
    private $opcode;
22
    private $payload;
23
    private $final;
24

25
    public function __construct(string $opcode, string $payload, bool $final)
26
    {
UNCOV
27
        $this->opcode = $opcode;
×
UNCOV
28
        $this->payload = $payload;
×
UNCOV
29
        $this->final = $final;
×
30
    }
31

32
    public function isFinal(): bool
33
    {
UNCOV
34
        return $this->final;
×
35
    }
36

37
    public function isContinuation(): bool
38
    {
UNCOV
39
        return $this->opcode === 'continuation';
×
40
    }
41

42
    public function getOpcode(): string
43
    {
UNCOV
44
        return $this->opcode;
×
45
    }
46

47
    public function getPayload(): string
48
    {
UNCOV
49
        return $this->payload;
×
50
    }
51

52
    public function getPayloadLength(): int
53
    {
UNCOV
54
        return strlen($this->payload);
×
55
    }
56

57
    public function __toString(): string
58
    {
UNCOV
59
        return $this->stringable('%s', $this->opcode);
×
60
    }
61
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc