1 | <?php |
||
19 | final class Disqus |
||
20 | { |
||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $shortName; |
||
25 | |||
26 | /** |
||
27 | * @var WidgetLocatorInterface |
||
28 | */ |
||
29 | private $widgetLocator; |
||
30 | |||
31 | /** |
||
32 | * @var Code |
||
33 | */ |
||
34 | private $code; |
||
35 | |||
36 | public function __construct() |
||
39 | |||
40 | /** |
||
41 | * @param string $shortName Unique identifier of some Disqus website. |
||
42 | * @param WidgetLocatorInterface $widgetLocator OPTIONAL |
||
43 | * |
||
44 | * @return Disqus |
||
45 | */ |
||
46 | public static function create( |
||
64 | |||
65 | public function getShortName() : string |
||
69 | |||
70 | public function configure(array $config) |
||
74 | |||
75 | /** |
||
76 | * Proxies calls to some Disqus widget and returns HTML output. |
||
77 | * |
||
78 | * @param string $widgetId |
||
79 | * @param array $args |
||
80 | * |
||
81 | * @throws Exception\InvalidArgumentException |
||
82 | * |
||
83 | * @return string |
||
84 | */ |
||
85 | public function __call($widgetId, $args) : string |
||
99 | |||
100 | /** |
||
101 | * Builds JS code which loads configuration and necessary assets. |
||
102 | * |
||
103 | * This method should be called after using and rendering widgets, usually before closing </body> tag. |
||
104 | * |
||
105 | * @return string |
||
106 | */ |
||
107 | public function getCode() : string |
||
111 | |||
112 | public function __toString() : string |
||
116 | } |
||
117 |