@@ -189,8 +189,8 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | |
| 191 | 191 | /** |
| 192 | - * @param $circleUniqueId |
|
| 193 | - * @param $remote |
|
| 192 | + * @param string $circleUniqueId |
|
| 193 | + * @param string $remote |
|
| 194 | 194 | * |
| 195 | 195 | * @return FederatedLink |
| 196 | 196 | */ |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | * |
| 282 | 282 | * Will parse the error reason returned by requestLink() and throw an Exception |
| 283 | 283 | * |
| 284 | - * @param $reason |
|
| 284 | + * @param string $reason |
|
| 285 | 285 | * |
| 286 | 286 | * @throws Exception |
| 287 | 287 | * @throws FederatedRemoteDoesNotAllowException |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | * |
| 165 | 165 | * @throws Exception |
| 166 | 166 | */ |
| 167 | - public function requestedLinkFromRemoteCircle(Circle $circle, FederatedLink &$link) { |
|
| 167 | + public function requestedLinkFromRemoteCircle(Circle $circle, FederatedLink & $link) { |
|
| 168 | 168 | |
| 169 | 169 | try { |
| 170 | 170 | $this->checkLinkRequestValidity($circle, $link); |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | * @return boolean |
| 283 | 283 | * @throws Exception |
| 284 | 284 | */ |
| 285 | - private function forceRequestNewLink(Circle $circle, FederatedLink &$link) { |
|
| 285 | + private function forceRequestNewLink(Circle $circle, FederatedLink & $link) { |
|
| 286 | 286 | try { |
| 287 | 287 | $client = $this->clientService->newClient(); |
| 288 | 288 | $args = ['sourceName' => $circle->getName()]; |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | * |
| 318 | 318 | * @throws Exception |
| 319 | 319 | */ |
| 320 | - private function eventOnRequestLink(Circle $circle, FederatedLink &$link, $status, $reason) { |
|
| 320 | + private function eventOnRequestLink(Circle $circle, FederatedLink & $link, $status, $reason) { |
|
| 321 | 321 | |
| 322 | 322 | switch ($status) { |
| 323 | 323 | case FederatedLink::STATUS_LINK_UP: |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | * @return string |
| 218 | 218 | */ |
| 219 | 219 | public function generateLinkRemoteURL($remote) { |
| 220 | - return $this->configService->generateRemoteHost($remote) . self::REMOTE_URL_LINK; |
|
| 220 | + return $this->configService->generateRemoteHost($remote).self::REMOTE_URL_LINK; |
|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | * @return bool |
| 323 | 323 | * @throws Exception |
| 324 | 324 | */ |
| 325 | - private function updateLinkRemote(FederatedLink &$link) { |
|
| 325 | + private function updateLinkRemote(FederatedLink & $link) { |
|
| 326 | 326 | |
| 327 | 327 | try { |
| 328 | 328 | $client = $this->clientService->newClient(); |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | * @param Circle $circle |
| 379 | 379 | * @param FederatedLink $link |
| 380 | 380 | */ |
| 381 | - private function checkUpdateLinkFromRemoteLinkRequestSent(Circle $circle, FederatedLink &$link) { |
|
| 381 | + private function checkUpdateLinkFromRemoteLinkRequestSent(Circle $circle, FederatedLink & $link) { |
|
| 382 | 382 | |
| 383 | 383 | if ($link->getStatus() !== FederatedLink::STATUS_REQUEST_SENT) { |
| 384 | 384 | return; |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | * @param Circle $circle |
| 394 | 394 | * @param FederatedLink $link |
| 395 | 395 | */ |
| 396 | - private function checkUpdateLinkFromRemoteLinkRequested(Circle $circle, FederatedLink &$link) { |
|
| 396 | + private function checkUpdateLinkFromRemoteLinkRequested(Circle $circle, FederatedLink & $link) { |
|
| 397 | 397 | |
| 398 | 398 | if ($link->getStatus() !== FederatedLink::STATUS_LINK_REQUESTED) { |
| 399 | 399 | return; |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | * @param Circle $circle |
| 409 | 409 | * @param FederatedLink $link |
| 410 | 410 | */ |
| 411 | - private function checkUpdateLinkFromRemoteLinkDown(Circle $circle, FederatedLink &$link) { |
|
| 411 | + private function checkUpdateLinkFromRemoteLinkDown(Circle $circle, FederatedLink & $link) { |
|
| 412 | 412 | |
| 413 | 413 | if ($link->getStatus() < FederatedLink::STATUS_LINK_DOWN) { |
| 414 | 414 | return; |
@@ -303,6 +303,9 @@ |
||
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | |
| 306 | + /** |
|
| 307 | + * @param integer $status |
|
| 308 | + */ |
|
| 306 | 309 | public function hasToBeValidStatusUpdate($status) { |
| 307 | 310 | try { |
| 308 | 311 | $this->hasToBeValidStatusUpdateWhileLinkDown($status); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | 66 | * @param $arr |
| 67 | - * @param $k |
|
| 67 | + * @param string $k |
|
| 68 | 68 | * |
| 69 | 69 | * @param string $default |
| 70 | 70 | * |
@@ -79,6 +79,9 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| 82 | + /** |
|
| 83 | + * @param string[] $arr |
|
| 84 | + */ |
|
| 82 | 85 | public static function mustContains($data, $arr) { |
| 83 | 86 | if (!is_array($arr)) { |
| 84 | 87 | $arr = [$arr]; |
@@ -188,7 +191,7 @@ discard block |
||
| 188 | 191 | |
| 189 | 192 | |
| 190 | 193 | /** |
| 191 | - * @param $ident |
|
| 194 | + * @param string $ident |
|
| 192 | 195 | * |
| 193 | 196 | * @return mixed|string |
| 194 | 197 | */ |
@@ -284,7 +284,7 @@ |
||
| 284 | 284 | ob_start(); |
| 285 | 285 | echo(json_encode($result)); |
| 286 | 286 | $size = ob_get_length(); |
| 287 | - header('Content-Length: ' . $size); |
|
| 287 | + header('Content-Length: '.$size); |
|
| 288 | 288 | ob_end_flush(); |
| 289 | 289 | flush(); |
| 290 | 290 | } |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | |
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | - * @return DataResponse |
|
| 131 | + * @return string |
|
| 132 | 132 | */ |
| 133 | 133 | public function testAsyncStatus() { |
| 134 | 134 | return $this->miscService->success( |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | * @return string |
| 92 | 92 | */ |
| 93 | 93 | private function generateTestAsyncURL($remote) { |
| 94 | - return $this->configService->generateRemoteHost($remote) . Application::TEST_URL_ASYNC; |
|
| 94 | + return $this->configService->generateRemoteHost($remote).Application::TEST_URL_ASYNC; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @throws FakeException |
| 46 | 46 | */ |
| 47 | - public function parseGroupLink(IEvent &$event, Circle $circle, Member $group) { |
|
| 47 | + public function parseGroupLink(IEvent & $event, Circle $circle, Member $group) { |
|
| 48 | 48 | if ($event->getSubject() !== 'group_link') { |
| 49 | 49 | return; |
| 50 | 50 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | * |
| 66 | 66 | * @throws FakeException |
| 67 | 67 | */ |
| 68 | - public function parseGroupUnlink(IEvent &$event, Circle $circle, Member $group) { |
|
| 68 | + public function parseGroupUnlink(IEvent & $event, Circle $circle, Member $group) { |
|
| 69 | 69 | if ($event->getSubject() !== 'group_unlink') { |
| 70 | 70 | return; |
| 71 | 71 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * |
| 87 | 87 | * @throws FakeException |
| 88 | 88 | */ |
| 89 | - public function parseGroupLevel(IEvent &$event, Circle $circle, Member $group) { |
|
| 89 | + public function parseGroupLevel(IEvent & $event, Circle $circle, Member $group) { |
|
| 90 | 90 | if ($event->getSubject() !== 'group_level') { |
| 91 | 91 | return; |
| 92 | 92 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * @param string $othersEvent |
| 74 | 74 | */ |
| 75 | 75 | protected function parseCircleEvent( |
| 76 | - IEvent &$event, Circle $circle, $remote, $ownEvent, $othersEvent |
|
| 76 | + IEvent & $event, Circle $circle, $remote, $ownEvent, $othersEvent |
|
| 77 | 77 | ) { |
| 78 | 78 | $data = [ |
| 79 | 79 | 'author' => $this->generateViewerParameter($circle), |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @param $othersEvent |
| 102 | 102 | */ |
| 103 | 103 | protected function parseMemberEvent( |
| 104 | - IEvent &$event, Circle $circle, Member $member, $ownEvent, $othersEvent |
|
| 104 | + IEvent & $event, Circle $circle, Member $member, $ownEvent, $othersEvent |
|
| 105 | 105 | ) { |
| 106 | 106 | $data = [ |
| 107 | 107 | 'circle' => $this->generateCircleParameter($circle), |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | * @param IEvent $event |
| 128 | 128 | * @param string $line |
| 129 | 129 | */ |
| 130 | - protected function parseLinkEvent(IEvent &$event, Circle $circle, FederatedLink $remote, $line |
|
| 130 | + protected function parseLinkEvent(IEvent & $event, Circle $circle, FederatedLink $remote, $line |
|
| 131 | 131 | ) { |
| 132 | 132 | $data = [ |
| 133 | 133 | 'circle' => $this->generateCircleParameter($circle), |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * @param string $othersEvent |
| 149 | 149 | */ |
| 150 | 150 | protected function parseCircleMemberEvent( |
| 151 | - IEvent &$event, Circle $circle, Member $member, $ownEvent, $othersEvent |
|
| 151 | + IEvent & $event, Circle $circle, Member $member, $ownEvent, $othersEvent |
|
| 152 | 152 | ) { |
| 153 | 153 | $data = [ |
| 154 | 154 | 'author' => $this->generateViewerParameter($circle), |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | * @param $othersEvent |
| 180 | 180 | */ |
| 181 | 181 | protected function parseCircleMemberAdvancedEvent( |
| 182 | - IEvent &$event, Circle $circle, Member $member, $ownEvent, $targetEvent, $othersEvent |
|
| 182 | + IEvent & $event, Circle $circle, Member $member, $ownEvent, $targetEvent, $othersEvent |
|
| 183 | 183 | ) { |
| 184 | 184 | $data = [ |
| 185 | 185 | 'author' => $this->generateViewerParameter($circle), |
@@ -244,9 +244,9 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | protected function generateExternalMemberParameter(Member $member) { |
| 246 | 246 | return [ |
| 247 | - 'type' => 'member_' . $member->getType(), |
|
| 247 | + 'type' => 'member_'.$member->getType(), |
|
| 248 | 248 | 'id' => $member->getUserId(), |
| 249 | - 'name' => $member->getDisplayName() . ' (' . $member->getTypeString() . ')', |
|
| 249 | + 'name' => $member->getDisplayName().' ('.$member->getTypeString().')', |
|
| 250 | 250 | 'parsed' => $member->getDisplayName() |
| 251 | 251 | ]; |
| 252 | 252 | } |
@@ -277,8 +277,8 @@ discard block |
||
| 277 | 277 | return [ |
| 278 | 278 | 'type' => 'circle', |
| 279 | 279 | 'id' => $link->getUniqueId(), |
| 280 | - 'name' => $link->getToken() . '@' . $link->getAddress(), |
|
| 281 | - 'parsed' => $link->getToken() . '@' . $link->getAddress() |
|
| 280 | + 'name' => $link->getToken().'@'.$link->getAddress(), |
|
| 281 | + 'parsed' => $link->getToken().'@'.$link->getAddress() |
|
| 282 | 282 | ]; |
| 283 | 283 | } |
| 284 | 284 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * |
| 44 | 44 | * @throws FakeException |
| 45 | 45 | */ |
| 46 | - public function parseSubjectCircleCreate(IEvent &$event, Circle $circle) { |
|
| 46 | + public function parseSubjectCircleCreate(IEvent & $event, Circle $circle) { |
|
| 47 | 47 | if ($event->getSubject() !== 'circle_create') { |
| 48 | 48 | return; |
| 49 | 49 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @throws FakeException |
| 66 | 66 | */ |
| 67 | - public function parseSubjectCircleDelete(IEvent &$event, Circle $circle) { |
|
| 67 | + public function parseSubjectCircleDelete(IEvent & $event, Circle $circle) { |
|
| 68 | 68 | if ($event->getSubject() !== 'circle_delete') { |
| 69 | 69 | return; |
| 70 | 70 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @throws FakeException |
| 46 | 46 | */ |
| 47 | - public function parseLinkRequestSent(IEvent &$event, Circle $circle, FederatedLink $remote) { |
|
| 47 | + public function parseLinkRequestSent(IEvent & $event, Circle $circle, FederatedLink $remote) { |
|
| 48 | 48 | if ($event->getSubject() !== 'link_request_sent') { |
| 49 | 49 | return; |
| 50 | 50 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * |
| 67 | 67 | * @throws FakeException |
| 68 | 68 | */ |
| 69 | - public function parseLinkRequestReceived(IEvent &$event, Circle $circle, FederatedLink $remote) { |
|
| 69 | + public function parseLinkRequestReceived(IEvent & $event, Circle $circle, FederatedLink $remote) { |
|
| 70 | 70 | if ($event->getSubject() !== 'link_request_received') { |
| 71 | 71 | return; |
| 72 | 72 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * |
| 87 | 87 | * @throws FakeException |
| 88 | 88 | */ |
| 89 | - public function parseLinkRequestRejected(IEvent &$event, Circle $circle, FederatedLink $remote) { |
|
| 89 | + public function parseLinkRequestRejected(IEvent & $event, Circle $circle, FederatedLink $remote) { |
|
| 90 | 90 | if ($event->getSubject() !== 'link_request_rejected') { |
| 91 | 91 | return; |
| 92 | 92 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | * |
| 108 | 108 | * @throws FakeException |
| 109 | 109 | */ |
| 110 | - public function parseLinkRequestCanceled(IEvent &$event, Circle $circle, FederatedLink $remote) { |
|
| 110 | + public function parseLinkRequestCanceled(IEvent & $event, Circle $circle, FederatedLink $remote) { |
|
| 111 | 111 | if ($event->getSubject() !== 'link_request_canceled') { |
| 112 | 112 | return; |
| 113 | 113 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | * |
| 131 | 131 | * @throws FakeException |
| 132 | 132 | */ |
| 133 | - public function parseLinkRequestAccepted(IEvent &$event, Circle $circle, FederatedLink $remote) { |
|
| 133 | + public function parseLinkRequestAccepted(IEvent & $event, Circle $circle, FederatedLink $remote) { |
|
| 134 | 134 | if ($event->getSubject() !== 'link_request_accepted') { |
| 135 | 135 | return; |
| 136 | 136 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * |
| 152 | 152 | * @throws FakeException |
| 153 | 153 | */ |
| 154 | - public function parseLinkRequestRemoved(IEvent &$event, Circle $circle, FederatedLink $remote) { |
|
| 154 | + public function parseLinkRequestRemoved(IEvent & $event, Circle $circle, FederatedLink $remote) { |
|
| 155 | 155 | if ($event->getSubject() !== 'link_request_removed') { |
| 156 | 156 | return; |
| 157 | 157 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | * |
| 174 | 174 | * @throws FakeException |
| 175 | 175 | */ |
| 176 | - public function parseLinkRequestCanceling(IEvent &$event, Circle $circle, FederatedLink $remote) { |
|
| 176 | + public function parseLinkRequestCanceling(IEvent & $event, Circle $circle, FederatedLink $remote) { |
|
| 177 | 177 | if ($event->getSubject() !== 'link_request_canceling') { |
| 178 | 178 | return; |
| 179 | 179 | } |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | * |
| 196 | 196 | * @throws FakeException |
| 197 | 197 | */ |
| 198 | - public function parseLinkRequestAccepting(IEvent &$event, Circle $circle, FederatedLink $remote) { |
|
| 198 | + public function parseLinkRequestAccepting(IEvent & $event, Circle $circle, FederatedLink $remote) { |
|
| 199 | 199 | if ($event->getSubject() !== 'link_request_accepting') { |
| 200 | 200 | return; |
| 201 | 201 | } |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | * |
| 218 | 218 | * @throws FakeException |
| 219 | 219 | */ |
| 220 | - public function parseLinkUp(IEvent &$event, Circle $circle, FederatedLink $remote) { |
|
| 220 | + public function parseLinkUp(IEvent & $event, Circle $circle, FederatedLink $remote) { |
|
| 221 | 221 | if ($event->getSubject() !== 'link_up') { |
| 222 | 222 | return; |
| 223 | 223 | } |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | * |
| 239 | 239 | * @throws FakeException |
| 240 | 240 | */ |
| 241 | - public function parseLinkDown(IEvent &$event, Circle $circle, FederatedLink $remote) { |
|
| 241 | + public function parseLinkDown(IEvent & $event, Circle $circle, FederatedLink $remote) { |
|
| 242 | 242 | if ($event->getSubject() !== 'link_down') { |
| 243 | 243 | return; |
| 244 | 244 | } |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | * |
| 262 | 262 | * @throws FakeException |
| 263 | 263 | */ |
| 264 | - public function parseLinkRemove(IEvent &$event, Circle $circle, FederatedLink $remote) { |
|
| 264 | + public function parseLinkRemove(IEvent & $event, Circle $circle, FederatedLink $remote) { |
|
| 265 | 265 | if ($event->getSubject() !== 'link_remove') { |
| 266 | 266 | return; |
| 267 | 267 | } |