Cleanup Code

This commit is contained in:
Philipp 2021-06-09 00:09:32 +02:00
parent 263774eb46
commit d4387d45ee
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
18 changed files with 86 additions and 78 deletions

View file

@ -44,11 +44,11 @@ class Application extends BaseFactory
*
* @throws InternalServerErrorException
*/
public function createFromApplicationId(int $id)
public function createFromApplicationId(int $id): \Friendica\Object\Api\Mastodon\Application
{
$application = $this->dba->selectFirst('application', ['client_id', 'client_secret', 'id', 'name', 'redirect_uri', 'website'], ['id' => $id]);
if (!$this->dba->isResult($application)) {
return [];
throw new InternalServerErrorException(sprintf("ID '%s' not found", $id));
}
return new \Friendica\Object\Api\Mastodon\Application(