1 | <?php |
||
18 | class SocialSharer extends Module\Module |
||
19 | { |
||
20 | /** |
||
21 | * array of the module |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | |||
26 | protected static $_moduleArray = |
||
27 | [ |
||
28 | 'name' => 'Social Sharer', |
||
29 | 'alias' => 'SocialSharer', |
||
30 | 'author' => 'Redaxmedia', |
||
31 | 'description' => 'Integrate social network buttons', |
||
32 | 'version' => '4.5.0', |
||
33 | 'license' => 'MIT' |
||
34 | ]; |
||
35 | |||
36 | /** |
||
37 | * array of the option |
||
38 | * |
||
39 | * @var array |
||
40 | */ |
||
41 | |||
42 | protected $_optionArray = |
||
43 | [ |
||
44 | 'className' => |
||
45 | [ |
||
46 | 'link' => 'rs-link-social-sharer', |
||
47 | 'list' => 'rs-list-social-sharer' |
||
48 | ], |
||
49 | 'network' => |
||
50 | [ |
||
51 | 'facebook' => |
||
52 | [ |
||
53 | 'url' => 'https://facebook.com/sharer.php?u=', |
||
54 | 'className' => 'rs-link-facebook' |
||
55 | ], |
||
56 | 'twitter' => |
||
57 | [ |
||
58 | 'url' => 'https://twitter.com/intent/tweet?url=', |
||
59 | 'className' => 'rs-link-twitter' |
||
60 | ], |
||
61 | 'whatsapp' => |
||
62 | [ |
||
63 | 'url' => 'https://api.whatsapp.com/send?text=', |
||
64 | 'className' => 'rs-link-whatsapp' |
||
65 | ], |
||
66 | 'telegram' => |
||
67 | [ |
||
68 | 'url' => 'https://telegram.me/share/url?url=', |
||
69 | 'className' => 'rs-link-telegram' |
||
70 | ] |
||
71 | ] |
||
72 | ]; |
||
73 | |||
74 | /** |
||
75 | * articleFragmentEnd |
||
76 | * |
||
77 | * @since 3.0.0 |
||
78 | * |
||
79 | * @return string|null |
||
80 | */ |
||
81 | |||
82 | public function articleFragmentEnd() : ?string |
||
91 | |||
92 | /** |
||
93 | * renderStart |
||
94 | * |
||
95 | * @since 3.0.0 |
||
96 | */ |
||
97 | |||
98 | public function renderStart() : void |
||
107 | |||
108 | /** |
||
109 | * render |
||
110 | * |
||
111 | * @since 2.2.0 |
||
112 | * |
||
113 | * @param string $url |
||
114 | * |
||
115 | * @return string|null |
||
116 | */ |
||
117 | |||
118 | public function render(string $url = null) : ?string |
||
163 | } |
||
164 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: