PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.1
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.1
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / surfaces / helpers-surface.php

helpers-surface.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 18.1, at src/surfaces/helpers-surface.php

111 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Surfaces;
4
5 use Yoast\WP\SEO\Helpers;
6 use YoastSEO_Vendor\Symfony\Component\DependencyInjection\ContainerInterface;
7
8 /**
9 * Class Helpers_Surface.
10 *
11 * Surface for the indexables.
12 *
13 * @property Helpers\Asset_Helper $asset
14 * @property Helpers\Author_Archive_Helper $author_archive
15 * @property Helpers\Blocks_Helper $blocks
16 * @property Helpers\Capability_Helper $capability
17 * @property Helpers\Current_Page_Helper $current_page
18 * @property Helpers\Date_Helper $date
19 * @property Helpers\Environment_Helper $environment
20 * @property Helpers\Home_Url_Helper $home_url
21 * @property Helpers\Image_Helper $image
22 * @property Helpers\Indexable_Helper $indexable
23 * @property Helpers\Indexing_Helper $indexing
24 * @property Helpers\Input_Helper $input
25 * @property Helpers\Language_Helper $language
26 * @property Helpers\Meta_Helper $meta
27 * @property Helpers\Notification_Helper $notification
28 * @property Helpers\Options_Helper $options
29 * @property Helpers\Pagination_Helper $pagination
30 * @property Helpers\Permalink_Helper $permalink
31 * @property Helpers\Post_Helper $post
32 * @property Helpers\Post_Type_Helper $post_type
33 * @property Helpers\Primary_Term_Helper $primary_term
34 * @property Helpers\Product_Helper $product
35 * @property Helpers\Redirect_Helper $redirect
36 * @property Helpers\Request_Helper $request
37 * @property Helpers\Require_File_Helper $require_file
38 * @property Helpers\Robots_Helper $robots
39 * @property Helpers\Short_Link_Helper $short_link
40 * @property Helpers\Site_Helper $site
41 * @property Helpers\String_Helper $string
42 * @property Helpers\Taxonomy_Helper $taxonomy
43 * @property Helpers\Url_Helper $url
44 * @property Helpers\User_Helper $user
45 * @property Helpers\Woocommerce_Helper $woocommerce
46 * @property Helpers\Wordpress_Helper $wordpress
47 */
48 class Helpers_Surface {
49
50 /**
51 * The DI container.
52 *
53 * @var ContainerInterface
54 */
55 private $container;
56
57 /**
58 * The open_graph helper namespace
59 *
60 * @var Open_Graph_Helpers_Surface
61 */
62 public $open_graph;
63
64 /**
65 * The schema helper namespace
66 *
67 * @var Schema_Helpers_Surface
68 */
69 public $schema;
70
71 /**
72 * The twitter helper namespace
73 *
74 * @var Twitter_Helpers_Surface
75 */
76 public $twitter;
77
78 /**
79 * Loader constructor.
80 *
81 * @param ContainerInterface $container The dependency injection container.
82 * @param Open_Graph_Helpers_Surface $open_graph The OpenGraph helpers surface.
83 * @param Schema_Helpers_Surface $schema The Schema helpers surface.
84 * @param Twitter_Helpers_Surface $twitter The Twitter helpers surface.
85 */
86 public function __construct(
87 ContainerInterface $container,
88 Open_Graph_Helpers_Surface $open_graph,
89 Schema_Helpers_Surface $schema,
90 Twitter_Helpers_Surface $twitter
91 ) {
92 $this->container = $container;
93 $this->open_graph = $open_graph;
94 $this->schema = $schema;
95 $this->twitter = $twitter;
96 }
97
98 /**
99 * Magic getter for getting helper classes.
100 *
101 * @param string $helper The helper to get.
102 *
103 * @return mixed The helper class.
104 */
105 public function __get( $helper ) {
106 $helper = \implode( '_', \array_map( 'ucfirst', \explode( '_', $helper ) ) );
107 $class = "Yoast\WP\SEO\Helpers\\{$helper}_Helper";
108 return $this->container->get( $class );
109 }
110 }
111