1 | <?php |
||
14 | abstract class ProviderBase |
||
15 | { |
||
16 | protected $page; |
||
17 | |||
18 | const RFC1738 = 1; |
||
19 | const RFC3986 = 2; |
||
20 | |||
21 | /** |
||
22 | * Constructor. |
||
23 | * |
||
24 | * @param Page $page |
||
25 | */ |
||
26 | public function __construct(Page $page) |
||
30 | |||
31 | /** |
||
32 | * Magic method to calculate and store the properties. |
||
33 | */ |
||
34 | public function __get($key) |
||
92 | |||
93 | /** |
||
94 | * Default shareCount function for providers without count api. |
||
95 | * |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | public function shareCount($response) |
||
102 | |||
103 | /** |
||
104 | * Default shareCountRequest function for providers without count api. |
||
105 | * |
||
106 | * {@inheritdoc} |
||
107 | */ |
||
108 | public function shareCountRequest() |
||
112 | |||
113 | /** |
||
114 | * Default shareCountMultiple function for providers without count api. |
||
115 | * |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | public function shareCountMultiple($response) |
||
122 | |||
123 | /** |
||
124 | * Default shareCountRequestMultiple function for providers without |
||
125 | * count api. |
||
126 | * |
||
127 | * {@inheritdoc} |
||
128 | */ |
||
129 | public function shareCountRequestMultiple() |
||
133 | |||
134 | /** |
||
135 | * Generates a valid url. |
||
136 | * |
||
137 | * @param string $url |
||
138 | * @param array $pageParams parameters to be taken from page fields as $paramName => $paramNameInTheURL |
||
139 | * @param array $getParams extra parameters as $key => $value |
||
140 | * @param int $encoding Type of encoding used. It can be static::RFC3986 or static::RFC1738 |
||
141 | * |
||
142 | * @return string |
||
143 | */ |
||
144 | protected function buildUrl($url, array $pageParams = null, array $getParams = array(), $encoding = self::RFC1738) |
||
166 | |||
167 | /** |
||
168 | * Build a curl request. |
||
169 | * |
||
170 | * @param string $url |
||
171 | * @param bool|string $post |
||
172 | * @param array $headers |
||
173 | * |
||
174 | * @return resource |
||
175 | */ |
||
176 | protected static function request($url, $post = false, array $headers = null) |
||
208 | |||
209 | /** |
||
210 | * Handle JSON responses. |
||
211 | * |
||
212 | * @param string $content |
||
213 | * |
||
214 | * @return array|false |
||
215 | */ |
||
216 | protected static function jsonResponse($content) |
||
220 | |||
221 | /** |
||
222 | * Handle JSONP responses. |
||
223 | * |
||
224 | * @param string $content |
||
225 | * |
||
226 | * @return array|false |
||
227 | */ |
||
228 | protected static function jsonpResponse($content) |
||
234 | |||
235 | /** |
||
236 | * Handle HTML responses. |
||
237 | * |
||
238 | * @param string $content |
||
239 | * |
||
240 | * @return DOMDocument |
||
241 | */ |
||
242 | protected static function htmlResponse($content) |
||
251 | } |
||
252 |
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.