Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
shriker authored and StyleCIBot committed Aug 28, 2019
1 parent 5b51c18 commit e5d066e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js'),

new Extend\Locales(__DIR__ . '/resources/locale'),
new Extend\Locales(__DIR__.'/resources/locale'),

function (Dispatcher $events) {
$events->subscribe(Listeners\AddPronouns::class);
Expand Down
9 changes: 5 additions & 4 deletions src/Listeners/AddPronouns.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

namespace Shriker\Pronouns\Listeners;

use Illuminate\Contracts\Events\Dispatcher;
use Flarum\Api\Event\Serializing;
use Flarum\Api\Serializer\ForumSerializer;
use Flarum\Api\Serializer\UserSerializer;
use Flarum\Settings\SettingsRepositoryInterface;
use Illuminate\Contracts\Events\Dispatcher;

class AddPronouns
{
Expand All @@ -26,11 +26,13 @@ public function __construct(SettingsRepositoryInterface $settings)
$this->settings = $settings;
}

public function subscribe(Dispatcher $events) {
public function subscribe(Dispatcher $events)
{
$events->listen(Serializing::class, [$this, 'prepareApiAttributes']);
}

public function prepareApiAttributes(Serializing $event) {
public function prepareApiAttributes(Serializing $event)
{

// Make pronouns available via User
if ($event->isSerializer(UserSerializer::class)) {
Expand All @@ -42,5 +44,4 @@ public function prepareApiAttributes(Serializing $event) {
$event->attributes['pronounsPrefix'] = $this->settings->get('shriker-pronouns.pronouns_prefix');
}
}

}
3 changes: 1 addition & 2 deletions src/Listeners/SavePronouns.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

namespace Shriker\Pronouns\Listeners;

use Shriker\Pronouns\PronounsValidator;
use Flarum\User\Event\Saving;
use Illuminate\Contracts\Events\Dispatcher;
use Shriker\Pronouns\PronounsValidator;

class SavePronouns
{
Expand All @@ -32,7 +32,6 @@ public function handle(Saving $event)
$attributes = array_get($event->data, 'attributes', []);

if (array_key_exists('pronouns', $attributes)) {

$this->validator->assertValid($attributes);

$user = $event->user;
Expand Down

0 comments on commit e5d066e

Please sign in to comment.