1 | <?php |
||
37 | class SharesService { |
||
38 | |||
39 | /** @var string */ |
||
40 | private $userId; |
||
41 | |||
42 | /** @var CirclesRequest */ |
||
43 | private $circlesRequest; |
||
44 | |||
45 | /** @var FederatedService */ |
||
46 | private $federatedService; |
||
47 | /** @var MiscService */ |
||
48 | private $miscService; |
||
49 | |||
50 | |||
51 | /** |
||
52 | * SharesService constructor. |
||
53 | * |
||
54 | * @param string $userId |
||
55 | * @param CirclesRequest $circlesRequest |
||
56 | * @param FederatedService $federatedService |
||
57 | * @param MiscService $miscService |
||
58 | */ |
||
59 | public function __construct( |
||
70 | |||
71 | |||
72 | /** |
||
73 | * createFrame() |
||
74 | * |
||
75 | * Save the Frame containing the Payload. |
||
76 | * The Payload will be shared locally, and spread it live if a Broadcaster is set. |
||
77 | * Function will also initiate the federated broadcast to linked circles. |
||
78 | * |
||
79 | * @param Frame $frame |
||
80 | * @param string|null $broadcast |
||
81 | * |
||
82 | * @return bool |
||
83 | * @throws BroadcasterIsNotCompatible |
||
84 | */ |
||
85 | public function createFrame(Frame $frame, string $broadcast = null) { |
||
100 | |||
101 | |||
102 | /** |
||
103 | * broadcast the Share item using a IBroadcaster, usually set by the app that created the Share |
||
104 | * item. |
||
105 | * |
||
106 | * @param string $broadcast |
||
107 | * @param Frame $frame |
||
108 | * |
||
109 | * @throws BroadcasterIsNotCompatible |
||
110 | */ |
||
111 | private function broadcastItem(string $broadcast, Frame $frame) { |
||
129 | |||
130 | |||
131 | public function shareItemToFederatedLinks(Frame $share, string $broadcast = null) { |
||
137 | |||
138 | |||
139 | |||
140 | // public function reshare($circleId, $source, $type, $shareid) { |
||
141 | // $this->miscService->log( |
||
142 | // "__reshare" . $circleId . ' ' . $source . ' ' . $type . ' ' . json_encode($item) |
||
143 | // ); |
||
144 | // |
||
145 | // $share = new Share($source, $type); |
||
146 | // $share->setCircleId($circleId); |
||
147 | // $share->setItem($item); |
||
148 | // |
||
149 | // $share->setAuthor($this->userId); |
||
150 | // |
||
151 | // $this->circlesRequest->createShare($share); |
||
152 | // |
||
153 | // return true; |
||
154 | // } |
||
155 | |||
156 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.