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

Yoast / wordpress-seo / fe4d74ae81b231d2986738b4e4648c24370c79ea

26 Feb 2025 02:54PM UTC coverage: 45.177% (-5.5%) from 50.712%
fe4d74ae81b231d2986738b4e4648c24370c79ea

push

github

enricobattocchi
Drop compatibility with PHP 7.2 and 7.3

15990 of 35394 relevant lines covered (45.18%)

4.08 hits per line

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

63.16
/src/editors/framework/integrations/wincher.php
1
<?php
2
// @phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- This namespace should reflect the namespace of the original class.
3
namespace Yoast\WP\SEO\Editors\Framework\Integrations;
4

5
use Yoast\WP\SEO\Editors\Domain\Integrations\Integration_Data_Provider_Interface;
6
use Yoast\WP\SEO\Helpers\Options_Helper;
7
use Yoast\WP\SEO\Helpers\Wincher_Helper;
8

9
/**
10
 * Describes if the Wincher integration is enabled.
11
 */
12
class Wincher implements Integration_Data_Provider_Interface {
13

14
        /**
15
         * The Wincher helper.
16
         *
17
         * @var Wincher_Helper
18
         */
19
        private $wincher_helper;
20

21
        /**
22
         * The options helper.
23
         *
24
         * @var Options_Helper
25
         */
26
        private $options_helper;
27

28
        /**
29
         * The constructor.
30
         *
31
         * @param Wincher_Helper $wincher_helper The Wincher helper.
32
         * @param Options_Helper $options_helper The options helper.
33
         */
34
        public function __construct( Wincher_Helper $wincher_helper, Options_Helper $options_helper ) {
4✔
35
                $this->wincher_helper = $wincher_helper;
4✔
36
                $this->options_helper = $options_helper;
4✔
37
        }
38

39
        /**
40
         * If the integration is activated.
41
         *
42
         * @return bool If the integration is activated.
43
         */
44
        public function is_enabled(): bool {
4✔
45
                return $this->wincher_helper->is_active();
4✔
46
        }
47

48
        /**
49
         * Return this object represented by a key value array.
50
         *
51
         * @return array<string,bool> Returns the name and if the feature is enabled.
52
         */
53
        public function to_array(): array {
×
54
                return [
×
55
                        'active'            => $this->is_enabled(),
×
56
                        'loginStatus'       => $this->is_enabled() && $this->wincher_helper->login_status(),
×
57
                        'websiteId'         => $this->options_helper->get( 'wincher_website_id', '' ),
×
58
                        'autoAddKeyphrases' => $this->options_helper->get( 'wincher_automatically_add_keyphrases', false ),
×
59
                ];
×
60
        }
61

62
        /**
63
         * Returns this object represented by a key value structure that is compliant with the script data array.
64
         *
65
         * @return array<string,bool> Returns the legacy key and if the feature is enabled.
66
         */
67
        public function to_legacy_array(): array {
2✔
68
                return [
2✔
69
                        'wincherIntegrationActive' => $this->is_enabled(),
2✔
70
                        'wincherLoginStatus'       => $this->is_enabled() && $this->wincher_helper->login_status(),
2✔
71
                        'wincherWebsiteId'         => $this->options_helper->get( 'wincher_website_id', '' ),
2✔
72
                        'wincherAutoAddKeyphrases' => $this->options_helper->get( 'wincher_automatically_add_keyphrases', false ),
2✔
73
                ];
2✔
74
        }
75
}
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