1 | <?php |
||
11 | class OpauthResponseHelper { |
||
|
|||
12 | |||
13 | /** |
||
14 | * Take the first part of the name |
||
15 | * @return string |
||
16 | */ |
||
17 | public static function get_first_name($source) { |
||
21 | |||
22 | /** |
||
23 | * Take all but the first part of the name |
||
24 | * @return string |
||
25 | */ |
||
26 | public static function get_last_name($source) { |
||
31 | |||
32 | /** |
||
33 | * Twitter responds with just a language (also a TZ, but unused for now) |
||
34 | * If the PECL Locale extension is used it may be possible to combine both |
||
35 | * the TZ and the language to fine tune a user's location, but a bit OTT. |
||
36 | * @return string |
||
37 | */ |
||
38 | public static function get_twitter_locale($source) { |
||
42 | |||
43 | /** |
||
44 | * Google responds near perfectly for locales, if populated. |
||
45 | * Fallback otherwise. |
||
46 | * @return string |
||
47 | */ |
||
48 | public static function get_google_locale($source) { |
||
55 | |||
56 | /** |
||
57 | * Try very hard to get a locale for this user. Helps for i18n etc. |
||
58 | * @return string |
||
59 | */ |
||
60 | public static function get_smart_locale($language = null) { |
||
83 | |||
84 | /** |
||
85 | * Dot notation parser. Looks for an index or fails gracefully if not found. |
||
86 | * @param string $path The path, dot notated. |
||
87 | * @param array $source The source in which to search. |
||
88 | * @return string|null |
||
89 | */ |
||
90 | public static function parse_source_path($path, $source) { |
||
101 | |||
102 | } |
||
103 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.