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

Yoast / whip / 7300735247

22 Dec 2023 02:07PM UTC coverage: 31.683% (+3.0%) from 28.713%
7300735247

push

github

web-flow
Merge pull request #157 from Yoast/move-to-namespace-v2

Move source classes to the `Yoast\WHIPv2` namespace

30 of 114 new or added lines in 18 files covered. (26.32%)

96 of 303 relevant lines covered (31.68%)

2.66 hits per line

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

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

3
namespace Yoast\WHIPv2;
4

5
use Yoast\WHIPv2\Interfaces\DismissStorage;
6

7
/**
8
 * Represents the WordPress option for saving the dismissed messages.
9
 *
10
 * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded -- Sniff does not count acronyms correctly.
11
 */
12
class WPDismissOption implements DismissStorage {
13

14
        /**
15
         * WordPress option name.
16
         *
17
         * @var string
18
         */
19
        protected $optionName = 'whip_dismiss_timestamp';
20

21
        /**
22
         * Saves the value to the options.
23
         *
24
         * @param int $dismissedValue The value to save.
25
         *
26
         * @return bool True when successful.
27
         */
28
        public function set( $dismissedValue ) {
×
NEW
29
                return \update_option( $this->optionName, $dismissedValue );
×
30
        }
31

32
        /**
33
         * Returns the value of the whip_dismissed option.
34
         *
35
         * @return int Returns the value of the option or an empty string when not set.
36
         */
37
        public function get() {
×
NEW
38
                $dismissedOption = \get_option( $this->optionName );
×
39
                if ( ! $dismissedOption ) {
×
40
                        return 0;
×
41
                }
42

43
                return (int) $dismissedOption;
×
44
        }
45
}
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