diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml new file mode 100644 index 0000000..2d37e13 --- /dev/null +++ b/.github/workflows/php-cs-fixer.yml @@ -0,0 +1,7 @@ +name: PHP CS Fixer + +on: push + +jobs: + fixers: + uses: humhub/actions/.github/workflows/module-php-cs-fixer.yml@main diff --git a/Events.php b/Events.php index 6890da7..57b6efc 100644 --- a/Events.php +++ b/Events.php @@ -50,7 +50,7 @@ public static function onAdminMenuInit($event): void 'icon' => 'info-circle', 'sortOrder' => 1000, 'isActive' => (Yii::$app->controller->module && Yii::$app->controller->module->id == 'example-basic' && Yii::$app->controller->id == 'admin'), - 'isVisible' => Yii::$app->user->can(ManageModules::class) + 'isVisible' => Yii::$app->user->can(ManageModules::class), ])); } } diff --git a/Module.php b/Module.php index 5995a41..3bbce98 100644 --- a/Module.php +++ b/Module.php @@ -9,8 +9,8 @@ class Module extends \humhub\components\Module /** * @inheritdoc */ - public $resourcesPath = 'resources'; - + public $resourcesPath = 'resources'; + /** * @inheritdoc */ diff --git a/assets/Assets.php b/assets/Assets.php index c3de69a..f9ff1c7 100644 --- a/assets/Assets.php +++ b/assets/Assets.php @@ -17,14 +17,14 @@ class Assets extends AssetBundle public $publishOptions = [ // TIPP: Change forceCopy to true when testing your js in order to rebuild // this assets on every request (otherwise they will be cached) - 'forceCopy' => false + 'forceCopy' => false, ]; /** * @inheritdoc */ public $js = [ - 'js/humhub.example-basic.js' + 'js/humhub.example-basic.js', ]; -} \ No newline at end of file +} diff --git a/config.php b/config.php index 5f7603a..c6e2499 100644 --- a/config.php +++ b/config.php @@ -10,6 +10,6 @@ 'namespace' => 'acmeCorp\humhub\modules\exampleBasic', 'events' => [ [TopMenu::class, TopMenu::EVENT_INIT, [Events::class, 'onTopMenuInit']], - [AdminMenu::class, AdminMenu::EVENT_INIT, [Events::class, 'onAdminMenuInit']] + [AdminMenu::class, AdminMenu::EVENT_INIT, [Events::class, 'onAdminMenuInit']], ], ]; diff --git a/controllers/AdminController.php b/controllers/AdminController.php index 053690b..b9a6d04 100644 --- a/controllers/AdminController.php +++ b/controllers/AdminController.php @@ -6,7 +6,6 @@ class AdminController extends Controller { - /** * Render admin only page * @@ -18,4 +17,3 @@ public function actionIndex() } } - diff --git a/controllers/IndexController.php b/controllers/IndexController.php index 0dac80b..c3c075f 100644 --- a/controllers/IndexController.php +++ b/controllers/IndexController.php @@ -6,7 +6,6 @@ class IndexController extends Controller { - /** * Renders the index view for the module * @@ -18,4 +17,3 @@ public function actionIndex() } } - diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index ad3aa1c..1f58ce6 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,6 +4,7 @@ Changelog 1.0.2 (Unreleased) ---------------------- - Enh #5: Add `requirements.php` +- Enh #9: Use PHP CS Fixer 1.0.1 (April 19, 2021) ---------------------- diff --git a/tests/codeception/_support/UnitTester.php b/tests/codeception/_support/UnitTester.php index efd911a..bc33039 100644 --- a/tests/codeception/_support/UnitTester.php +++ b/tests/codeception/_support/UnitTester.php @@ -26,7 +26,7 @@ class UnitTester extends \UnitTester { use _generated\UnitTesterActions; - /** - * Define custom actions here - */ + /** + * Define custom actions here + */ } diff --git a/tests/codeception/acceptance/AdminAreaCest.php b/tests/codeception/acceptance/AdminAreaCest.php index d37eebf..d2bd92d 100644 --- a/tests/codeception/acceptance/AdminAreaCest.php +++ b/tests/codeception/acceptance/AdminAreaCest.php @@ -6,7 +6,6 @@ class AdminAreaCest { - public function testAdminInfoPage(AcceptanceTester $I) { $I->wantTo('see admin info page'); diff --git a/tests/codeception/config/unit.php b/tests/codeception/config/unit.php index 44c0233..15d0428 100644 --- a/tests/codeception/config/unit.php +++ b/tests/codeception/config/unit.php @@ -1,3 +1,3 @@ wantTo('see top menu entry'); $I->amUser(); $I->amOnDashboard(); $I->see('EXAMPLE'); } - public function testIndexPage(FunctionalTester $I) { + public function testIndexPage(FunctionalTester $I) + { $I->wantTo('go to module page'); $I->amAdmin(); $I->amOnDashboard(); diff --git a/tests/codeception/unit/CalculatorTest.php b/tests/codeception/unit/CalculatorTest.php index d52b063..7030748 100644 --- a/tests/codeception/unit/CalculatorTest.php +++ b/tests/codeception/unit/CalculatorTest.php @@ -12,4 +12,4 @@ public function testAddition() $this->assertTrue((2 !== 3)); } -} \ No newline at end of file +} diff --git a/tests/config/test.php b/tests/config/test.php index 59b0d10..b542547 100644 --- a/tests/config/test.php +++ b/tests/config/test.php @@ -10,5 +10,5 @@ 'fixtures' => [ 'default', //'exam' => 'acmeCorp\humhub\modules\exampleBasic\tests\codeception\fixtures\ExamFixture', - ] + ], ];