1 | <?php |
||
19 | final class Disqus |
||
20 | { |
||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $shortName; |
||
25 | |||
26 | /** |
||
27 | * @var array |
||
28 | */ |
||
29 | private $config; |
||
30 | |||
31 | /** |
||
32 | * @var WidgetLocatorInterface |
||
33 | */ |
||
34 | private $widgetLocator; |
||
35 | |||
36 | /** |
||
37 | * @var Code |
||
38 | */ |
||
39 | private $code; |
||
40 | |||
41 | public function __construct() |
||
44 | |||
45 | /** |
||
46 | * @param string $shortName Unique identifier of some Disqus website. |
||
47 | * @param array $config OPTIONAL Any additional Disqus configuration (https://help.disqus.com/customer/portal/articles/472098-javascript-configuration-variables). |
||
48 | * @param WidgetLocatorInterface $widgetLocator OPTIONAL |
||
49 | * |
||
50 | * @return Disqus |
||
51 | */ |
||
52 | public static function create( |
||
75 | |||
76 | public function getShortName() : string |
||
80 | |||
81 | public function getConfig() : array |
||
85 | |||
86 | /** |
||
87 | * Proxies calls to some Disqus widget and returns HTML output. |
||
88 | * |
||
89 | * @param string $widgetId |
||
90 | * @param array $args |
||
91 | * |
||
92 | * @throws Exception\InvalidArgumentException |
||
93 | * |
||
94 | * @return string |
||
95 | */ |
||
96 | public function __call($widgetId, $args) : string |
||
118 | |||
119 | /** |
||
120 | * Builds JS code which loads configuration and necessary assets. |
||
121 | * |
||
122 | * This method should be called after using and rendering widgets, usually before closing </body> tag. |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | public function getCode() : string |
||
130 | |||
131 | public function __toString() : string |
||
135 | } |
||
136 |