diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml new file mode 100644 index 0000000..2144827 --- /dev/null +++ b/.github/workflows/php-cs-fixer.yml @@ -0,0 +1,7 @@ +name: PHP CS Fixer + +on: push + +jobs: + tests: + uses: humhub/actions/.github/workflows/module-php-cs-fixer.yml@main diff --git a/Events.php b/Events.php index 610f93f..453d5de 100644 --- a/Events.php +++ b/Events.php @@ -35,13 +35,13 @@ public static function onWallEntryControlsInit($event) if($object->content->canEdit()) { $event->sender->addWidget(CloseButton::class, [ - 'poll' => $object + 'poll' => $object, ]); } if($object->isResetAllowed()) { $event->sender->addWidget(ResetButton::class, [ - 'poll' => $object + 'poll' => $object, ]); } } @@ -121,7 +121,7 @@ public static function onSampleDataInstall($event) $poll->newAnswers = [ Yii::t('PollsModule.events', "To Daniel"), Yii::t('PollsModule.events', "Club A Steakhouse"), - Yii::t('PollsModule.events', "Pisillo Italian Panini") + Yii::t('PollsModule.events', "Pisillo Italian Panini"), ]; $poll->content->container = $space; $poll->allow_multiple = Yii::$app->request->post('allowMultiple', 0); diff --git a/Module.php b/Module.php index cb5b747..ce2b818 100644 --- a/Module.php +++ b/Module.php @@ -21,7 +21,6 @@ */ class Module extends ContentContainerModule { - /** * @inheritdoc */ @@ -42,7 +41,7 @@ public function getContentContainerTypes() { return [ Space::class, - User::class + User::class, ]; } @@ -77,7 +76,7 @@ public function getPermissions($contentContainer = null) { if ($contentContainer) { return [ - new permissions\CreatePoll() + new permissions\CreatePoll(), ]; } diff --git a/activities/NewVote.php b/activities/NewVote.php index 5d81760..ff11bf5 100644 --- a/activities/NewVote.php +++ b/activities/NewVote.php @@ -14,12 +14,11 @@ class NewVote extends BaseActivity implements ConfigurableActivityInterface { - /** * @inheritdoc */ public $moduleId = 'polls'; - + /** * @inheritdoc */ diff --git a/assets/PollsAsset.php b/assets/PollsAsset.php index faee0f5..b2395d1 100644 --- a/assets/PollsAsset.php +++ b/assets/PollsAsset.php @@ -14,12 +14,11 @@ class PollsAsset extends AssetBundle { - public $jsOptions = ['position' => \yii\web\View::POS_END]; public $sourcePath = '@polls/resources'; public $css = []; public $js = [ - 'js/humhub.polls.js' + 'js/humhub.polls.js', ]; /** @@ -30,8 +29,8 @@ public static function register($view) { $view->registerJsConfig('polls', [ 'text' => [ - 'warn.answer_required' => Yii::t('PollsModule.base', 'At least one answer is required') - ] + 'warn.answer_required' => Yii::t('PollsModule.base', 'At least one answer is required'), + ], ]); return parent::register($view); } diff --git a/config.php b/config.php index aaa2430..3a6b02f 100644 --- a/config.php +++ b/config.php @@ -15,5 +15,5 @@ ['class' => IntegrityController::class, 'event' => IntegrityController::EVENT_ON_RUN, 'callback' => ['humhub\modules\polls\Events', 'onIntegrityCheck']], ['class' => 'humhub\modules\installer\controllers\ConfigController', 'event' => 'install_sample_data', 'callback' => ['humhub\modules\polls\Events', 'onSampleDataInstall']], ['class' => 'humhub\modules\rest\Module', 'event' => 'restApiAddRules', 'callback' => ['humhub\modules\polls\Events', 'onRestApiAddRules']], - ] + ], ]; diff --git a/controllers/PollController.php b/controllers/PollController.php index ea8a770..01eb3e8 100644 --- a/controllers/PollController.php +++ b/controllers/PollController.php @@ -24,7 +24,6 @@ */ class PollController extends ContentContainerController { - public function actionCreateForm() { if (!(new Poll($this->contentContainer))->content->canEdit()) { @@ -47,7 +46,7 @@ public function actionCreate() if (!$this->contentContainer->permissionManager->can(new CreatePoll())) { throw new HttpException(400, 'Access denied!'); } - + $poll = new Poll(['scenario' => Poll::SCENARIO_CREATE]); $poll->load(Yii::$app->request->post()); return WallCreateForm::create($poll, $this->contentContainer); @@ -108,12 +107,12 @@ public function actionEdit() public function actionOpen() { - return $this->asJson($this->setClosed(Yii::$app->request->get('id'), false)); + return $this->asJson($this->setClosed(Yii::$app->request->get('id'), false)); } public function actionClose() { - return $this->asJson($this->setClosed(Yii::$app->request->get('id'), true)); + return $this->asJson($this->setClosed(Yii::$app->request->get('id'), true)); } public function setClosed($id, $closed) @@ -131,7 +130,7 @@ public function setClosed($id, $closed) $model->save(); // Refresh updated_at $model->content->refresh(); - + return Stream::getContentResultEntry($model->content); } diff --git a/controllers/rest/PollsController.php b/controllers/rest/PollsController.php index 51bf044..b89701a 100644 --- a/controllers/rest/PollsController.php +++ b/controllers/rest/PollsController.php @@ -249,4 +249,4 @@ public function actionVotes(int $id): array ->andWhere(['poll_id' => $id]) ->column(); } -} \ No newline at end of file +} diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 1c06df2..99813b7 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,10 @@ Changelog ========= +1.3.6 (Unreleased) +---------------------- +- Enh #137: Use PHP CS Fixer + 1.3.5 (June 18, 2024) ---------------------- - Fix #129: Fix memory usage on integrity check diff --git a/helpers/RestDefinitions.php b/helpers/RestDefinitions.php index 0fd5e71..d7124db 100644 --- a/helpers/RestDefinitions.php +++ b/helpers/RestDefinitions.php @@ -64,4 +64,4 @@ public static function getAnswer(PollAnswer $pollAnswer): array 'updated_by' => UserDefinitions::getUserShort($pollAnswer->updatedBy), ]; } -} \ No newline at end of file +} diff --git a/migrations/m131023_165921_initial.php b/migrations/m131023_165921_initial.php index 80346a8..f2dc9a7 100644 --- a/migrations/m131023_165921_initial.php +++ b/migrations/m131023_165921_initial.php @@ -4,7 +4,6 @@ class m131023_165921_initial extends Migration { - public function up() { @@ -16,7 +15,7 @@ public function up() 'created_by' => 'int(11) NOT NULL', 'updated_at' => 'datetime NOT NULL', 'updated_by' => 'int(11) NOT NULL', - ), ''); + ), ''); $this->createTable('poll_answer', array( 'id' => 'pk', @@ -26,7 +25,7 @@ public function up() 'created_by' => 'int(11) NOT NULL', 'updated_at' => 'datetime NOT NULL', 'updated_by' => 'int(11) NOT NULL', - ), ''); + ), ''); $this->createTable('poll_answer_user', array( 'id' => 'pk', @@ -36,7 +35,7 @@ public function up() 'created_by' => 'int(11) NOT NULL', 'updated_at' => 'datetime NOT NULL', 'updated_by' => 'int(11) NOT NULL', - ), ''); + ), ''); } public function down() diff --git a/migrations/m131030_122743_longer_questions.php b/migrations/m131030_122743_longer_questions.php index 7b01877..19e5dd1 100644 --- a/migrations/m131030_122743_longer_questions.php +++ b/migrations/m131030_122743_longer_questions.php @@ -4,7 +4,6 @@ class m131030_122743_longer_questions extends Migration { - public function up() { $this->alterColumn('poll', 'question', 'TEXT NOT NULL'); diff --git a/migrations/m141002_093710_fix_default.php b/migrations/m141002_093710_fix_default.php index 741ec2c..cc988e5 100644 --- a/migrations/m141002_093710_fix_default.php +++ b/migrations/m141002_093710_fix_default.php @@ -4,7 +4,6 @@ class m141002_093710_fix_default extends Migration { - public function up() { $this->alterColumn('poll', 'allow_multiple', "smallint(6) NOT NULL DEFAULT 0"); diff --git a/migrations/m150709_151858_namespace.php b/migrations/m150709_151858_namespace.php index 09c6b7f..58d0d3c 100644 --- a/migrations/m150709_151858_namespace.php +++ b/migrations/m150709_151858_namespace.php @@ -5,7 +5,6 @@ class m150709_151858_namespace extends Migration { - public function up() { $this->renameClass('Poll', humhub\modules\polls\models\Poll::className()); diff --git a/migrations/m160218_132531_close_and_anonymous_poll.php b/migrations/m160218_132531_close_and_anonymous_poll.php index b87ae47..99031a6 100644 --- a/migrations/m160218_132531_close_and_anonymous_poll.php +++ b/migrations/m160218_132531_close_and_anonymous_poll.php @@ -7,9 +7,9 @@ class m160218_132531_close_and_anonymous_poll extends Migration { public function up() { - $this->addColumn('poll', 'is_random', Schema::TYPE_BOOLEAN. ' DEFAULT 0'); - $this->addColumn('poll', 'closed', Schema::TYPE_BOOLEAN. ' DEFAULT 0'); - $this->addColumn('poll', 'anonymous', Schema::TYPE_BOOLEAN. ' DEFAULT 0'); + $this->addColumn('poll', 'is_random', Schema::TYPE_BOOLEAN . ' DEFAULT 0'); + $this->addColumn('poll', 'closed', Schema::TYPE_BOOLEAN . ' DEFAULT 0'); + $this->addColumn('poll', 'anonymous', Schema::TYPE_BOOLEAN . ' DEFAULT 0'); } public function down() diff --git a/migrations/m180327_125017_show_result_after_close.php b/migrations/m180327_125017_show_result_after_close.php index b000b70..8daf95e 100644 --- a/migrations/m180327_125017_show_result_after_close.php +++ b/migrations/m180327_125017_show_result_after_close.php @@ -13,7 +13,7 @@ class m180327_125017_show_result_after_close extends Migration { public function safeUp() { - $this->addColumn('poll', 'show_result_after_close', Schema::TYPE_BOOLEAN. ' DEFAULT 0'); + $this->addColumn('poll', 'show_result_after_close', Schema::TYPE_BOOLEAN . ' DEFAULT 0'); } public function safeDown() diff --git a/migrations/m201020_125649_question_description.php b/migrations/m201020_125649_question_description.php index a0e6532..13c8f1e 100644 --- a/migrations/m201020_125649_question_description.php +++ b/migrations/m201020_125649_question_description.php @@ -23,6 +23,6 @@ public function safeUp() public function safeDown() { $this->dropColumn('poll', 'question'); - $this->renameColumn('poll', 'description','question'); + $this->renameColumn('poll', 'description', 'question'); } } diff --git a/migrations/uninstall.php b/migrations/uninstall.php index e9491fc..6394ae1 100644 --- a/migrations/uninstall.php +++ b/migrations/uninstall.php @@ -4,7 +4,6 @@ class uninstall extends Migration { - public function up() { diff --git a/models/Poll.php b/models/Poll.php index 30a8ab6..6c6acaa 100644 --- a/models/Poll.php +++ b/models/Poll.php @@ -13,18 +13,18 @@ * * The followings are the available columns in table 'poll': * - * @property integer $id + * @property int $id * @property string $question * @property string $description - * @property integer $allow_multiple + * @property int $allow_multiple * @property string $created_at - * @property integer $created_by + * @property int $created_by * @property string $updated_at - * @property integer $updated_by - * @property integer $is_random - * @property integer $closed - * @property integer $anonymous - * @property integer show_result_after_close + * @property int $updated_by + * @property int $is_random + * @property int $closed + * @property int $anonymous + * @property int show_result_after_close * * @property-read PollAnswer[] $answers * @@ -34,11 +34,10 @@ */ class Poll extends ContentActiveRecord implements Searchable { - - const MIN_REQUIRED_ANSWERS = 2; - const SCENARIO_CREATE = 'create'; - const SCENARIO_EDIT = 'edit'; - const SCENARIO_CLOSE = 'close'; + public const MIN_REQUIRED_ANSWERS = 2; + public const SCENARIO_CREATE = 'create'; + public const SCENARIO_EDIT = 'edit'; + public const SCENARIO_CLOSE = 'close'; public $newAnswers; public $editAnswers; @@ -62,13 +61,13 @@ public static function tableName() { return 'poll'; } - + public function scenarios() { return [ self::SCENARIO_CLOSE => [], self::SCENARIO_CREATE => ['question', 'description', 'anonymous', 'is_random', 'show_result_after_close', 'newAnswers', 'allow_multiple'], - self::SCENARIO_EDIT => ['question', 'description', 'anonymous', 'is_random', 'show_result_after_close','newAnswers', 'editAnswers', 'allow_multiple'] + self::SCENARIO_EDIT => ['question', 'description', 'anonymous', 'is_random', 'show_result_after_close','newAnswers', 'editAnswers', 'allow_multiple'], ]; } @@ -87,17 +86,17 @@ public function rules() //we use the question attribute since its always required, otherwise it would not be called for editAnswers if editAnswers is empty... [['question'], 'minTwoAnswers', 'on' => self::SCENARIO_EDIT], [['allow_multiple'], 'integer'], - + ); } - + public function minTwoNewAnswers($attribute) { if(count($this->newAnswers) < self::MIN_REQUIRED_ANSWERS) { $this->addError($attribute, Yii::t('PollsModule.models_Poll', "Please specify at least {min} answers!", ["{min}" => self::MIN_REQUIRED_ANSWERS])); } } - + public function minTwoAnswers($attribute) { $count = count($this->newAnswers) + count($this->editAnswers); @@ -119,7 +118,7 @@ public function attributeLabels() 'allow_multiple' => Yii::t('PollsModule.models_Poll', 'Multiple answers per user'), 'is_random' => Yii::t('PollsModule.widgets_views_pollForm', 'Display answers in random order?'), 'anonymous' => Yii::t('PollsModule.widgets_views_pollForm', 'Anonymous Votes?'), - 'show_result_after_close' => Yii::t('PollsModule.widgets_views_pollForm', 'Hide results until poll is closed?') + 'show_result_after_close' => Yii::t('PollsModule.widgets_views_pollForm', 'Hide results until poll is closed?'), ); } @@ -127,7 +126,7 @@ public function getIcon() { return 'fa-bar-chart'; } - + public function isResetAllowed() { return $this->hasUserVoted() && !$this->closed; @@ -143,7 +142,8 @@ public function isShowResult() */ public function getAnswers() { - return $this->hasMany(PollAnswer::class, ['poll_id' => 'id']);; + return $this->hasMany(PollAnswer::class, ['poll_id' => 'id']); + ; } public function getViewAnswers() @@ -220,7 +220,7 @@ public function updateAnswers() foreach ($this->answers as $answer) { if (!array_key_exists($answer->id, $answersToEdit)) { $answer->delete(); - } else if ($answer->answer !== $answersToEdit[$answer->id]) { + } elseif ($answer->answer !== $answersToEdit[$answer->id]) { $answer->answer = $this->editAnswers[$answer->id]; $answer->update(); } @@ -268,13 +268,15 @@ public function beforeDelete() public function hasUserVoted($userId = "") { - if ($userId == "") + if ($userId == "") { $userId = Yii::$app->user->id; + } $answer = PollAnswerUser::findOne(array('created_by' => $userId, 'poll_id' => $this->id)); - if ($answer == null) + if ($answer == null) { return false; + } return true; } @@ -322,9 +324,10 @@ public function resetAnswer($userId = "") if($this->closed) { return; } - - if ($userId == "") + + if ($userId == "") { $userId = Yii::$app->user->id; + } if ($this->hasUserVoted($userId)) { @@ -367,7 +370,7 @@ public function getSearchAttributes() return [ 'question' => $this->question, 'description' => $this->description, - 'itemAnswers' => trim($itemAnswers) + 'itemAnswers' => trim($itemAnswers), ]; } diff --git a/models/PollAnswer.php b/models/PollAnswer.php index a348c4c..3f0df01 100644 --- a/models/PollAnswer.php +++ b/models/PollAnswer.php @@ -8,13 +8,13 @@ * This is the model class for table "poll_answer". * * The followings are the available columns in table 'poll_answer': - * @property integer $id - * @property integer $poll_id + * @property int $id + * @property int $poll_id * @property string $answer * @property string $created_at - * @property integer $created_by + * @property int $created_by * @property string $updated_at - * @property integer $updated_by + * @property int $updated_by * * @property-read Poll $poll * @property-read PollAnswerUser[] $votes @@ -25,7 +25,6 @@ */ class PollAnswer extends ActiveRecord { - public $active = true; /** @@ -58,12 +57,13 @@ public function getVotes() $query = $this->hasMany(PollAnswerUser::className(), ['poll_answer_id' => 'id']); return $query; } - - public function beforeDelete() { + + public function beforeDelete() + { foreach ($this->votes as $answerUser) { $answerUser->delete(); } - + return parent::beforeDelete(); } @@ -75,8 +75,9 @@ public function beforeDelete() { public function getPercent() { $total = PollAnswerUser::find()->where(array('poll_id' => $this->poll_id))->count(); - if ($total == 0) + if ($total == 0) { return 0; + } return $this->getTotal() / $total * 100; } @@ -91,13 +92,13 @@ public function getTotal() return PollAnswerUser::find()->where(array('poll_answer_id' => $this->id))->count(); } - - public static function filterValidAnswers($answerArr) + + public static function filterValidAnswers($answerArr) { if (empty($answerArr)) { return []; } - + $result = []; foreach ($answerArr as $key => $answerText) { if($answerText != null && $answerText !== '') { diff --git a/models/PollAnswerUser.php b/models/PollAnswerUser.php index 9cacfd3..60850c8 100644 --- a/models/PollAnswerUser.php +++ b/models/PollAnswerUser.php @@ -9,13 +9,13 @@ * This is the model class for table "poll_answer_user". * * The followings are the available columns in table 'poll_answer_user': - * @property integer $id - * @property integer $question_id - * @property integer $question_answer_id + * @property int $id + * @property int $question_id + * @property int $question_answer_id * @property string $created_at - * @property integer $created_by + * @property int $created_by * @property string $updated_at - * @property integer $updated_by + * @property int $updated_by * * @property-read Poll $poll * @property-read User $user @@ -26,7 +26,6 @@ */ class PollAnswerUser extends ActiveRecord { - /** * @return string the associated database table name */ diff --git a/module.json b/module.json index 953cef1..42fe2bb 100644 --- a/module.json +++ b/module.json @@ -3,7 +3,7 @@ "name": "Polls", "description": "Easily create polls, streamline decision-making, and harness the power of voting.", "keywords": ["poll", "voting", "decision making"], - "version": "1.3.5", + "version": "1.3.6", "humhub": { "minVersion": "1.14" }, diff --git a/permissions/CreatePoll.php b/permissions/CreatePoll.php index 0ac5fe6..f983a8c 100644 --- a/permissions/CreatePoll.php +++ b/permissions/CreatePoll.php @@ -18,7 +18,6 @@ */ class CreatePoll extends BasePermission { - /** * @inheritdoc */ @@ -27,9 +26,9 @@ class CreatePoll extends BasePermission Space::USERGROUP_ADMIN, Space::USERGROUP_MODERATOR, Space::USERGROUP_MEMBER, - User::USERGROUP_SELF + User::USERGROUP_SELF, ]; - + /** * @inheritdoc */ @@ -39,7 +38,7 @@ class CreatePoll extends BasePermission Space::USERGROUP_USER, Space::USERGROUP_GUEST, User::USERGROUP_SELF, - User::USERGROUP_GUEST + User::USERGROUP_GUEST, ]; /** diff --git a/tests/codeception/_support/AcceptanceTester.php b/tests/codeception/_support/AcceptanceTester.php index 8918bf5..18b1a69 100644 --- a/tests/codeception/_support/AcceptanceTester.php +++ b/tests/codeception/_support/AcceptanceTester.php @@ -1,4 +1,5 @@ amAdmin(); @@ -26,7 +25,7 @@ public function testCreatePoll(AcceptanceTester $I) $I->waitForElementVisible('.contentForm_options'); $I->fillField('#poll-question', 'My Poll Question'); - $I->click(Locator::elementAt('.addPollAnswerButton',1)); //Ass answers + $I->click(Locator::elementAt('.addPollAnswerButton', 1)); //Ass answers $I->fillField(Locator::elementAt('.poll_answer_new_input', 1), 'Answer 1'); $I->fillField(Locator::elementAt('.poll_answer_new_input', 2), 'Answer 2'); $I->fillField(Locator::elementAt('.poll_answer_new_input', 3), 'Answer 3'); @@ -48,7 +47,7 @@ public function testCreatePoll(AcceptanceTester $I) $I->seeSuccess('Saved'); $I->see('1 vote', '.wall-entry'); $I->click('1 vote', '.wall-entry'); - $I->waitForText('Users voted for: Answer 1', null,'#globalModal'); + $I->waitForText('Users voted for: Answer 1', null, '#globalModal'); } -} \ No newline at end of file +} diff --git a/tests/codeception/acceptance/_bootstrap.php b/tests/codeception/acceptance/_bootstrap.php index 0f508ca..9e54876 100644 --- a/tests/codeception/acceptance/_bootstrap.php +++ b/tests/codeception/acceptance/_bootstrap.php @@ -3,4 +3,4 @@ * Initialize the HumHub Application for functional testing. The default application configuration for this suite can be overwritten * in @tests/config/functional.php */ -require(Yii::getAlias('@humhubTests/codeception/acceptance/_bootstrap.php')); \ No newline at end of file +require(Yii::getAlias('@humhubTests/codeception/acceptance/_bootstrap.php')); diff --git a/tests/codeception/api/ListCest.php b/tests/codeception/api/ListCest.php index e125dc1..cbca927 100644 --- a/tests/codeception/api/ListCest.php +++ b/tests/codeception/api/ListCest.php @@ -76,4 +76,4 @@ public function testDeleteByContainer(ApiTester $I) $I->seePaginationPollsResponse('polls/container/4', []); } -} \ No newline at end of file +} diff --git a/tests/codeception/api/PollCest.php b/tests/codeception/api/PollCest.php index c5471bc..324aa30 100644 --- a/tests/codeception/api/PollCest.php +++ b/tests/codeception/api/PollCest.php @@ -8,7 +8,6 @@ class PollCest extends HumHubApiTestCest { - public function testCreatePoll(ApiTester $I) { if (!$this->isRestModuleEnabled()) { @@ -106,4 +105,4 @@ public function testCloseOpenPoll(ApiTester $I) $I->sendPatch('polls/poll/1/open'); $I->seeSuccessMessage('Poll is already opened.'); } -} \ No newline at end of file +} diff --git a/tests/codeception/api/VoteCest.php b/tests/codeception/api/VoteCest.php index d355b6a..e7f091f 100644 --- a/tests/codeception/api/VoteCest.php +++ b/tests/codeception/api/VoteCest.php @@ -8,7 +8,6 @@ class VoteCest extends HumHubApiTestCest { - public function testVotePoll(ApiTester $I) { if (!$this->isRestModuleEnabled()) { @@ -51,9 +50,11 @@ public function testGetVotes(ApiTester $I) $I->wantTo('get votes on a poll for current user'); $I->amAdmin(); - $I->createPoll('Sample poll question?', 'Sample poll description', + $I->createPoll( + 'Sample poll question?', + 'Sample poll description', ['Answer 1', 'Answer 2', 'Answer 3'], - ['allow_multiple' => 1] + ['allow_multiple' => 1], ); $I->sendPut('polls/vote/1', ['answers' => [2,3]]); @@ -63,4 +64,4 @@ public function testGetVotes(ApiTester $I) $I->seeCodeResponseContainsJson(HttpCode::OK, ['2','3']); } -} \ No newline at end of file +} diff --git a/tests/codeception/api/_bootstrap.php b/tests/codeception/api/_bootstrap.php index 6271ff3..c623584 100644 --- a/tests/codeception/api/_bootstrap.php +++ b/tests/codeception/api/_bootstrap.php @@ -3,4 +3,4 @@ * Initialize the HumHub Application for API testing. The default application configuration for this suite can be overwritten * in @tests/config/api.php */ -require(Yii::getAlias('@humhubTests/codeception/acceptance/_bootstrap.php')); \ No newline at end of file +require(Yii::getAlias('@humhubTests/codeception/acceptance/_bootstrap.php')); diff --git a/tests/codeception/config/api.php b/tests/codeception/config/api.php index 75ef4f1..4594fa6 100644 --- a/tests/codeception/config/api.php +++ b/tests/codeception/config/api.php @@ -1,3 +1,3 @@ ['polls'], 'fixtures' => [ 'default', - 'polls' => \tests\codeception\fixtures\PollFixture::class - ] + 'polls' => \tests\codeception\fixtures\PollFixture::class, + ], ]; - - - diff --git a/widgets/AddAnswerInput.php b/widgets/AddAnswerInput.php index ecd13c6..0e9ef13 100644 --- a/widgets/AddAnswerInput.php +++ b/widgets/AddAnswerInput.php @@ -15,15 +15,12 @@ */ class AddAnswerInput extends Widget { - public $name; public $showTitle; - + public function run() { return $this->render('addAnswersInput', ['name' => $this->name, 'showTitle' => $this->showTitle]); } } - -?> \ No newline at end of file diff --git a/widgets/CloseButton.php b/widgets/CloseButton.php index d716853..a6f3000 100644 --- a/widgets/CloseButton.php +++ b/widgets/CloseButton.php @@ -16,12 +16,10 @@ class CloseButton extends Widget { public $poll; - + public function run() { return $this->render('closeButton', ['poll' => $this->poll]); } } - -?> \ No newline at end of file diff --git a/widgets/ResetButton.php b/widgets/ResetButton.php index e3129f1..f8d7a3d 100644 --- a/widgets/ResetButton.php +++ b/widgets/ResetButton.php @@ -16,12 +16,10 @@ class ResetButton extends Widget { public $poll; - + public function run() { return $this->render('resetButton', ['poll' => $this->poll]); } } - -?> \ No newline at end of file diff --git a/widgets/WallCreateForm.php b/widgets/WallCreateForm.php index 46c9fe0..850897e 100644 --- a/widgets/WallCreateForm.php +++ b/widgets/WallCreateForm.php @@ -10,7 +10,6 @@ class WallCreateForm extends WallCreateContentForm { - /** * @inheritdoc */ @@ -50,4 +49,4 @@ public function run() return parent::run(); } -} \ No newline at end of file +}