-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from humhub/enh/php-cs-fixer
Use PHP CS Fixer
- Loading branch information
Showing
13 changed files
with
91 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: PHP CS Fixer | ||
|
||
on: push | ||
|
||
jobs: | ||
tests: | ||
uses: humhub/actions/.github/workflows/module-php-cs-fixer.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ | |
*/ | ||
class FileUpdate extends Model | ||
{ | ||
|
||
/** | ||
* @var File File for updating its content | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,73 @@ | ||
<?php | ||
/** | ||
* @link https://www.humhub.org/ | ||
* @copyright Copyright (c) HumHub GmbH & Co. KG | ||
* @license https://www.humhub.com/licences | ||
*/ | ||
|
||
namespace humhub\modules\text_editor\models\forms; | ||
|
||
use humhub\components\SettingsManager; | ||
use humhub\modules\text_editor\Module; | ||
use Yii; | ||
use yii\base\Model; | ||
|
||
/** | ||
* Form for Text Editor Module Settings | ||
*/ | ||
class ConfigForm extends Model | ||
{ | ||
public bool $allowNewFiles = false; | ||
|
||
protected ?SettingsManager $settings = null; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function init() | ||
{ | ||
$this->allowNewFiles = (bool) $this->getSettings()->get('allowNewFiles', false); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function rules() | ||
{ | ||
return [ | ||
[['allowNewFiles'], 'boolean'], | ||
]; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function attributeLabels() | ||
{ | ||
return [ | ||
'allowNewFiles' => Yii::t('TextEditorModule.base', 'Allow creation of new text files'), | ||
]; | ||
} | ||
|
||
public function save(): bool | ||
{ | ||
if (!$this->validate()) { | ||
return false; | ||
} | ||
|
||
$this->getSettings()->set('allowNewFiles', $this->allowNewFiles); | ||
|
||
return true; | ||
} | ||
|
||
protected function getSettings(): SettingsManager | ||
{ | ||
if ($this->settings === null) { | ||
/* @var Module $module */ | ||
$module = Yii::$app->getModule('text-editor'); | ||
$this->settings = $module->settings; | ||
} | ||
|
||
return $this->settings; | ||
} | ||
} | ||
<?php | ||
/** | ||
* @link https://www.humhub.org/ | ||
* @copyright Copyright (c) HumHub GmbH & Co. KG | ||
* @license https://www.humhub.com/licences | ||
*/ | ||
|
||
namespace humhub\modules\text_editor\models\forms; | ||
|
||
use humhub\components\SettingsManager; | ||
use humhub\modules\text_editor\Module; | ||
use Yii; | ||
use yii\base\Model; | ||
|
||
/** | ||
* Form for Text Editor Module Settings | ||
*/ | ||
class ConfigForm extends Model | ||
{ | ||
public bool $allowNewFiles = false; | ||
|
||
protected ?SettingsManager $settings = null; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function init() | ||
{ | ||
$this->allowNewFiles = (bool) $this->getSettings()->get('allowNewFiles', false); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function rules() | ||
{ | ||
return [ | ||
[['allowNewFiles'], 'boolean'], | ||
]; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function attributeLabels() | ||
{ | ||
return [ | ||
'allowNewFiles' => Yii::t('TextEditorModule.base', 'Allow creation of new text files'), | ||
]; | ||
} | ||
|
||
public function save(): bool | ||
{ | ||
if (!$this->validate()) { | ||
return false; | ||
} | ||
|
||
$this->getSettings()->set('allowNewFiles', $this->allowNewFiles); | ||
|
||
return true; | ||
} | ||
|
||
protected function getSettings(): SettingsManager | ||
{ | ||
if ($this->settings === null) { | ||
/* @var Module $module */ | ||
$module = Yii::$app->getModule('text-editor'); | ||
$this->settings = $module->settings; | ||
} | ||
|
||
return $this->settings; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |