Skip to content

Commit

Permalink
fix: phpstan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Nov 12, 2023
1 parent c407726 commit 8b741e4
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
4 changes: 4 additions & 0 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Flarum\Extend;
use Flarum\User\Event\Registered;
use Flarum\User\Event\Saving as UserSaving;
use Flarum\User\User;
use FoF\Doorman\Api\Controllers;
use FoF\Doorman\Api\Serializers\DoorkeySerializer;
use FoF\Doorman\Validators\DoorkeyLoginValidator;
Expand All @@ -31,6 +32,9 @@
->js(__DIR__.'/js/dist/admin.js')
->css(__DIR__.'/resources/less/admin.less'),

(new Extend\Model(User::class))
->cast('invite_code', 'string'),

(new Extend\Routes('api'))
->post('/fof/doorkeys', 'fof.doorkey.create', Controllers\CreateDoorkeyController::class)
->post('/fof/doorkeys/invites', 'fof.doorkey.invite', Controllers\SendInvitesController::class)
Expand Down
3 changes: 0 additions & 3 deletions src/Api/Controllers/ListDoorkeysController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@

class ListDoorkeysController extends AbstractListController
{
/**
* @var DoorkeySerializer
*/
public $serializer = DoorkeySerializer::class;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/EditDoorkeyHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public function __construct(DoorkeyValidator $validator)
}

/**
* @param EditRank $command
* @param EditDoorkey $command
*
* @throws PermissionDeniedException
*
* @return Rank
* @return Doorkey
*/
public function handle(EditDoorkey $command)
{
Expand Down
7 changes: 7 additions & 0 deletions src/Doorkey.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
use Flarum\Database\AbstractModel;
use Flarum\Group\Group;

/**
* @property string $key
* @property int $group_id
* @property int $max_uses
* @property int $activates
* @property int $uses
*/
class Doorkey extends AbstractModel
{
/**
Expand Down
8 changes: 8 additions & 0 deletions src/Listeners/PostRegisterOperations.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@

class PostRegisterOperations
{
/**
* @var SettingsRepositoryInterface
*/
protected $settings;

/**
* @var Dispatcher
*/
protected $events;

public function __construct(SettingsRepositoryInterface $settings, Dispatcher $events)
{
$this->settings = $settings;
Expand Down

0 comments on commit 8b741e4

Please sign in to comment.