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 6eb3e0b commit ba6b560
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Commands/CreatePoll.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CreatePoll
/**
* @var callable
*/
public $savePollOns;
public $savePollOn;

/**
* @param User $actor
Expand Down
5 changes: 1 addition & 4 deletions src/Commands/MultipleVotesPollHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ function ($attribute, $value, $fail) use ($options) {
return !$myVotes->contains('option_id', $optionId);
});

/** @phpstan-ignore-next-line */
$this->db->transaction(function () use ($myVotes, $options, $newOptionIds, $deletedVotes, $poll, $actor) {
// Unvote options
if ($deletedVotes->isNotEmpty()) {
Expand Down Expand Up @@ -185,8 +186,6 @@ function ($attribute, $value, $fail) use ($options) {
* Pushes an updated option through websocket.
*
* @param \Illuminate\Support\Collection $options
*
* @throws \Pusher\PusherException
*/
public function pushUpdatedOptions(Poll $poll, $options)
{
Expand All @@ -205,8 +204,6 @@ private function getPusher()
}

/**
* @throws \Pusher\PusherException
*
* @return bool|\Illuminate\Foundation\Application|mixed|Pusher
*/
public static function pusher(Container $container, SettingsRepositoryInterface $settings)
Expand Down
13 changes: 4 additions & 9 deletions src/Poll.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* @property User $user
* @property int $post_id
* @property int $user_id
* @property \Carbon\Carbon $end_date
* @property \Carbon\Carbon|null $end_date
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
* @property PollSettings $settings
Expand All @@ -49,17 +49,12 @@ class Poll extends AbstractModel
* {@inheritdoc}
*/
public $timestamps = true;
/**
* @var bool|mixed
*/
protected $dates = [
'created_at',
'updated_at',
'end_date',
];

protected $casts = [
'settings' => AsArrayObject::class,
'created_at' => 'datetime',
'updated_at' => 'datetime',
'end_date' => 'datetime',
];

/**
Expand Down

0 comments on commit ba6b560

Please sign in to comment.