Skip to content

Commit

Permalink
Changes:
Browse files Browse the repository at this point in the history
- fixed wrong type-hint uid => int
- added returned type-hint
- added some documentation
- formatted arrays a bit
  • Loading branch information
Quix0r committed Jul 28, 2022
1 parent d4320cf commit bd604ac
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
10 changes: 5 additions & 5 deletions src/Model/OpenWebAuthToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ class OpenWebAuthToken
* @return boolean
* @throws \Exception
*/
public static function create(string $type, uid $uid, string $token, string $meta)
public static function create(string $type, int $uid, string $token, string $meta)
{
$fields = [
'type' => $type,
'uid' => $uid,
'token' => $token,
'meta' => $meta,
'type' => $type,
'uid' => $uid,
'token' => $token,
'meta' => $meta,
'created' => DateTimeFormat::utcNow()
];
return DBA::insert('openwebauth-token', $fields);
Expand Down
4 changes: 3 additions & 1 deletion src/Module/Diaspora/Receive.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ protected function post(array $request = [])
/**
* Receive a public Diaspora posting
*
* @return void
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
Expand All @@ -84,6 +85,7 @@ private function receivePublic()
/**
* Receive a Diaspora posting for a user
*
* @return void
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
Expand Down Expand Up @@ -127,7 +129,7 @@ private function receiveUser()
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
private function decodePost(bool $public = true, string $privKey = '')
private function decodePost(bool $public = true, string $privKey = ''): array
{
if (empty($_POST['xml'])) {

Expand Down
18 changes: 9 additions & 9 deletions src/Protocol/Diaspora.php
Original file line number Diff line number Diff line change
Expand Up @@ -1357,15 +1357,15 @@ private static function receiveAccountMigration(array $importer, SimpleXMLElemen
}

$fields = [
'url' => $data['url'],
'nurl' => Strings::normaliseLink($data['url']),
'name' => $data['name'],
'nick' => $data['nick'],
'addr' => $data['addr'],
'batch' => $data['batch'],
'notify' => $data['notify'],
'poll' => $data['poll'],
'network' => $data['network']
'url' => $data['url'],
'nurl' => Strings::normaliseLink($data['url']),
'name' => $data['name'],
'nick' => $data['nick'],
'addr' => $data['addr'],
'batch' => $data['batch'],
'notify' => $data['notify'],
'poll' => $data['poll'],
'network' => $data['network'],
];

Contact::update($fields, ['addr' => $old_handle]);
Expand Down

0 comments on commit bd604ac

Please sign in to comment.