Skip to content

Commit 5e9d3d6

Browse files
authored
Merge pull request #9 from humhub/enh/php-cs-fixer
Use PHP CS Fixer
2 parents 8c2354b + f8492a8 commit 5e9d3d6

File tree

14 files changed

+25
-21
lines changed

14 files changed

+25
-21
lines changed

.github/workflows/php-cs-fixer.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: PHP CS Fixer
2+
3+
on: push
4+
5+
jobs:
6+
fixers:
7+
uses: humhub/actions/.github/workflows/module-php-cs-fixer.yml@main

Events.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static function onAdminMenuInit($event): void
5050
'icon' => 'info-circle',
5151
'sortOrder' => 1000,
5252
'isActive' => (Yii::$app->controller->module && Yii::$app->controller->module->id == 'example-basic' && Yii::$app->controller->id == 'admin'),
53-
'isVisible' => Yii::$app->user->can(ManageModules::class)
53+
'isVisible' => Yii::$app->user->can(ManageModules::class),
5454
]));
5555
}
5656
}

Module.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ class Module extends \humhub\components\Module
99
/**
1010
* @inheritdoc
1111
*/
12-
public $resourcesPath = 'resources';
13-
12+
public $resourcesPath = 'resources';
13+
1414
/**
1515
* @inheritdoc
1616
*/

assets/Assets.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ class Assets extends AssetBundle
1717
public $publishOptions = [
1818
// TIPP: Change forceCopy to true when testing your js in order to rebuild
1919
// this assets on every request (otherwise they will be cached)
20-
'forceCopy' => false
20+
'forceCopy' => false,
2121
];
2222

2323
/**
2424
* @inheritdoc
2525
*/
2626
public $js = [
27-
'js/humhub.example-basic.js'
27+
'js/humhub.example-basic.js',
2828
];
2929

30-
}
30+
}

config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
'namespace' => 'acmeCorp\humhub\modules\exampleBasic',
1111
'events' => [
1212
[TopMenu::class, TopMenu::EVENT_INIT, [Events::class, 'onTopMenuInit']],
13-
[AdminMenu::class, AdminMenu::EVENT_INIT, [Events::class, 'onAdminMenuInit']]
13+
[AdminMenu::class, AdminMenu::EVENT_INIT, [Events::class, 'onAdminMenuInit']],
1414
],
1515
];

controllers/AdminController.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
class AdminController extends Controller
88
{
9-
109
/**
1110
* Render admin only page
1211
*
@@ -18,4 +17,3 @@ public function actionIndex()
1817
}
1918

2019
}
21-

controllers/IndexController.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
class IndexController extends Controller
88
{
9-
109
/**
1110
* Renders the index view for the module
1211
*
@@ -18,4 +17,3 @@ public function actionIndex()
1817
}
1918

2019
}
21-

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44
1.0.2 (Unreleased)
55
----------------------
66
- Enh #5: Add `requirements.php`
7+
- Enh #9: Use PHP CS Fixer
78

89
1.0.1 (April 19, 2021)
910
----------------------

tests/codeception/_support/UnitTester.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class UnitTester extends \UnitTester
2626
{
2727
use _generated\UnitTesterActions;
2828

29-
/**
30-
* Define custom actions here
31-
*/
29+
/**
30+
* Define custom actions here
31+
*/
3232
}

tests/codeception/acceptance/AdminAreaCest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
class AdminAreaCest
88
{
9-
109
public function testAdminInfoPage(AcceptanceTester $I)
1110
{
1211
$I->wantTo('see admin info page');

tests/codeception/config/unit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
22

3-
return \tests\codeception\_support\HumHubTestConfiguration::getSuiteConfig('unit');
3+
return \tests\codeception\_support\HumHubTestConfiguration::getSuiteConfig('unit');

tests/codeception/functional/IndexPageCest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@
1111

1212
class IndexPageCest
1313
{
14-
15-
public function testTopMenu(FunctionalTester $I) {
14+
public function testTopMenu(FunctionalTester $I)
15+
{
1616
$I->wantTo('see top menu entry');
1717
$I->amUser();
1818
$I->amOnDashboard();
1919
$I->see('EXAMPLE');
2020
}
2121

22-
public function testIndexPage(FunctionalTester $I) {
22+
public function testIndexPage(FunctionalTester $I)
23+
{
2324
$I->wantTo('go to module page');
2425
$I->amAdmin();
2526
$I->amOnDashboard();

tests/codeception/unit/CalculatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ public function testAddition()
1212
$this->assertTrue((2 !== 3));
1313
}
1414

15-
}
15+
}

tests/config/test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
'fixtures' => [
1111
'default',
1212
//'exam' => 'acmeCorp\humhub\modules\exampleBasic\tests\codeception\fixtures\ExamFixture',
13-
]
13+
],
1414
];

0 commit comments

Comments
 (0)