• 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/Trait/SendMethodsTrait.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\Trait;
9

10
use WebSocket\Message\{
11
    Binary,
12
    Close,
13
    Ping,
14
    Pong,
15
    Text
16
};
17

18
/**
19
 * WebSocket\Trait\SendMethodsTrait trait.
20
 * Conveniance send methods.
21
 */
22
trait SendMethodsTrait
23
{
24
    /**
25
     * Send text message.
26
     * @param string $message Content as string.
27
     * @return Text instance
28
     */
29
    public function text(string $message): Text
30
    {
UNCOV
31
        return $this->send(new Text($message));
×
32
    }
33

34
    /**
35
     * Send binary message.
36
     * @param string $message Content as binary string.
37
     * @return Binary instance
38
     */
39
    public function binary(string $message): Binary
40
    {
UNCOV
41
        return $this->send(new Binary($message));
×
42
    }
43

44
    /**
45
     * Send ping.
46
     * @param string $message Optional text as string.
47
     * @return Ping instance
48
     */
49
    public function ping(string $message = ''): Ping
50
    {
UNCOV
51
        return $this->send(new Ping($message));
×
52
    }
53

54
    /**
55
     * Send unsolicited pong.
56
     * @param string $message Optional text as string.
57
     * @return Pong instance
58
     */
59
    public function pong(string $message = ''): Pong
60
    {
UNCOV
61
        return $this->send(new Pong($message));
×
62
    }
63

64
    /**
65
     * Tell the socket to close.
66
     * @param integer $status  http://tools.ietf.org/html/rfc6455#section-7.4
67
     * @param string  $message A closing message, max 125 bytes.
68
     * @return Close instance
69
     */
70
    public function close(int $status = 1000, string $message = 'ttfn'): Close
71
    {
UNCOV
72
        return $this->send(new Close($status, $message));
×
73
    }
74
}
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