Skip to content

Commit

Permalink
Merge pull request #9 from humhub/enh/php-cs-fixer
Browse files Browse the repository at this point in the history
Use PHP CS Fixer
  • Loading branch information
luke- authored Oct 3, 2024
2 parents 8c2354b + f8492a8 commit 5e9d3d6
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 21 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: PHP CS Fixer

on: push

jobs:
fixers:
uses: humhub/actions/.github/workflows/module-php-cs-fixer.yml@main
2 changes: 1 addition & 1 deletion Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]));
}
}
4 changes: 2 additions & 2 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class Module extends \humhub\components\Module
/**
* @inheritdoc
*/
public $resourcesPath = 'resources';
public $resourcesPath = 'resources';

/**
* @inheritdoc
*/
Expand Down
6 changes: 3 additions & 3 deletions assets/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];

}
}
2 changes: 1 addition & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']],
],
];
2 changes: 0 additions & 2 deletions controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class AdminController extends Controller
{

/**
* Render admin only page
*
Expand All @@ -18,4 +17,3 @@ public function actionIndex()
}

}

2 changes: 0 additions & 2 deletions controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class IndexController extends Controller
{

/**
* Renders the index view for the module
*
Expand All @@ -18,4 +17,3 @@ public function actionIndex()
}

}

1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
----------------------
Expand Down
6 changes: 3 additions & 3 deletions tests/codeception/_support/UnitTester.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class UnitTester extends \UnitTester
{
use _generated\UnitTesterActions;

/**
* Define custom actions here
*/
/**
* Define custom actions here
*/
}
1 change: 0 additions & 1 deletion tests/codeception/acceptance/AdminAreaCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class AdminAreaCest
{

public function testAdminInfoPage(AcceptanceTester $I)
{
$I->wantTo('see admin info page');
Expand Down
2 changes: 1 addition & 1 deletion tests/codeception/config/unit.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

return \tests\codeception\_support\HumHubTestConfiguration::getSuiteConfig('unit');
return \tests\codeception\_support\HumHubTestConfiguration::getSuiteConfig('unit');
7 changes: 4 additions & 3 deletions tests/codeception/functional/IndexPageCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@

class IndexPageCest
{

public function testTopMenu(FunctionalTester $I) {
public function testTopMenu(FunctionalTester $I)
{
$I->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();
Expand Down
2 changes: 1 addition & 1 deletion tests/codeception/unit/CalculatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ public function testAddition()
$this->assertTrue((2 !== 3));
}

}
}
2 changes: 1 addition & 1 deletion tests/config/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
'fixtures' => [
'default',
//'exam' => 'acmeCorp\humhub\modules\exampleBasic\tests\codeception\fixtures\ExamFixture',
]
],
];

0 comments on commit 5e9d3d6

Please sign in to comment.