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

Yoast / wordpress-seo / 7004843404

27 Nov 2023 11:48AM UTC coverage: 49.206% (-0.03%) from 49.232%
7004843404

push

github

web-flow
Merge pull request #20858 from Yoast/improve-copy-in-the-ftc-57

15305 of 31104 relevant lines covered (49.21%)

4.03 hits per line

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

0.0
/src/wordpress/wrapper.php
1
<?php
2

3
namespace Yoast\WP\SEO\WordPress;
4

5
use wpdb;
6
use WPSEO_Addon_Manager;
7
use WPSEO_Admin_Asset_Manager;
8
use WPSEO_Replace_Vars;
9
use WPSEO_Shortlinker;
10
use WPSEO_Utils;
11

12
/**
13
 * Wrapper class for WordPress globals.
14
 *
15
 * This consists of factory functions to inject WP globals into the dependency container.
16
 */
17
class Wrapper {
18

19
        /**
20
         * Wrapper method for returning the wpdb object for use in dependency injection.
21
         *
22
         * @return wpdb The wpdb global.
23
         */
24
        public static function get_wpdb() {
×
25
                global $wpdb;
×
26

27
                return $wpdb;
×
28
        }
29

30
        /**
31
         * Factory function for replace vars helper.
32
         *
33
         * @return WPSEO_Replace_Vars The replace vars helper.
34
         */
35
        public static function get_replace_vars() {
×
36
                return new WPSEO_Replace_Vars();
×
37
        }
38

39
        /**
40
         * Factory function for the admin asset manager.
41
         *
42
         * @return WPSEO_Admin_Asset_Manager The admin asset manager.
43
         */
44
        public static function get_admin_asset_manager() {
×
45
                return new WPSEO_Admin_Asset_Manager();
×
46
        }
47

48
        /**
49
         * Factory function for the addon manager.
50
         *
51
         * @return WPSEO_Addon_Manager The addon manager.
52
         */
53
        public static function get_addon_manager() {
×
54
                return new WPSEO_Addon_Manager();
×
55
        }
56

57
        /**
58
         * Factory function for the shortlinker.
59
         *
60
         * @return WPSEO_Shortlinker
61
         */
62
        public static function get_shortlinker() {
×
63
                return new WPSEO_Shortlinker();
×
64
        }
65

66
        /**
67
         * Factory function for the utils class.
68
         *
69
         * @return WPSEO_Utils
70
         */
71
        public static function get_utils() {
×
72
                return new WPSEO_Utils();
×
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