Skip to content

Commit

Permalink
Merge pull request #6 from humhub-contrib/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 9, 2024
2 parents 6e30a26 + 402f93e commit 5e5c8d4
Show file tree
Hide file tree
Showing 13 changed files with 307 additions and 156 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 @@ -22,7 +22,7 @@ public static function onAuthClientCollectionInit($event)
$authClientCollection->setClient('twitter', [
'class' => TwitterAuth::class,
'consumerKey' => ConfigureForm::getInstance()->consumerId,
'consumerSecret' => ConfigureForm::getInstance()->consumerSecret
'consumerSecret' => ConfigureForm::getInstance()->consumerSecret,
]);
}
}
Expand Down
1 change: 0 additions & 1 deletion Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
class Module extends \humhub\components\Module
{

/**
* @inheritdoc
*/
Expand Down
2 changes: 1 addition & 1 deletion authclient/TwitterAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class TwitterAuth extends Twitter
* @inheritdoc
*/
public $attributeParams = [
'include_email' => 'true'
'include_email' => 'true',
];

/**
Expand Down
2 changes: 1 addition & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
'class' => 'humhubContrib\auth\twitter\Module',
'namespace' => 'humhubContrib\auth\twitter',
'events' => [
[Collection::class, Collection::EVENT_AFTER_CLIENTS_SET, ['humhubContrib\auth\twitter\Events', 'onAuthClientCollectionInit']]
[Collection::class, Collection::EVENT_AFTER_CLIENTS_SET, ['humhubContrib\auth\twitter\Events', 'onAuthClientCollectionInit']],
],
];
1 change: 0 additions & 1 deletion controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
class AdminController extends Controller
{

/**
* Render admin only page
*
Expand Down
5 changes: 5 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
Changelog
=========

1.0.2 (Unreleased)
-------------------------
- Enh #6: Use PHP CS Fixer

1.0.1 (January 7, 2023)
-------------------------
- Enh: Add requirements

1.0.0 (February 23, 2022)
Expand Down
10 changes: 5 additions & 5 deletions models/ConfigureForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class ConfigureForm extends Model
{
/**
* @var boolean Enable this authclient
* @var bool Enable this authclient
*/
public $enabled;

Expand Down Expand Up @@ -74,12 +74,12 @@ public function loadSettings()

$settings = $module->settings;

$this->enabled = (boolean)$settings->get('enabled');
$this->enabled = (bool)$settings->get('enabled');
$this->consumerId = $settings->get('consumerId');
$this->consumerSecret = $settings->get('consumerSecret');

$this->redirectUri = Url::to(['/user/auth/external', 'authclient' => 'twitter'], true);
// $this->redirectUri = Url::to(['user/auth/twitter'], true);
// $this->redirectUri = Url::to(['user/auth/twitter'], true);
}

/**
Expand All @@ -90,7 +90,7 @@ public function saveSettings()
/** @var Module $module */
$module = Yii::$app->getModule('auth-twitter');

$module->settings->set('enabled', (boolean)$this->enabled);
$module->settings->set('enabled', (bool)$this->enabled);
$module->settings->set('consumerId', $this->consumerId);
$module->settings->set('consumerSecret', $this->consumerSecret);

Expand All @@ -102,7 +102,7 @@ public function saveSettings()
*/
public static function getInstance()
{
$config = new static;
$config = new static();
$config->loadSettings();

return $config;
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Integrating Twitter Sign-In (OAuth 2.0).",
"keywords": [
],
"version": "1.0.0",
"version": "1.0.2",
"homepage": "https://github.com/humhub-contrib/auth-twitter",
"humhub": {
"minVersion": "1.9"
Expand Down
5 changes: 2 additions & 3 deletions tests/codeception/_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@
\Codeception\Util\Autoload::addNamespace('', Yii::getAlias('@humhubTests/codeception/_support'));
\Codeception\Util\Autoload::addNamespace('tests\codeception\fixtures', Yii::getAlias('@humhubTests/codeception/fixtures'));
\Codeception\Util\Autoload::addNamespace('', Yii::getAlias('@humhubTests/codeception/_pages'));
if(isset($cfg['modules'])) {
if (isset($cfg['modules'])) {
\Codeception\Configuration::append(['humhub_modules' => $cfg['modules']]);
}

if(isset($cfg['fixtures'])) {
if (isset($cfg['fixtures'])) {
\Codeception\Configuration::append(['fixtures' => $cfg['fixtures']]);
}
?>
1 change: 1 addition & 0 deletions tests/codeception/_support/AcceptanceTester.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace twitter;

/**
Expand Down
Loading

0 comments on commit 5e5c8d4

Please sign in to comment.