Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Feb 15, 2024
1 parent f2e6f32 commit ce20ae8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 36 deletions.
31 changes: 15 additions & 16 deletions migrations/2024_02_15_000000_modify_polls_add_subtitle.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@
* file that was distributed with this source code.
*/

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;

return [
'up' => function (Builder $schema) {
$schema->table('polls', function (Blueprint $table) {
$table->text('subtitle')->nullable()->after('question');
});
},
'down' => function (Builder $schema) {
$schema->table('polls', function (Blueprint $table) {
$table->dropColumn('subtitle');
});
},
];

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;

return [
'up' => function (Builder $schema) {
$schema->table('polls', function (Blueprint $table) {
$table->text('subtitle')->nullable()->after('question');
});
},
'down' => function (Builder $schema) {
$schema->table('polls', function (Blueprint $table) {
$table->dropColumn('subtitle');
});
},
];
6 changes: 3 additions & 3 deletions src/Poll.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
use Illuminate\Support\Arr;

/**
* @property int $id
* @property string $question
* @property string|null $subtitle
* @property int $id
* @property string $question
* @property string|null $subtitle
* @property-read bool $public_poll
* @property-read bool $allow_multiple_votes
* @property-read int $max_votes
Expand Down
34 changes: 17 additions & 17 deletions tests/integration/api/CreatePollTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,15 +496,15 @@ public function authorized_user_can_create_a_poll_with_a_subtitle_via_api(int $u
'json' => [
'data' => [
'attributes' => [
'question' => 'Add a poll with a subtitle',
'subtitle' => 'This is a subtitle',
'publicPoll' => false,
'hideVotes' => false,
'allowChangeVote' => true,
'question' => 'Add a poll with a subtitle',
'subtitle' => 'This is a subtitle',
'publicPoll' => false,
'hideVotes' => false,
'allowChangeVote' => true,
'allowMultipleVotes' => false,
'maxVotes' => 0,
'endDate' => false,
'options' => [
'maxVotes' => 0,
'endDate' => false,
'options' => [
[
'answer' => 'Yes',
],
Expand Down Expand Up @@ -548,15 +548,15 @@ public function authorized_user_can_create_a_poll_with_a_subtitle_via_post(int $
'attributes' => [
'content' => 'Here is my poll',
'poll' => [
'question' => 'What is your favourite colour?',
'subtitle' => 'This is a subtitle',
'publicPoll' => false,
'hideVotes' => false,
'allowChangeVote' => true,
'question' => 'What is your favourite colour?',
'subtitle' => 'This is a subtitle',
'publicPoll' => false,
'hideVotes' => false,
'allowChangeVote' => true,
'allowMultipleVotes' => false,
'maxVotes' => 0,
'endDate' => false,
'options' => [
'maxVotes' => 0,
'endDate' => false,
'options' => [
[
'answer' => 'Red',
],
Expand All @@ -573,7 +573,7 @@ public function authorized_user_can_create_a_poll_with_a_subtitle_via_post(int $
'discussion' => [
'data' => [
'type' => 'discussions',
'id' => 1,
'id' => 1,
],
],
],
Expand Down

0 comments on commit ce20ae8

Please sign in to comment.