Skip to content
This repository has been archived by the owner on Jul 4, 2019. It is now read-only.

Commit

Permalink
Apply fixes from StyleCI (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie committed May 18, 2018
1 parent 9a4486c commit 8bb8b83
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Api/Controllers/CreateAnswerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function data(ServerRequestInterface $request, Document $document)

return $answer;
} else {
throw new PermissionDeniedException;
throw new PermissionDeniedException();
}
}
}
4 changes: 2 additions & 2 deletions src/Api/Controllers/CreateVoteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function data(ServerRequestInterface $request, Document $document)
$this->assertNotFlooding($actor);

if (Question::find($attributes['poll_id'])->isEnded()) {
throw new PermissionDeniedException;
throw new PermissionDeniedException();
}

$this->assertCan($actor, 'votePolls');
Expand All @@ -73,7 +73,7 @@ protected function data(ServerRequestInterface $request, Document $document)
public function assertNotFlooding($actor)
{
if (new DateTime($actor->last_vote_time) >= new DateTime('-10 seconds')) {
throw new FloodingException;
throw new FloodingException();
}
}
}
6 changes: 3 additions & 3 deletions src/Api/Controllers/DeleteAnswerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

use Flarum\Api\Controller\AbstractDeleteController;
use Flarum\Core\Exception\PermissionDeniedException;
use Reflar\Polls\Answer;
use Reflar\Polls\Question;
use Psr\Http\Message\ServerRequestInterface;
use Reflar\Polls\Answer;
use Reflar\Polls\Api\Serializers\AnswerSerializer;
use Reflar\Polls\Question;
use Reflar\Polls\Repositories\AnswerRepository;

class DeleteAnswerController extends AbstractDeleteController
Expand Down Expand Up @@ -55,7 +55,7 @@ protected function delete(ServerRequestInterface $request)
if ($actor->can('edit.polls') || ($actor->id == Question::find($answer->poll_id)->user_id && $actor->can('selfEditPolls'))) {
$this->fields->deleteAnswer($answer->id);
} else {
throw new PermissionDeniedException;
throw new PermissionDeniedException();
}
}
}
2 changes: 1 addition & 1 deletion src/Api/Controllers/DeletePollController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function delete(ServerRequestInterface $request)
if ($actor->can('edit.polls') || ($actor->id == Question::find($pollId)->user_id && $actor->can('selfEditPolls'))) {
return $this->fields->deletePoll($pollId);
} else {
throw new PermissionDeniedException;
throw new PermissionDeniedException();
}
}
}
2 changes: 1 addition & 1 deletion src/Api/Controllers/UpdateAnswerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected function data(ServerRequestInterface $request, Document $document)

return $answer;
} else {
throw new PermissionDeniedException;
throw new PermissionDeniedException();
}
}
}
2 changes: 1 addition & 1 deletion src/Api/Controllers/UpdateEndDateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected function data(ServerRequestInterface $request, Document $document)
$poll->end_date = $endDate;
$poll->save();
} else {
throw new PermissionDeniedException;
throw new PermissionDeniedException();
}
}
}
2 changes: 1 addition & 1 deletion src/Api/Controllers/UpdatePollController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected function data(ServerRequestInterface $request, Document $document)

return $poll;
} else {
throw new PermissionDeniedException;
throw new PermissionDeniedException();
}
}
}
2 changes: 1 addition & 1 deletion src/Api/Controllers/UpdateVoteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected function data(ServerRequestInterface $request, Document $document)
public function assertNotFlooding($actor)
{
if (new DateTime($actor->last_vote_time) >= new DateTime('-10 seconds')) {
throw new FloodingException;
throw new FloodingException();
}
}
}

0 comments on commit 8bb8b83

Please sign in to comment.