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

Yoast / whip / 6985375056

24 Nov 2023 10:53PM UTC coverage: 28.713% (+1.2%) from 27.5%
6985375056

push

github

web-flow
Merge pull request #152 from Yoast/JRF/ghactions-switch-to-coveralls-reporter

GH Actions: switch to Coveralls action runner to upload reports

87 of 303 relevant lines covered (28.71%)

2.62 hits per line

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

0.0
/src/messages/Whip_HostMessage.php
1
<?php
2
/**
3
 * WHIP libary file.
4
 *
5
 * @package Yoast\WHIP
6
 */
7

8
/**
9
 * Class Whip_HostMessage.
10
 */
11
class Whip_HostMessage implements Whip_Message {
12

13
        /**
14
         * Text domain to use for translations.
15
         *
16
         * @var string
17
         */
18
        private $textdomain;
19

20
        /**
21
         * The environment key to use to retrieve the message from.
22
         *
23
         * @var string
24
         */
25
        private $messageKey;
26

27
        /**
28
         * Whip_Message constructor.
29
         *
30
         * @param string $messageKey The environment key to use to retrieve the message from.
31
         * @param string $textdomain The text domain to use for translations.
32
         */
33
        public function __construct( $messageKey, $textdomain ) {
×
34
                $this->textdomain = $textdomain;
×
35
                $this->messageKey = $messageKey;
×
36
        }
37

38
        /**
39
         * Retrieves the message body.
40
         *
41
         * @return string The message body.
42
         */
43
        public function body() {
×
44
                $message = array();
×
45

46
                $message[] = Whip_MessageFormatter::strong( $this->title() ) . '<br />';
×
47
                $message[] = Whip_MessageFormatter::paragraph( Whip_Host::message( $this->messageKey ) );
×
48

49
                return implode( "\n", $message );
×
50
        }
51

52
        /**
53
         * Renders the message title.
54
         *
55
         * @return string The message title.
56
         */
57
        public function title() {
×
58
                /* translators: 1: name. */
59
                return sprintf( __( 'A message from %1$s', $this->textdomain ), Whip_Host::name() );
×
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

© 2026 Coveralls, Inc