fixing & cleaning

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/352/head
Maxence Lange 2019-03-05 16:25:08 -01:00
rodzic f74702f440
commit 1bd6e3f44f
16 zmienionych plików z 11 dodań i 21 usunięć

Wyświetl plik

@ -365,7 +365,7 @@ class AP {
break;
case Announce::TYPE:
$service = $this->announceInterface;
$interface = $this->announceInterface;
break;
case Block::TYPE:

Wyświetl plik

@ -32,10 +32,6 @@ namespace OCA\Social\Command;
use Exception;
use OC\Core\Command\Base;
use OCA\Social\Model\ActivityPub\ACore;
use OCA\Social\Model\ActivityPub\Object\Announce;
use OCA\Social\Model\ActivityPub\Stream;
use OCA\Social\Model\Post;
use OCA\Social\Service\AccountService;
use OCA\Social\Service\ActivityService;
use OCA\Social\Service\ConfigService;
@ -45,7 +41,6 @@ use OCA\Social\Service\NoteService;
use OCA\Social\Service\PostService;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

Wyświetl plik

@ -290,6 +290,7 @@ class LocalController extends Controller {
/**
* @NoAdminRequired
* @NoCSRFRequired
*
* @param int $since
* @param int $limit

Wyświetl plik

@ -36,6 +36,7 @@ use Exception;
use OC\User\NoUserException;
use OCA\Social\AppInfo\Application;
use OCA\Social\Exceptions\AccountAlreadyExistsException;
use OCA\Social\Exceptions\ItemUnknownException;
use OCA\Social\Exceptions\SocialAppConfigException;
use OCA\Social\Exceptions\UrlCloudException;
use OCA\Social\Service\AccountService;
@ -130,6 +131,7 @@ class NavigationController extends Controller {
*
* @return TemplateResponse
* @throws UrlCloudException
* @throws ItemUnknownException
*/
public function navigate(string $path = ''): TemplateResponse {
$data = [

Wyświetl plik

@ -109,7 +109,7 @@ class OStatusController extends Controller {
$user = $this->userSession->getUser();
if ($user === null) {
return $this->fail('Failed to retrieve current user');
throw new Exception('Failed to retrieve current user');
}
return new TemplateResponse('social', 'ostatus', [

Wyświetl plik

@ -32,11 +32,7 @@ namespace OCA\Social\Db;
use daita\MySmallPhpTools\Traits\TArrayTools;
use DateTime;
use OCA\Social\Exceptions\FollowDoesNotExistException;
use OCA\Social\Exceptions\HashtagDoesNotExistException;
use OCA\Social\Model\ActivityPub\Activity\Follow;
use OCP\DB\QueryBuilder\IQueryBuilder;
/**

Wyświetl plik

@ -32,8 +32,6 @@ namespace OCA\Social\Db;
use daita\MySmallPhpTools\Traits\TArrayTools;
use OCA\Social\Exceptions\InvalidResourceException;
use OCA\Social\Model\ActivityPub\Activity\Follow;
use OCP\DB\QueryBuilder\IQueryBuilder;

Wyświetl plik

@ -73,7 +73,7 @@ class NotesRequest extends NotesRequestBuilder {
)
->setValue(
'attachments', $qb->createNamedParameter(
json_encode($note->getAttachments(), JSON_UNESCAPED_SLASHES)
json_encode($stream->getAttachments(), JSON_UNESCAPED_SLASHES)
)
);
}

Wyświetl plik

@ -31,7 +31,6 @@ namespace OCA\Social\Db;
use daita\MySmallPhpTools\Traits\TArrayTools;
use OCA\Social\Model\RequestQueue;
use OCA\Social\Model\StreamQueue;
use OCP\DB\QueryBuilder\IQueryBuilder;

Wyświetl plik

@ -39,7 +39,6 @@ use OCA\Social\Exceptions\InvalidOriginException;
use OCA\Social\Exceptions\ItemNotFoundException;
use OCA\Social\Interfaces\IActivityPubInterface;
use OCA\Social\Model\ActivityPub\ACore;
use OCA\Social\Model\ActivityPub\Activity\Delete;
use OCA\Social\Model\ActivityPub\Activity\Update;
use OCA\Social\Model\ActivityPub\Actor\Person;
use OCA\Social\Service\ActorService;

Wyświetl plik

@ -35,7 +35,6 @@ use OCA\Social\Db\CacheDocumentsRequest;
use OCA\Social\Exceptions\ItemNotFoundException;
use OCA\Social\Interfaces\IActivityPubInterface;
use OCA\Social\Model\ActivityPub\ACore;
use OCA\Social\Model\ActivityPub\Object\Document;
use OCA\Social\Service\MiscService;

Wyświetl plik

@ -32,6 +32,7 @@ namespace OCA\Social\Model\ActivityPub\Object;
use JsonSerializable;
use OCA\Social\Exceptions\InvalidOriginException;
use OCA\Social\Exceptions\UrlCloudException;
use OCA\Social\Model\ActivityPub\ACore;
@ -63,6 +64,7 @@ class Image extends Document implements JsonSerializable {
* @param array $data
*
* @throws UrlCloudException
* @throws InvalidOriginException
*/
public function import(array $data) {
parent::import($data);

Wyświetl plik

@ -30,7 +30,6 @@ declare(strict_types=1);
namespace OCA\Social\Model\ActivityPub\Object;
use DateTime;
use Exception;
use JsonSerializable;
use OCA\Social\AP;
@ -48,7 +47,7 @@ class Note extends Stream implements JsonSerializable {
/** @var array */
private $attachments = [];
/** @var array */
private $hashtags = [];

Wyświetl plik

@ -32,12 +32,10 @@ namespace OCA\Social\Model;
use daita\MySmallPhpTools\Traits\TArrayTools;
use JsonLdException;
use JsonSerializable;
use OCA\Social\Exceptions\LinkedDataSignatureMissingException;
use OCA\Social\Model\ActivityPub\ACore;
use OCA\Social\Service\SignatureService;
use stdClass;
/**

Wyświetl plik

@ -135,6 +135,7 @@ class CurlService {
* @throws RequestServerException
* @throws SocialAppConfigException
* @throws ItemUnknownException
* @throws RequestResultNotJsonException
*/
public function retrieveAccount(string $account): Person {
$result = $this->webfingerAccount($account);

Wyświetl plik

@ -181,6 +181,7 @@ class DocumentService {
* @throws CacheContentException
* @throws CacheDocumentDoesNotExistException
* @throws MalformedArrayException
* @throws RequestResultNotJsonException
*/
public function getFromCache(string $id, bool $public = false) {
$document = $this->cacheRemoteDocument($id, $public);