1 | <?php namespace Arcanedev\SeoHelper\Entities; |
||
12 | class Webmasters implements WebmastersContract |
||
13 | { |
||
14 | /* ----------------------------------------------------------------- |
||
15 | | Traits |
||
16 | | ----------------------------------------------------------------- |
||
17 | */ |
||
18 | |||
19 | use Configurable; |
||
20 | |||
21 | /* ----------------------------------------------------------------- |
||
22 | | Properties |
||
23 | | ----------------------------------------------------------------- |
||
24 | */ |
||
25 | |||
26 | /** |
||
27 | * The supported webmasters. |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $supported = [ |
||
32 | 'google' => 'google-site-verification', |
||
33 | 'bing' => 'msvalidate.01', |
||
34 | 'alexa' => 'alexaVerifyID', |
||
35 | 'pinterest' => 'p:domain_verify', |
||
36 | 'yandex' => 'yandex-verification' |
||
37 | ]; |
||
38 | |||
39 | /** |
||
40 | * The meta collection. |
||
41 | * |
||
42 | * @var \Arcanedev\SeoHelper\Contracts\Entities\MetaCollection |
||
43 | */ |
||
44 | protected $metas; |
||
45 | |||
46 | /* ----------------------------------------------------------------- |
||
47 | | Constructor |
||
48 | | ----------------------------------------------------------------- |
||
49 | */ |
||
50 | |||
51 | /** |
||
52 | * Create Webmasters instance. |
||
53 | * |
||
54 | * @param array $configs |
||
55 | */ |
||
56 | 108 | public function __construct(array $configs = []) |
|
63 | |||
64 | /** |
||
65 | * Start the engine. |
||
66 | */ |
||
67 | 108 | private function init() |
|
73 | |||
74 | /* ----------------------------------------------------------------- |
||
75 | | Getters & Setters |
||
76 | | ----------------------------------------------------------------- |
||
77 | */ |
||
78 | |||
79 | /** |
||
80 | * Get the webmaster meta name. |
||
81 | * |
||
82 | * @param string $webmaster |
||
83 | * |
||
84 | * @return string |
||
85 | */ |
||
86 | 108 | private function getWebmasterName($webmaster) |
|
92 | |||
93 | /** |
||
94 | * Get all the metas collection. |
||
95 | * |
||
96 | * @return \Arcanedev\SeoHelper\Contracts\Entities\MetaCollection |
||
97 | */ |
||
98 | 3 | public function all() |
|
102 | |||
103 | /* ----------------------------------------------------------------- |
||
104 | | Main Methods |
||
105 | | ----------------------------------------------------------------- |
||
106 | */ |
||
107 | /** |
||
108 | * Make Webmaster instance. |
||
109 | * |
||
110 | * @param array $webmasters |
||
111 | * |
||
112 | * @return \Arcanedev\SeoHelper\Entities\Webmasters |
||
113 | */ |
||
114 | 6 | public static function make(array $webmasters = []) |
|
118 | |||
119 | /** |
||
120 | * Add a webmaster to collection. |
||
121 | * |
||
122 | * @param string $webmaster |
||
123 | * @param string $content |
||
124 | * |
||
125 | * @return \Arcanedev\SeoHelper\Entities\Webmasters |
||
126 | */ |
||
127 | 108 | public function add($webmaster, $content) |
|
135 | |||
136 | /** |
||
137 | * Reset the webmaster collection. |
||
138 | * |
||
139 | * @return \Arcanedev\SeoHelper\Entities\Webmasters |
||
140 | */ |
||
141 | 108 | public function reset() |
|
147 | |||
148 | /** |
||
149 | * Render the tag. |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | 81 | public function render() |
|
157 | |||
158 | /** |
||
159 | * Render the tag. |
||
160 | * |
||
161 | * @return string |
||
162 | */ |
||
163 | 12 | public function __toString() |
|
167 | |||
168 | /* ----------------------------------------------------------------- |
||
169 | | Check Methods |
||
170 | | ----------------------------------------------------------------- |
||
171 | */ |
||
172 | |||
173 | /** |
||
174 | * Check if the webmaster is supported. |
||
175 | * |
||
176 | * @param string $webmaster |
||
177 | * |
||
178 | * @return bool |
||
179 | */ |
||
180 | 108 | private function isSupported($webmaster) |
|
184 | } |
||
185 |