diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 5806d4e57f..298332f458 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -6,7 +6,7 @@ $finder = (new PhpCsFixer\Finder()) 'views/', ]) ->in([ - 'protected/humhub/modules', + 'protected/humhub', ]); return (new PhpCsFixer\Config()) diff --git a/composer.json b/composer.json index d6b90b3942..857b11b0d4 100644 --- a/composer.json +++ b/composer.json @@ -127,7 +127,9 @@ "scripts": { "post-create-project-cmd": [ "yii\\composer\\Installer::postCreateProject" - ] + ], + "cs:fix": "protected/vendor/bin/php-cs-fixer fix", + "cs:check": "protected/vendor/bin/php-cs-fixer fix --dry-run --diff" }, "extra": { "yii\\composer\\Installer::postCreateProject": { diff --git a/protected/humhub/assets/AppAsset.php b/protected/humhub/assets/AppAsset.php index ffbf47f675..9edebaf958 100755 --- a/protected/humhub/assets/AppAsset.php +++ b/protected/humhub/assets/AppAsset.php @@ -44,9 +44,9 @@ class AppAsset extends WebStaticAssetBundle */ public $jsPosition = View::POS_HEAD; - const BUNDLE_NAME = 'app'; + public const BUNDLE_NAME = 'app'; - const STATIC_DEPENDS = [ + public const STATIC_DEPENDS = [ JqueryAsset::class, JuiBootstrapBridgeAsset::class, JuiAsset::class, diff --git a/protected/humhub/assets/BlueimpFileUploadAsset.php b/protected/humhub/assets/BlueimpFileUploadAsset.php index 9dd944c2fa..5947627310 100644 --- a/protected/humhub/assets/BlueimpFileUploadAsset.php +++ b/protected/humhub/assets/BlueimpFileUploadAsset.php @@ -17,7 +17,6 @@ use humhub\components\assets\AssetBundle; */ class BlueimpFileUploadAsset extends AssetBundle { - /** * @inheritdoc */ diff --git a/protected/humhub/assets/BlueimpGalleryAsset.php b/protected/humhub/assets/BlueimpGalleryAsset.php index 319f923394..6a8e3b9a76 100644 --- a/protected/humhub/assets/BlueimpGalleryAsset.php +++ b/protected/humhub/assets/BlueimpGalleryAsset.php @@ -17,7 +17,6 @@ use humhub\components\assets\AssetBundle; */ class BlueimpGalleryAsset extends AssetBundle { - /** * @inheritdoc */ diff --git a/protected/humhub/assets/BlueimpGalleryStyleAsset.php b/protected/humhub/assets/BlueimpGalleryStyleAsset.php index ad17aa49cf..f35454112e 100644 --- a/protected/humhub/assets/BlueimpGalleryStyleAsset.php +++ b/protected/humhub/assets/BlueimpGalleryStyleAsset.php @@ -17,7 +17,6 @@ use humhub\components\assets\AssetBundle; */ class BlueimpGalleryStyleAsset extends AssetBundle { - /** * @inheritdoc */ diff --git a/protected/humhub/assets/BootstrapColorPickerAsset.php b/protected/humhub/assets/BootstrapColorPickerAsset.php index 2a1ea73afc..00f2efe5ed 100644 --- a/protected/humhub/assets/BootstrapColorPickerAsset.php +++ b/protected/humhub/assets/BootstrapColorPickerAsset.php @@ -22,9 +22,9 @@ class BootstrapColorPickerAsset extends WebStaticAssetBundle */ public $js = ['js/colorpicker/js/bootstrap-colorpicker-modified.js']; - /** - * @inheritdoc - */ + /** + * @inheritdoc + */ public $css = ['js/colorpicker/css/bootstrap-colorpicker.min.css']; } diff --git a/protected/humhub/assets/CaretJsAsset.php b/protected/humhub/assets/CaretJsAsset.php index bcc439f2cd..4d3755afd5 100644 --- a/protected/humhub/assets/CaretJsAsset.php +++ b/protected/humhub/assets/CaretJsAsset.php @@ -17,7 +17,6 @@ use yii\web\AssetBundle; */ class CaretjsAsset extends AssetBundle { - /** * @inheritdoc */ diff --git a/protected/humhub/assets/ClipboardJsAsset.php b/protected/humhub/assets/ClipboardJsAsset.php index 7112107bf8..e97f8d9b92 100644 --- a/protected/humhub/assets/ClipboardJsAsset.php +++ b/protected/humhub/assets/ClipboardJsAsset.php @@ -17,7 +17,6 @@ use humhub\components\assets\AssetBundle; */ class ClipboardJsAsset extends AssetBundle { - /** * @inheritdoc */ diff --git a/protected/humhub/assets/CoreBundleAsset.php b/protected/humhub/assets/CoreBundleAsset.php index 10ac956438..9e148f43d9 100644 --- a/protected/humhub/assets/CoreBundleAsset.php +++ b/protected/humhub/assets/CoreBundleAsset.php @@ -29,11 +29,11 @@ use humhub\modules\user\assets\UserPickerAsset; */ class CoreBundleAsset extends WebStaticAssetBundle { - const BUNDLE_NAME = 'defer'; + public const BUNDLE_NAME = 'defer'; public $defaultDepends = false; - const STATIC_DEPENDS = [ + public const STATIC_DEPENDS = [ AppAsset::class, JqueryHighlightAsset::class, JqueryAutosizeAsset::class, diff --git a/protected/humhub/assets/CoreExtensionAsset.php b/protected/humhub/assets/CoreExtensionAsset.php index fd2b2c1a0c..ac68b93704 100644 --- a/protected/humhub/assets/CoreExtensionAsset.php +++ b/protected/humhub/assets/CoreExtensionAsset.php @@ -1,6 +1,5 @@ View::POS_BEGIN]; /** diff --git a/protected/humhub/assets/JqueryNiceScrollAsset.php b/protected/humhub/assets/JqueryNiceScrollAsset.php index 0a582ea8cd..b526d52a10 100644 --- a/protected/humhub/assets/JqueryNiceScrollAsset.php +++ b/protected/humhub/assets/JqueryNiceScrollAsset.php @@ -17,7 +17,6 @@ use humhub\components\assets\WebStaticAssetBundle; */ class JqueryNiceScrollAsset extends WebStaticAssetBundle { - /** * @inheritdoc */ diff --git a/protected/humhub/assets/JqueryTimeEntryAsset.php b/protected/humhub/assets/JqueryTimeEntryAsset.php index 82d4309b1c..6ceb636026 100644 --- a/protected/humhub/assets/JqueryTimeEntryAsset.php +++ b/protected/humhub/assets/JqueryTimeEntryAsset.php @@ -18,7 +18,6 @@ use yii\web\AssetBundle; */ class JqueryTimeEntryAsset extends AssetBundle { - public $publishOptions = [ 'forceCopy' => false ]; diff --git a/protected/humhub/assets/JqueryWidgetAsset.php b/protected/humhub/assets/JqueryWidgetAsset.php index 78253b6a31..b50c53337c 100644 --- a/protected/humhub/assets/JqueryWidgetAsset.php +++ b/protected/humhub/assets/JqueryWidgetAsset.php @@ -17,7 +17,6 @@ use humhub\components\assets\AssetBundle; */ class JqueryWidgetAsset extends AssetBundle { - /** * @inheritdoc */ diff --git a/protected/humhub/assets/NProgressAsset.php b/protected/humhub/assets/NProgressAsset.php index c8750506e5..095f2413c4 100644 --- a/protected/humhub/assets/NProgressAsset.php +++ b/protected/humhub/assets/NProgressAsset.php @@ -18,7 +18,6 @@ use humhub\components\assets\AssetBundle; */ class NProgressAsset extends AssetBundle { - /** * @inheritdoc */ diff --git a/protected/humhub/assets/NProgressStyleAsset.php b/protected/humhub/assets/NProgressStyleAsset.php index 0d296a54a2..1d9a96adc4 100644 --- a/protected/humhub/assets/NProgressStyleAsset.php +++ b/protected/humhub/assets/NProgressStyleAsset.php @@ -18,7 +18,6 @@ use humhub\components\assets\AssetBundle; */ class NProgressStyleAsset extends AssetBundle { - /** * @inheritdoc */ diff --git a/protected/humhub/assets/Select2Asset.php b/protected/humhub/assets/Select2Asset.php index ba168a3c6c..1e75819d2d 100644 --- a/protected/humhub/assets/Select2Asset.php +++ b/protected/humhub/assets/Select2Asset.php @@ -17,7 +17,6 @@ use yii\web\AssetBundle; */ class Select2Asset extends AssetBundle { - /** * @inheritdoc */ diff --git a/protected/humhub/assets/Select2BootstrapAsset.php b/protected/humhub/assets/Select2BootstrapAsset.php index f0bc8a2bb8..27433b1101 100644 --- a/protected/humhub/assets/Select2BootstrapAsset.php +++ b/protected/humhub/assets/Select2BootstrapAsset.php @@ -18,7 +18,6 @@ use yii\web\AssetBundle; */ class Select2BootstrapAsset extends AssetBundle { - /** * @inheritdoc */ diff --git a/protected/humhub/assets/Select2SearchInputPlaceholderAsset.php b/protected/humhub/assets/Select2SearchInputPlaceholderAsset.php index e72c608df4..0003d8022b 100644 --- a/protected/humhub/assets/Select2SearchInputPlaceholderAsset.php +++ b/protected/humhub/assets/Select2SearchInputPlaceholderAsset.php @@ -18,4 +18,4 @@ class Select2SearchInputPlaceholderAsset extends WebStaticAssetBundle * @inheritdoc */ public $js = ['js/select2-searchInputPlaceholder.min.js']; -} \ No newline at end of file +} diff --git a/protected/humhub/assets/Select2StyleAsset.php b/protected/humhub/assets/Select2StyleAsset.php index f636ac8aae..949be7f50c 100644 --- a/protected/humhub/assets/Select2StyleAsset.php +++ b/protected/humhub/assets/Select2StyleAsset.php @@ -17,7 +17,6 @@ use yii\web\AssetBundle; */ class Select2StyleAsset extends AssetBundle { - /** * @inheritdoc */ diff --git a/protected/humhub/assets/SocketIoAsset.php b/protected/humhub/assets/SocketIoAsset.php index 792839c28a..9ab74f7614 100644 --- a/protected/humhub/assets/SocketIoAsset.php +++ b/protected/humhub/assets/SocketIoAsset.php @@ -18,7 +18,6 @@ use yii\web\AssetBundle; */ class SocketIoAsset extends AssetBundle { - /** * @inheritdoc */ diff --git a/protected/humhub/assets/SwipedEventsAssets.php b/protected/humhub/assets/SwipedEventsAssets.php index 2faff9e846..e61994bab1 100644 --- a/protected/humhub/assets/SwipedEventsAssets.php +++ b/protected/humhub/assets/SwipedEventsAssets.php @@ -17,7 +17,6 @@ use humhub\components\assets\AssetBundle; */ class SwipedEventsAssets extends AssetBundle { - /** * @inheritdoc */ diff --git a/protected/humhub/assets/TopNavigationAsset.php b/protected/humhub/assets/TopNavigationAsset.php index 533b45c9e0..7c204440fc 100644 --- a/protected/humhub/assets/TopNavigationAsset.php +++ b/protected/humhub/assets/TopNavigationAsset.php @@ -1,9 +1,7 @@ flag == self::ARRAY_AS_PROPS) { - $ret =& $this->offsetGet($key); + $ret = & $this->offsetGet($key); return $ret; } @@ -296,7 +295,7 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Countable if (!$this->offsetExists($key)) { return $ret; } - $ret =& $this->storage[$key]; + $ret = & $this->storage[$key]; return $ret; } @@ -425,7 +424,7 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Countable $this->setIteratorClass($v); break; case 'protectedProperties': -// continue; + // continue; // HUMHUB MODIFICATION continue 2; diff --git a/protected/humhub/compat/HForm.php b/protected/humhub/compat/HForm.php index ba0b40dff7..23d09c9944 100644 --- a/protected/humhub/compat/HForm.php +++ b/protected/humhub/compat/HForm.php @@ -26,18 +26,18 @@ use yii\widgets\ActiveField; */ class HForm extends \yii\base\Component { - const EVENT_BEFORE_VALIDATE = 'beforeValidate'; - const EVENT_AFTER_VALIDATE = 'afterValidate'; + public const EVENT_BEFORE_VALIDATE = 'beforeValidate'; + public const EVENT_AFTER_VALIDATE = 'afterValidate'; /** * @since 1.2.6 */ - const EVENT_AFTER_INIT = 'afterInit'; + public const EVENT_AFTER_INIT = 'afterInit'; /** * @since 1.2.6 */ - const EVENT_BEFORE_RENDER = 'beforeRender'; + public const EVENT_BEFORE_RENDER = 'beforeRender'; public $showErrorSummary; @@ -52,7 +52,7 @@ class HForm extends \yii\base\Component public $definition = []; /** - * @var boolean manually mark form as submitted + * @var bool manually mark form as submitted */ public $markedAsSubmitted = false; diff --git a/protected/humhub/components/ActiveRecord.php b/protected/humhub/components/ActiveRecord.php index c3e0a9220d..be1d208913 100644 --- a/protected/humhub/components/ActiveRecord.php +++ b/protected/humhub/components/ActiveRecord.php @@ -26,7 +26,6 @@ use yii\validators\Validator; */ class ActiveRecord extends \yii\db\ActiveRecord { - /** * @var \humhub\modules\file\components\FileManager */ @@ -41,7 +40,7 @@ class ActiveRecord extends \yii\db\ActiveRecord /** * @event Event is used to append rules what defined in [[rules()]]. */ - const EVENT_APPEND_RULES = 'appendRules'; + public const EVENT_APPEND_RULES = 'appendRules'; /** * @inheritdoc @@ -180,7 +179,7 @@ class ActiveRecord extends \yii\db\ActiveRecord public function __unserialize($unserializedArr) { $this->init(); - $this->setAttributes($unserializedArr['attributes'],false); + $this->setAttributes($unserializedArr['attributes'], false); $this->setOldAttributes($unserializedArr['oldAttributes']); } diff --git a/protected/humhub/components/ApplicationTrait.php b/protected/humhub/components/ApplicationTrait.php index 3546321ab2..197fdd9868 100644 --- a/protected/humhub/components/ApplicationTrait.php +++ b/protected/humhub/components/ApplicationTrait.php @@ -74,7 +74,7 @@ trait ApplicationTrait /** * Checks if Humhub is installed * - * @return boolean + * @return bool * @since 1.16 */ public function isInstalled(): bool diff --git a/protected/humhub/components/AssetManager.php b/protected/humhub/components/AssetManager.php index 6a3305c8f5..b615bf33d4 100644 --- a/protected/humhub/components/AssetManager.php +++ b/protected/humhub/components/AssetManager.php @@ -75,7 +75,7 @@ class AssetManager extends \yii\web\AssetManager array_unshift($bundle->depends, CoreBundleAsset::class); // Allows to add defer to non HumHub AssetBundles - if(property_exists($bundle,'defer') && $bundle->defer) { + if(property_exists($bundle, 'defer') && $bundle->defer) { $bundle->jsOptions['defer'] = 'defer'; } } diff --git a/protected/humhub/components/ContentContainerUrlRule.php b/protected/humhub/components/ContentContainerUrlRule.php index 0ef7c0c1aa..4c7b96d77e 100644 --- a/protected/humhub/components/ContentContainerUrlRule.php +++ b/protected/humhub/components/ContentContainerUrlRule.php @@ -21,7 +21,6 @@ use yii\base\BaseObject; */ abstract class ContentContainerUrlRule extends BaseObject implements UrlRuleInterface { - /** * @var string default route to content container home */ @@ -48,7 +47,7 @@ abstract class ContentContainerUrlRule extends BaseObject implements UrlRuleInte * @param string $url * @return ContentContainerActiveRecord */ - abstract static protected function getContentContainerByUrl(string $url): ?ContentContainerActiveRecord; + abstract protected static function getContentContainerByUrl(string $url): ?ContentContainerActiveRecord; /** * Get Content Container by guid @@ -156,7 +155,7 @@ abstract class ContentContainerUrlRule extends BaseObject implements UrlRuleInte $ruleRoute = []; foreach ($ruleParts as $r => $rulePart) { - if (preg_match( '/^<([a-zA-Z0-9_-]+)>$/', $rulePart, $ruleParamMatch)) { + if (preg_match('/^<([a-zA-Z0-9_-]+)>$/', $rulePart, $ruleParamMatch)) { if (!isset($params[$ruleParamMatch[1]])) { return false; } @@ -254,7 +253,7 @@ abstract class ContentContainerUrlRule extends BaseObject implements UrlRuleInte $ruleParams = []; foreach ($ruleParts as $r => $rulePart) { - if (preg_match( '/^<([a-zA-Z0-9_-]+)>$/', $rulePart, $ruleParamMatch)) { + if (preg_match('/^<([a-zA-Z0-9_-]+)>$/', $rulePart, $ruleParamMatch)) { $ruleParams[$ruleParamMatch[1]] = $requestParts[$r]; } elseif ($rulePart !== $requestParts[$r]) { // Skip the rule if at least one part is different diff --git a/protected/humhub/components/Controller.php b/protected/humhub/components/Controller.php index dedb10afc3..5d7c2de4a1 100644 --- a/protected/humhub/components/Controller.php +++ b/protected/humhub/components/Controller.php @@ -30,7 +30,7 @@ class Controller extends \yii\web\Controller /** * @event \yii\base\Event an event raised on init a controller. */ - const EVENT_INIT = 'init'; + public const EVENT_INIT = 'init'; /** * @var null|string the name of the sub layout to be applied to this controller's views. @@ -49,7 +49,7 @@ class Controller extends \yii\web\Controller public $actionTitlesMap = []; /** - * @var boolean append page title + * @var bool append page title */ public $prependActionTitles = true; @@ -161,7 +161,7 @@ class Controller extends \yii\web\Controller /** * Throws HttpException in case the request is not an post request, otherwise returns true. * - * @return boolean returns true in case the current request is a POST + * @return bool returns true in case the current request is a POST * @throws \yii\web\HttpException */ public function forcePostRequest() @@ -271,7 +271,7 @@ class Controller extends \yii\web\Controller * * @param array $map * [action_id => action_page_title] - * @param boolean $prependActionTitles set to false if the action titles should rather be appended + * @param bool $prependActionTitles set to false if the action titles should rather be appended */ public function setActionTitles($map = [], $prependActionTitles = true) { diff --git a/protected/humhub/components/Event.php b/protected/humhub/components/Event.php index f957fb2008..5c394150b3 100644 --- a/protected/humhub/components/Event.php +++ b/protected/humhub/components/Event.php @@ -16,7 +16,6 @@ namespace humhub\components; */ class Event extends \yii\base\Event { - /** * @var mixed an optional result which can be manipulated by the event handler. * Note that this varies according to which event is currently executing. diff --git a/protected/humhub/components/Module.php b/protected/humhub/components/Module.php index dea420a0fa..37cfc50a3b 100644 --- a/protected/humhub/components/Module.php +++ b/protected/humhub/components/Module.php @@ -214,7 +214,7 @@ class Module extends \yii\base\Module /** * Determines whether or not this module has an asset directory. - * @return boolean + * @return bool */ private function hasAssets() { @@ -430,7 +430,7 @@ class Module extends \yii\base\Module /** * Determines whether the module has notification classes or not * - * @return boolean has notifications + * @return bool has notifications * @since 1.2 */ public function hasNotifications() diff --git a/protected/humhub/components/ModuleEvent.php b/protected/humhub/components/ModuleEvent.php index 03ae749b76..5f1bcae623 100644 --- a/protected/humhub/components/ModuleEvent.php +++ b/protected/humhub/components/ModuleEvent.php @@ -1,9 +1,7 @@ source instanceof Comment) { $url = $this->source->getUrl(); - } else if ($this->hasContent()) { + } elseif ($this->hasContent()) { $url = $this->getContent()->getUrl(); } elseif ($this->source instanceof ContentContainerActiveRecord) { $url = $this->source->getUrl(); diff --git a/protected/humhub/components/Theme.php b/protected/humhub/components/Theme.php index b40d020b6c..6aec86c891 100644 --- a/protected/humhub/components/Theme.php +++ b/protected/humhub/components/Theme.php @@ -8,7 +8,6 @@ namespace humhub\components; - /** * @inheritdoc * @deprecated since 1.3 diff --git a/protected/humhub/components/Widget.php b/protected/humhub/components/Widget.php index 9c967a00c2..489ea67cdc 100644 --- a/protected/humhub/components/Widget.php +++ b/protected/humhub/components/Widget.php @@ -17,11 +17,10 @@ use humhub\libs\WidgetCreateEvent; */ class Widget extends \yii\base\Widget { - /** * @event WidgetCreateEvent an event raised before creating a widget. */ - const EVENT_CREATE = 'create'; + public const EVENT_CREATE = 'create'; /** * @var bool if set to false this widget won't be rendered @@ -60,7 +59,7 @@ class Widget extends \yii\base\Widget $widget = Yii::createObject($config); $out = ''; if ($widget->beforeRun()) { - $result = (empty($widget->widgetLayout)) ? $widget->run() : $widget->render($widget->widgetLayout, $widget->getLayoutViewParams()); + $result = (empty($widget->widgetLayout)) ? $widget->run() : $widget->render($widget->widgetLayout, $widget->getLayoutViewParams()); $out = $widget->afterRun($result); } } catch (\Throwable $e) { diff --git a/protected/humhub/components/access/AccessValidator.php b/protected/humhub/components/access/AccessValidator.php index ae85fa4e2d..344de8c850 100644 --- a/protected/humhub/components/access/AccessValidator.php +++ b/protected/humhub/components/access/AccessValidator.php @@ -93,7 +93,7 @@ abstract class AccessValidator extends BaseObject * The whole rule set can be retrieved by calling `$this->access->rules`. * * - * @return boolean true if validation passed otherwise true + * @return bool true if validation passed otherwise true */ abstract public function run(); diff --git a/protected/humhub/components/access/ActionAccessValidator.php b/protected/humhub/components/access/ActionAccessValidator.php index caa5c58960..5a5ac9445a 100644 --- a/protected/humhub/components/access/ActionAccessValidator.php +++ b/protected/humhub/components/access/ActionAccessValidator.php @@ -20,7 +20,6 @@ namespace humhub\components\access; */ abstract class ActionAccessValidator extends AccessValidator { - /** * @var bool if set to true (default) all validator related rules have to pass otherwise only one */ @@ -33,7 +32,7 @@ abstract class ActionAccessValidator extends AccessValidator * * @param $rule array * @param $access ControllerAccess - * @return boolean + * @return bool */ public function run() { diff --git a/protected/humhub/components/access/ControllerAccess.php b/protected/humhub/components/access/ControllerAccess.php index 59e40f4852..41463d7c24 100644 --- a/protected/humhub/components/access/ControllerAccess.php +++ b/protected/humhub/components/access/ControllerAccess.php @@ -109,70 +109,70 @@ class ControllerAccess extends BaseObject /** * Allows the action rule setting only by extra option ['myRule', 'actions' => ['action1', 'action2']] */ - const ACTION_SETTING_TYPE_OPTION_ONLY = 0; + public const ACTION_SETTING_TYPE_OPTION_ONLY = 0; /** * Allows the action rule setting by extra option ['myRule', 'actions' => ['action1', 'action2']] * or immediate ['myRule' => ['action1', 'action2']] */ - const ACTION_SETTING_TYPE_BOTH = 1; + public const ACTION_SETTING_TYPE_BOTH = 1; /** * Only admins have access to the given set of actions e.g.: ['admin' => ['action1']] */ - const RULE_ADMIN_ONLY = 'admin'; + public const RULE_ADMIN_ONLY = 'admin'; /** * Validate against a given set of permissions e.g.: * ['permission' => [MyPermission::class], 'actions' => ['action1']] */ - const RULE_PERMISSION = 'permission'; + public const RULE_PERMISSION = 'permission'; /** * Only logged in user have access e.g.: ['login' => ['action1', 'action2']] */ - const RULE_LOGGED_IN_ONLY = 'login'; + public const RULE_LOGGED_IN_ONLY = 'login'; /** * Check guest mode e.g.: ['strict'] (mainly used as global) */ - const RULE_STRICT = 'strict'; + public const RULE_STRICT = 'strict'; /** * Check guest if user is disabled */ - const RULE_DISABLED_USER = 'disabledUser'; + public const RULE_DISABLED_USER = 'disabledUser'; /** * Check guest if user is unnapproved */ - const RULE_UNAPPROVED_USER = 'unapprovedUser'; + public const RULE_UNAPPROVED_USER = 'unapprovedUser'; /** * Check guest if user must change password * @since 1.8 */ - const RULE_MUST_CHANGE_PASSWORD = 'mustChangePassword'; + public const RULE_MUST_CHANGE_PASSWORD = 'mustChangePassword'; /** * Maintenance mode is active */ - const RULE_MAINTENANCE_MODE = 'maintenance'; + public const RULE_MAINTENANCE_MODE = 'maintenance'; /** * Check guest if request method is post */ - const RULE_POST = 'post'; + public const RULE_POST = 'post'; /** * Make sure response type is json */ - const RULE_JSON = 'json'; + public const RULE_JSON = 'json'; /** * Only AJAX request is allowed for the actions */ - const RULE_AJAX_ONLY = 'ajax'; + public const RULE_AJAX_ONLY = 'ajax'; /** * @var array fixed rules will always be added to the current rule set diff --git a/protected/humhub/components/access/DelegateAccessValidator.php b/protected/humhub/components/access/DelegateAccessValidator.php index cd93112d44..9addf2fd8d 100644 --- a/protected/humhub/components/access/DelegateAccessValidator.php +++ b/protected/humhub/components/access/DelegateAccessValidator.php @@ -5,7 +5,6 @@ * @license https://www.humhub.com/licences */ - namespace humhub\components\access; class DelegateAccessValidator extends ActionAccessValidator @@ -19,7 +18,7 @@ class DelegateAccessValidator extends ActionAccessValidator * @since 1.8 */ public $codeCallback; - + /** * @inheritDoc */ diff --git a/protected/humhub/components/access/DeprecatedPermissionAccessValidator.php b/protected/humhub/components/access/DeprecatedPermissionAccessValidator.php index 2a46db0998..d5743ef125 100644 --- a/protected/humhub/components/access/DeprecatedPermissionAccessValidator.php +++ b/protected/humhub/components/access/DeprecatedPermissionAccessValidator.php @@ -4,6 +4,7 @@ * @copyright Copyright (c) 2017 HumHub GmbH & Co. KG * @license https://www.humhub.com/licences */ + namespace humhub\components\access; class DeprecatedPermissionAccessValidator extends PermissionAccessValidator diff --git a/protected/humhub/components/access/StrictAccess.php b/protected/humhub/components/access/StrictAccess.php index e794bb4a4b..a56d5af083 100644 --- a/protected/humhub/components/access/StrictAccess.php +++ b/protected/humhub/components/access/StrictAccess.php @@ -4,6 +4,7 @@ * @copyright Copyright (c) 2017 HumHub GmbH & Co. KG * @license https://www.humhub.com/licences */ + namespace humhub\components\access; /** diff --git a/protected/humhub/components/assets/AssetBundle.php b/protected/humhub/components/assets/AssetBundle.php index f720cee55b..42ccc32697 100644 --- a/protected/humhub/components/assets/AssetBundle.php +++ b/protected/humhub/components/assets/AssetBundle.php @@ -1,6 +1,5 @@ isAsync() && $this->isDefer()) { $this->jsOptions['defer'] = 'defer'; - } else if($this->isAsync()) { + } elseif($this->isAsync()) { $this->jsOptions['async'] = 'async'; } @@ -138,7 +136,7 @@ class AssetBundle extends BaseAssetBundle if(!$useProdAssets && $this->forceCopy && !isset($this->publishOptions['forceCopy'])) { $this->publishOptions['forceCopy'] = true; - } else if(!isset($this->publishOptions['forceCopy'])) { + } elseif(!isset($this->publishOptions['forceCopy'])) { $this->publishOptions['forceCopy'] = false; } diff --git a/protected/humhub/components/assets/WebStaticAssetBundle.php b/protected/humhub/components/assets/WebStaticAssetBundle.php index 48e7f88bbe..ee3119f2fd 100644 --- a/protected/humhub/components/assets/WebStaticAssetBundle.php +++ b/protected/humhub/components/assets/WebStaticAssetBundle.php @@ -1,6 +1,5 @@ label === null) { if ($provider instanceof ActiveDataProvider && $provider->query instanceof ActiveQueryInterface) { /* @var $model Model */ - $model = new $provider->query->modelClass; + $model = new $provider->query->modelClass(); $label = $model->getAttributeLabel($this->attribute); } else { $models = $provider->getModels(); @@ -96,7 +96,7 @@ class DataColumn extends Column * Returns the data cell value. * @param mixed $model the data model * @param mixed $key the key associated with the data model - * @param integer $index zero-based index of data model among models array returned by [[GridView::dataProvider]]. + * @param int $index zero-based index of data model among models array returned by [[GridView::dataProvider]]. * @return string the data cell value */ public function getDataCellValue($model, $key, $index) diff --git a/protected/humhub/components/export/ExportResult.php b/protected/humhub/components/export/ExportResult.php index 1256687f5d..90ae5b4c7e 100644 --- a/protected/humhub/components/export/ExportResult.php +++ b/protected/humhub/components/export/ExportResult.php @@ -25,7 +25,6 @@ use yii\web\Response; */ class ExportResult extends BaseObject { - /** * @var string base path for the temporary directory and files. */ @@ -102,7 +101,7 @@ class ExportResult extends BaseObject /** * Deletes associated directory with all internal files. - * @return boolean whether file has been deleted. + * @return bool whether file has been deleted. */ public function delete() { diff --git a/protected/humhub/components/export/SpreadsheetExport.php b/protected/humhub/components/export/SpreadsheetExport.php index 584b142943..72e3c64dcf 100644 --- a/protected/humhub/components/export/SpreadsheetExport.php +++ b/protected/humhub/components/export/SpreadsheetExport.php @@ -57,7 +57,6 @@ use yii\i18n\Formatter; */ class SpreadsheetExport extends Component { - /** * @var \yii\data\DataProviderInterface the data provider for the view. * This property can be omitted in case [[query]] is set. @@ -73,15 +72,15 @@ class SpreadsheetExport extends Component */ public $columns = []; /** - * @var boolean whether to show the header section of the sheet. + * @var bool whether to show the header section of the sheet. */ public $showHeader = true; /** - * @var boolean whether to show the footer section of the sheet. + * @var bool whether to show the footer section of the sheet. */ public $showFooter = false; /** - * @var boolean enable autosize for xlsx/xls export. + * @var bool enable autosize for xlsx/xls export. */ public $autoSize = true; /** diff --git a/protected/humhub/components/i18n/Formatter.php b/protected/humhub/components/i18n/Formatter.php index 1cd58aae4a..93fc3a4448 100644 --- a/protected/humhub/components/i18n/Formatter.php +++ b/protected/humhub/components/i18n/Formatter.php @@ -17,7 +17,6 @@ use yii\base\InvalidArgumentException; */ class Formatter extends \yii\i18n\Formatter { - /** * @inheritdoc */ diff --git a/protected/humhub/components/i18n/I18N.php b/protected/humhub/components/i18n/I18N.php index 53796189d2..e604aeadca 100644 --- a/protected/humhub/components/i18n/I18N.php +++ b/protected/humhub/components/i18n/I18N.php @@ -21,7 +21,6 @@ use yii\i18n\I18N as BaseI18N; */ class I18N extends BaseI18N { - /** * @var string path which contains message overwrites */ diff --git a/protected/humhub/components/i18n/ModuleMessageSource.php b/protected/humhub/components/i18n/ModuleMessageSource.php index c0765640bb..f9ff306328 100644 --- a/protected/humhub/components/i18n/ModuleMessageSource.php +++ b/protected/humhub/components/i18n/ModuleMessageSource.php @@ -13,7 +13,6 @@ use humhub\libs\I18NHelper; use Yii; use yii\base\InvalidConfigException; - /** * ModuleMessageSource * diff --git a/protected/humhub/components/rendering/DefaultViewPathRenderer.php b/protected/humhub/components/rendering/DefaultViewPathRenderer.php index 9da234b3ad..f79b77385e 100644 --- a/protected/humhub/components/rendering/DefaultViewPathRenderer.php +++ b/protected/humhub/components/rendering/DefaultViewPathRenderer.php @@ -34,7 +34,6 @@ use humhub\components\rendering\Viewable; */ class DefaultViewPathRenderer extends \humhub\components\rendering\ViewPathRenderer { - /** * @var string fallback view */ diff --git a/protected/humhub/components/rendering/LayoutRenderer.php b/protected/humhub/components/rendering/LayoutRenderer.php index 38dad1a7e1..69bf1196c7 100644 --- a/protected/humhub/components/rendering/LayoutRenderer.php +++ b/protected/humhub/components/rendering/LayoutRenderer.php @@ -30,7 +30,6 @@ use Yii; */ class LayoutRenderer extends ViewPathRenderer { - /** * @var string layout file path */ diff --git a/protected/humhub/components/rendering/MailRenderer.php b/protected/humhub/components/rendering/MailRenderer.php index 06be905f77..062e0a74d2 100644 --- a/protected/humhub/components/rendering/MailRenderer.php +++ b/protected/humhub/components/rendering/MailRenderer.php @@ -19,7 +19,6 @@ namespace humhub\components\rendering; */ class MailRenderer extends DefaultViewPathRenderer { - /** * @inheritdoc */ diff --git a/protected/humhub/components/rendering/Renderer.php b/protected/humhub/components/rendering/Renderer.php index a5846fd33d..9bfe96070e 100644 --- a/protected/humhub/components/rendering/Renderer.php +++ b/protected/humhub/components/rendering/Renderer.php @@ -19,7 +19,6 @@ namespace humhub\components\rendering; */ interface Renderer { - /** * Renders the given $viewable. * diff --git a/protected/humhub/components/rendering/ViewPathRenderer.php b/protected/humhub/components/rendering/ViewPathRenderer.php index c48825b2fe..bc3c03c60e 100644 --- a/protected/humhub/components/rendering/ViewPathRenderer.php +++ b/protected/humhub/components/rendering/ViewPathRenderer.php @@ -35,13 +35,12 @@ use Yii; */ class ViewPathRenderer extends \yii\base\BaseObject implements Renderer { - /** * Can be used to search the parent's view folder (e.g. the modules base view folder) for the view file. * Otherwise this renderer searches for a direct views subdirectory. * * This field is ignored if $viewPath is given. - * @var boolean if set to true the renderer will search in the parents view directory for the view. + * @var bool if set to true the renderer will search in the parents view directory for the view. */ public $parent = false; @@ -126,7 +125,7 @@ class ViewPathRenderer extends \yii\base\BaseObject implements Renderer * The default implementation returns the 'views' subdirectory under the directory containing the notification class file. * * @param Viewable $viewable The viewable - * @param boolean $useSubPath use the subpath if provided + * @param bool $useSubPath use the subpath if provided * @return string the directory containing the view files for this notification. */ public function getViewPath(Viewable $viewable, $useSubPath = true) diff --git a/protected/humhub/components/rendering/Viewable.php b/protected/humhub/components/rendering/Viewable.php index 67d98f9d1f..73a8911d8f 100644 --- a/protected/humhub/components/rendering/Viewable.php +++ b/protected/humhub/components/rendering/Viewable.php @@ -16,7 +16,6 @@ namespace humhub\components\rendering; */ interface Viewable { - /** * Returns an array of view parameter, required for rendering. * diff --git a/protected/humhub/config/__autocomplete.php b/protected/humhub/config/__autocomplete.php index 3edb58e3ec..535bbab4ec 100644 --- a/protected/humhub/config/__autocomplete.php +++ b/protected/humhub/config/__autocomplete.php @@ -11,7 +11,8 @@ * } * ``` */ -class Yii { +class Yii +{ /** * @var \yii\web\Application|\yii\console\Application|\humhub\components\Application|\humhub\components\console\Application|\humhub\interfaces\ApplicationInterface|__Application|__WebApplication */ @@ -40,7 +41,8 @@ class Yii { * @property \yii\web\User|__WebUser $user * @property \yii\caching\ArrayCache $runtimeCache */ -class __Application { +class __Application +{ } /** diff --git a/protected/humhub/config/assets-prod.php b/protected/humhub/config/assets-prod.php index a5c54fd166..af0e02149b 100644 --- a/protected/humhub/config/assets-prod.php +++ b/protected/humhub/config/assets-prod.php @@ -523,4 +523,4 @@ return [ 'defer', ], ], -]; \ No newline at end of file +]; diff --git a/protected/humhub/config/common.php b/protected/humhub/config/common.php index 2b73cc5989..d6be397e69 100644 --- a/protected/humhub/config/common.php +++ b/protected/humhub/config/common.php @@ -64,7 +64,7 @@ $config = [ ], 'logVars' => ['_GET', '_SERVER'], ], - \yii\log\DbTarget::class =>[ + \yii\log\DbTarget::class => [ 'class' => \yii\log\DbTarget::class, 'levels' => ['error', 'warning'], 'except' => [ diff --git a/protected/humhub/controllers/ErrorController.php b/protected/humhub/controllers/ErrorController.php index b3cba0a7d9..47b8eb2dc4 100644 --- a/protected/humhub/controllers/ErrorController.php +++ b/protected/humhub/controllers/ErrorController.php @@ -22,7 +22,6 @@ use humhub\components\Controller; */ class ErrorController extends Controller { - /** * This is the action to handle external exceptions. */ diff --git a/protected/humhub/controllers/HomeController.php b/protected/humhub/controllers/HomeController.php index 90ba3aa459..c1f5219338 100644 --- a/protected/humhub/controllers/HomeController.php +++ b/protected/humhub/controllers/HomeController.php @@ -19,7 +19,6 @@ use humhub\components\Controller; */ class HomeController extends Controller { - /** * Redirects to the home controller/action * diff --git a/protected/humhub/controllers/OembedController.php b/protected/humhub/controllers/OembedController.php index 7a9b32157f..ff097214c4 100644 --- a/protected/humhub/controllers/OembedController.php +++ b/protected/humhub/controllers/OembedController.php @@ -8,7 +8,6 @@ namespace humhub\controllers; - use humhub\components\Controller; use humhub\models\UrlOembed; use Yii; diff --git a/protected/humhub/events/ActiveQueryEvent.php b/protected/humhub/events/ActiveQueryEvent.php index 7afd8cbf67..7dcb427d9f 100644 --- a/protected/humhub/events/ActiveQueryEvent.php +++ b/protected/humhub/events/ActiveQueryEvent.php @@ -13,13 +13,12 @@ use yii\db\ActiveQuery; /** * ActiveQueryEvent represents the parameter needed by [[ActiveQuery]] events. - * + * * @since 1.2.3 * @author Luke */ class ActiveQueryEvent extends Event { - /** * @var ActiveQuery the active query */ diff --git a/protected/humhub/events/OembedFetchEvent.php b/protected/humhub/events/OembedFetchEvent.php index 26b4fd2e37..5374190225 100644 --- a/protected/humhub/events/OembedFetchEvent.php +++ b/protected/humhub/events/OembedFetchEvent.php @@ -33,7 +33,7 @@ class OembedFetchEvent extends Event $urlOembed = UrlOembed::findOne(['url' => $this->url]); if ($urlOembed !== null) { $this->result = trim(preg_replace('/\s+/', ' ', $urlOembed->preview)); - } else if ($this->providers) { + } elseif ($this->providers) { $this->result = trim(preg_replace('/\s+/', ' ', UrlOembed::loadUrl($this->url, $this->getProviderUrl()))); } } diff --git a/protected/humhub/interfaces/ArchiveableInterface.php b/protected/humhub/interfaces/ArchiveableInterface.php index 9f06fb1132..c7fb069fa6 100644 --- a/protected/humhub/interfaces/ArchiveableInterface.php +++ b/protected/humhub/interfaces/ArchiveableInterface.php @@ -19,7 +19,7 @@ interface ArchiveableInterface /** * Checks if the given user can edit/create this element. * - * @param User|integer|string|null $user user instance or user id + * @param User|int|string|null $user user instance or user id * @return bool */ public function canArchive($user = null): bool; diff --git a/protected/humhub/interfaces/DeletableInterface.php b/protected/humhub/interfaces/DeletableInterface.php index 5488e54e39..d7d2e86960 100644 --- a/protected/humhub/interfaces/DeletableInterface.php +++ b/protected/humhub/interfaces/DeletableInterface.php @@ -19,7 +19,7 @@ interface DeletableInterface /** * Checks if given item can be deleted. * - * @param User|integer|string|null $user user instance or user id + * @param User|int|string|null $user user instance or user id * @return bool */ public function canDelete($user = null): bool; diff --git a/protected/humhub/interfaces/EditableInterface.php b/protected/humhub/interfaces/EditableInterface.php index 4bc73e708a..98643c75fa 100644 --- a/protected/humhub/interfaces/EditableInterface.php +++ b/protected/humhub/interfaces/EditableInterface.php @@ -16,11 +16,10 @@ use humhub\modules\user\models\User; */ interface EditableInterface { - /** * Checks if the given user can edit/create this element. * - * @param User|integer|string|null $user user instance or user id + * @param User|int|string|null $user user instance or user id * @return bool */ public function canEdit($user = null): bool; diff --git a/protected/humhub/interfaces/ViewableInterface.php b/protected/humhub/interfaces/ViewableInterface.php index 8386da607b..b46249c54b 100644 --- a/protected/humhub/interfaces/ViewableInterface.php +++ b/protected/humhub/interfaces/ViewableInterface.php @@ -19,7 +19,7 @@ interface ViewableInterface /** * Checks if user can view this element. * - * @param User|integer|string|null $user User instance or user id, null - current user + * @param User|int|string|null $user User instance or user id, null - current user * @return bool */ public function canView($user = null): bool; diff --git a/protected/humhub/libs/ActionColumn.php b/protected/humhub/libs/ActionColumn.php index 8dc24891ee..8da76ecfb3 100644 --- a/protected/humhub/libs/ActionColumn.php +++ b/protected/humhub/libs/ActionColumn.php @@ -20,7 +20,6 @@ use humhub\libs\Html; */ class ActionColumn extends Column { - /** * @var string the ID attribute of the model, to generate action URLs. */ diff --git a/protected/humhub/libs/BasePermission.php b/protected/humhub/libs/BasePermission.php index f9ad7420e5..f6092a739d 100644 --- a/protected/humhub/libs/BasePermission.php +++ b/protected/humhub/libs/BasePermission.php @@ -26,14 +26,14 @@ class BasePermission extends BaseObject /** * @event Event an event that is triggered when the permission is initialized via [[init()]]. */ - const EVENT_INIT = 'init'; + public const EVENT_INIT = 'init'; /** * Permission States */ - const STATE_DEFAULT = ''; - const STATE_ALLOW = 1; - const STATE_DENY = 0; + public const STATE_DEFAULT = ''; + public const STATE_ALLOW = 1; + public const STATE_DENY = 0; /** * @var string id of the permission (default is classname) @@ -220,7 +220,7 @@ class BasePermission extends BaseObject /** * Checks if permission state can be changed * - * @return boolean + * @return bool */ public function canChangeState($groupId) { @@ -230,7 +230,7 @@ class BasePermission extends BaseObject /** * Checks the given id belongs to this permission * - * @return boolean + * @return bool */ public function hasId($id) { diff --git a/protected/humhub/libs/CURLHelper.php b/protected/humhub/libs/CURLHelper.php index da63cd5167..c8835c2cde 100644 --- a/protected/humhub/libs/CURLHelper.php +++ b/protected/humhub/libs/CURLHelper.php @@ -17,7 +17,6 @@ use Yii; */ class CURLHelper { - /** * Returns CURL Default Options * diff --git a/protected/humhub/libs/DateHelper.php b/protected/humhub/libs/DateHelper.php index a13b86dc73..1f155f9650 100644 --- a/protected/humhub/libs/DateHelper.php +++ b/protected/humhub/libs/DateHelper.php @@ -19,10 +19,10 @@ use Yii; */ class DateHelper { - const DB_DATE_FORMAT = 'Y-m-d H:i:s'; - const DB_DATE_FORMAT_PHP = 'php:Y-m-d H:i:s'; - const REGEX_DBFORMAT_DATE = '/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/'; - const REGEX_DBFORMAT_DATETIME = '/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (\d{2}):(\d{2}):(\d{2})$/'; + public const DB_DATE_FORMAT = 'Y-m-d H:i:s'; + public const DB_DATE_FORMAT_PHP = 'php:Y-m-d H:i:s'; + public const REGEX_DBFORMAT_DATE = '/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/'; + public const REGEX_DBFORMAT_DATETIME = '/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (\d{2}):(\d{2}):(\d{2})$/'; /** * Returns the user timeZone or app timezone as fallback. @@ -61,12 +61,12 @@ class DateHelper * * @param string $value the date value * @param bool $dateOnly - * @return boolean + * @return bool * @since v1.4 */ public static function isInDbFormat($value, $dateOnly = false) { - return (boolean) ($dateOnly ? preg_match(self::REGEX_DBFORMAT_DATE, $value) : preg_match(self::REGEX_DBFORMAT_DATETIME, $value)); + return (bool) ($dateOnly ? preg_match(self::REGEX_DBFORMAT_DATE, $value) : preg_match(self::REGEX_DBFORMAT_DATETIME, $value)); } /** diff --git a/protected/humhub/libs/DateTimeHelper.php b/protected/humhub/libs/DateTimeHelper.php index cc1d84c3cd..3cc2023f53 100644 --- a/protected/humhub/libs/DateTimeHelper.php +++ b/protected/humhub/libs/DateTimeHelper.php @@ -18,10 +18,9 @@ use Yii; */ class DateTimeHelper { - /** * Rounds given DateTime object to the next full hour - * + * * @param DateTime $dateTime * @return DateTime */ @@ -49,7 +48,7 @@ class DateTimeHelper /** * Converts two given DateTime instances or strings into a DateInterval - * + * * @param DateTime|string|null $startDateTime the start date or null for current date time * @param DateTime $endDateTime the end date time * @return \DateInterval @@ -57,7 +56,7 @@ class DateTimeHelper public static function getDateInterval($startDateTime = null, $endDateTime) { if ($startDateTime === null) { - $startDateTime = new DateTime; + $startDateTime = new DateTime(); } if (is_string($startDateTime)) { @@ -73,7 +72,7 @@ class DateTimeHelper /** * Converts a DateInterval object into seconds - * + * * @param \DateInterval $interval * @return int the seconds */ diff --git a/protected/humhub/libs/DbDateValidator.php b/protected/humhub/libs/DbDateValidator.php index 20f5145721..63ac21f377 100644 --- a/protected/humhub/libs/DbDateValidator.php +++ b/protected/humhub/libs/DbDateValidator.php @@ -19,12 +19,11 @@ use yii\validators\DateValidator; */ class DbDateValidator extends DateValidator { - /** * Database Field - Validators */ - const REGEX_DBFORMAT_DATE = '/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/'; - const REGEX_DBFORMAT_DATETIME = '/^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/'; + public const REGEX_DBFORMAT_DATE = '/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/'; + public const REGEX_DBFORMAT_DATETIME = '/^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/'; /** * @var string the format the value should converted to (database datetime or date format) @@ -121,7 +120,7 @@ class DbDateValidator extends DateValidator /** * Checks a time attribute name is given, if empty don't handle time * - * @return boolean + * @return bool */ protected function hasTime() { diff --git a/protected/humhub/libs/DropDownGridColumn.php b/protected/humhub/libs/DropDownGridColumn.php index 71b5136ed8..f8bee9feff 100644 --- a/protected/humhub/libs/DropDownGridColumn.php +++ b/protected/humhub/libs/DropDownGridColumn.php @@ -19,7 +19,6 @@ use yii\web\JsExpression; */ class DropDownGridColumn extends DataColumn { - /** * @var array list of attributes which should be aditionally submitted (e.g. id) */ diff --git a/protected/humhub/libs/DynamicConfig.php b/protected/humhub/libs/DynamicConfig.php index 5f74bcbd20..67542cbb32 100644 --- a/protected/humhub/libs/DynamicConfig.php +++ b/protected/humhub/libs/DynamicConfig.php @@ -20,7 +20,6 @@ use yii\helpers\ArrayHelper; */ class DynamicConfig extends BaseObject { - /** * Add an array to the dynamic configuration * diff --git a/protected/humhub/libs/EmojiMap.php b/protected/humhub/libs/EmojiMap.php index 448a79bcfc..2562c7297d 100644 --- a/protected/humhub/libs/EmojiMap.php +++ b/protected/humhub/libs/EmojiMap.php @@ -1,13 +1,11 @@ '😀', 'smiley' => '😃', 'smile' => '😄', diff --git a/protected/humhub/libs/Helpers.php b/protected/humhub/libs/Helpers.php index f623900021..aa9dcc3bf2 100644 --- a/protected/humhub/libs/Helpers.php +++ b/protected/humhub/libs/Helpers.php @@ -81,7 +81,7 @@ class Helpers * Shorten a text string * * @param string $text - Text string you will shorten - * @param integer $length - Count of characters to show + * @param int $length - Count of characters to show * * @return string */ @@ -129,8 +129,8 @@ class Helpers * @deprecated since 1.11 Use mb_substr() instead. * * @param string $str - * @param integer $from - * @param integer $len + * @param int $from + * @param int $len * * @return string */ @@ -189,8 +189,10 @@ class Helpers switch ($last) { case 'g': $val *= 1024; + // no break case 'm': $val *= 1024; + // no break case 'k': $val *= 1024; } diff --git a/protected/humhub/libs/Html.php b/protected/humhub/libs/Html.php index aa98756b18..2fb91a3c95 100644 --- a/protected/humhub/libs/Html.php +++ b/protected/humhub/libs/Html.php @@ -116,7 +116,7 @@ class Html extends \yii\bootstrap\Html } if (!isset($options['showIcon']) || $options['showIcon'] === true) { - $label = Icon::get('back')->asString().' '. $label; + $label = Icon::get('back')->asString() . ' ' . $label; } if (empty($url)) { diff --git a/protected/humhub/libs/I18NHelper.php b/protected/humhub/libs/I18NHelper.php index dba1c563a2..42914bd574 100644 --- a/protected/humhub/libs/I18NHelper.php +++ b/protected/humhub/libs/I18NHelper.php @@ -1,6 +1,5 @@ $width]); - return Html::img($this->getUrl(),$cfg); + return Html::img($this->getUrl(), $cfg); } } diff --git a/protected/humhub/libs/ProfileImage.php b/protected/humhub/libs/ProfileImage.php index f2b8847452..a7374b5f27 100644 --- a/protected/humhub/libs/ProfileImage.php +++ b/protected/humhub/libs/ProfileImage.php @@ -39,7 +39,6 @@ use yii\web\UploadedFile; */ class ProfileImage { - /** * @var String is the guid of user or space */ @@ -93,7 +92,7 @@ class ProfileImage * Returns the URl of the Modified Profile Image * * @param String $prefix Prefix of the returned image - * @param boolean $scheme URL Scheme + * @param bool $scheme URL Scheme * @return String Url of the profile image * @throws \yii\base\InvalidConfigException * @throws \yii\base\Exception @@ -151,7 +150,7 @@ class ProfileImage * @param Int $y * @param Int $h * @param Int $w - * @return boolean indicates the success + * @return bool indicates the success * @throws \yii\base\Exception */ public function cropOriginal($x, $y, $h, $w) diff --git a/protected/humhub/libs/RestrictedCallException.php b/protected/humhub/libs/RestrictedCallException.php index dffdf0db3b..471ba112e8 100644 --- a/protected/humhub/libs/RestrictedCallException.php +++ b/protected/humhub/libs/RestrictedCallException.php @@ -1,6 +1,5 @@ $title, 'state' => 'WARNING', - 'hint' => Yii::t('AdminModule.information', 'Database connection time: {dbTime} - Configured time zone: {time}', + 'hint' => Yii::t( + 'AdminModule.information', + 'Database connection time: {dbTime} - Configured time zone: {time}', [ 'dbTime' => Yii::$app->formatter->asTime($dbConnectionTime, 'short'), 'time' => Yii::$app->formatter->asTime(time(), 'short'), @@ -451,9 +453,10 @@ class SelfTest $sslPort = 443; $httpPort = 80; $scheme = $_SERVER['REQUEST_SCHEME'] ?? ( - isset($_SERVER['HTTPS']) + isset($_SERVER['HTTPS']) ? ($_SERVER['HTTPS'] === 'on' || $_SERVER['HTTPS'] === 1 || $_SERVER['SERVER_PORT'] == $sslPort ? 'https' : 'http') - : ($_SERVER['SERVER_PORT'] == $sslPort ? 'https' : 'http')); + : ($_SERVER['SERVER_PORT'] == $sslPort ? 'https' : 'http') + ); $currentBaseUrl = $scheme . '://' . $_SERVER['HTTP_HOST'] . (($scheme === 'https' && $_SERVER['SERVER_PORT'] == $sslPort) || ($scheme === 'http' && $_SERVER['SERVER_PORT'] == $httpPort) ? '' : ':' . $_SERVER['SERVER_PORT']) @@ -467,7 +470,9 @@ class SelfTest $checks[] = [ 'title' => $title, 'state' => 'WARNING', - 'hint' => Yii::t('AdminModule.information', 'Detected URL: {currentBaseUrl}', + 'hint' => Yii::t( + 'AdminModule.information', + 'Detected URL: {currentBaseUrl}', ['currentBaseUrl' => $currentBaseUrl] ), ]; diff --git a/protected/humhub/libs/Sort.php b/protected/humhub/libs/Sort.php index 0034172657..086337707b 100644 --- a/protected/humhub/libs/Sort.php +++ b/protected/humhub/libs/Sort.php @@ -15,7 +15,6 @@ namespace humhub\libs; */ class Sort { - /** * @param array $arr The input array. * @param string $field The attribute or array key to which holds the sort order diff --git a/protected/humhub/libs/StdClassConfig.php b/protected/humhub/libs/StdClassConfig.php index 18f3180b79..80f2db593b 100644 --- a/protected/humhub/libs/StdClassConfig.php +++ b/protected/humhub/libs/StdClassConfig.php @@ -46,7 +46,7 @@ class StdClassConfig extends StdClass */ public $default; -// StdClassConfigurable meta-properties + // StdClassConfigurable meta-properties protected bool $__StdClassConfigurable_isFixed = false; @@ -55,7 +55,7 @@ class StdClassConfig extends StdClass */ protected bool $__StdClassConfigurable_loading = true; -// StdClassConfig meta-properties + // StdClassConfig meta-properties /** * @var bool Denotes if dynamic properties can be added (false) or the set of properties is fix. @@ -280,8 +280,11 @@ class StdClassConfig extends StdClass $parent = $trace[$i]['object'] ?? null; if (!$parent instanceof StdClassConfigurable) { - throw new RuntimeException(sprintf('Method %s can only be called from a %s instance itself', __METHOD__, - StdClassConfigurable::class)); + throw new RuntimeException(sprintf( + 'Method %s can only be called from a %s instance itself', + __METHOD__, + StdClassConfigurable::class + )); } try { diff --git a/protected/humhub/libs/StringHelper.php b/protected/humhub/libs/StringHelper.php index 5176a3443a..922a0e02dc 100644 --- a/protected/humhub/libs/StringHelper.php +++ b/protected/humhub/libs/StringHelper.php @@ -97,13 +97,13 @@ class StringHelper extends \yii\helpers\StringHelper } - /** - * @param mixed $string String to test, and if $convert is true, to turn into string - * @param bool $convert - * - * @return bool - * @since 1.15 - */ + /** + * @param mixed $string String to test, and if $convert is true, to turn into string + * @param bool $convert + * + * @return bool + * @since 1.15 + */ public static function isStringable(&$string, bool $convert = true): bool { $result = static::toString($string, $type); diff --git a/protected/humhub/libs/ThemeHelper.php b/protected/humhub/libs/ThemeHelper.php index 8d8e4d2c22..9f33d63b72 100644 --- a/protected/humhub/libs/ThemeHelper.php +++ b/protected/humhub/libs/ThemeHelper.php @@ -8,7 +8,6 @@ namespace humhub\libs; - /** * ThemeHelper * diff --git a/protected/humhub/libs/TimezoneHelper.php b/protected/humhub/libs/TimezoneHelper.php index 4b7f86c1c2..b8b5c62ab3 100644 --- a/protected/humhub/libs/TimezoneHelper.php +++ b/protected/humhub/libs/TimezoneHelper.php @@ -20,7 +20,6 @@ use yii\db\Exception; */ class TimezoneHelper { - /** * * // Modified version of the timezone list function from http://stackoverflow.com/a/17355238/507629 @@ -58,7 +57,7 @@ class TimezoneHelper $timezone_offsets = []; foreach ($timezones as $timezone) { $tz = new DateTimeZone($timezone); - $timezone_offsets[$timezone] = $tz->getOffset(new DateTime); + $timezone_offsets[$timezone] = $tz->getOffset(new DateTime()); } // sort timezone by timezone name diff --git a/protected/humhub/libs/UUID.php b/protected/humhub/libs/UUID.php index b7251db991..292ff017f9 100644 --- a/protected/humhub/libs/UUID.php +++ b/protected/humhub/libs/UUID.php @@ -100,7 +100,7 @@ class UUID break; default: - return null; + return null; } $uuid = trim($uuid); @@ -128,11 +128,11 @@ class UUID switch (true) { case $withDash === true: $dash = '-'; - break; + break; case $withDash === false: $dash = ''; - break; + break; default: // use as in string diff --git a/protected/humhub/libs/UrlOembedHttpClient.php b/protected/humhub/libs/UrlOembedHttpClient.php index 2076087d26..0faaec42ed 100644 --- a/protected/humhub/libs/UrlOembedHttpClient.php +++ b/protected/humhub/libs/UrlOembedHttpClient.php @@ -7,11 +7,11 @@ use yii\helpers\Json; class UrlOembedHttpClient implements UrlOembedClient { - const RESPONSE_UNAUTHORIZED = 'Unauthorized'; + public const RESPONSE_UNAUTHORIZED = 'Unauthorized'; - const RESPONSE_NOT_FOUND = 'Not Found'; + public const RESPONSE_NOT_FOUND = 'Not Found'; - const ERROR_RESPONSES = [ + public const ERROR_RESPONSES = [ self::RESPONSE_NOT_FOUND, self::RESPONSE_UNAUTHORIZED ]; diff --git a/protected/humhub/libs/WidgetCreateEvent.php b/protected/humhub/libs/WidgetCreateEvent.php index 2bb9a79774..3eb784d0e8 100644 --- a/protected/humhub/libs/WidgetCreateEvent.php +++ b/protected/humhub/libs/WidgetCreateEvent.php @@ -18,7 +18,6 @@ use yii\base\Event; */ class WidgetCreateEvent extends Event { - /** * @var array Reference to the config of widget create */ diff --git a/protected/humhub/migrations/m131023_165755_initial.php b/protected/humhub/migrations/m131023_165755_initial.php index 2495ece536..d5421da770 100644 --- a/protected/humhub/migrations/m131023_165755_initial.php +++ b/protected/humhub/migrations/m131023_165755_initial.php @@ -5,7 +5,6 @@ use yii\db\Migration; class m131023_165755_initial extends Migration { - public function up() { diff --git a/protected/humhub/migrations/m131203_110444_oembed.php b/protected/humhub/migrations/m131203_110444_oembed.php index 396f1af0c6..a1902e6679 100644 --- a/protected/humhub/migrations/m131203_110444_oembed.php +++ b/protected/humhub/migrations/m131203_110444_oembed.php @@ -5,7 +5,6 @@ use yii\db\Migration; class m131203_110444_oembed extends Migration { - public function up() { $this->createTable('url_oembed', [ diff --git a/protected/humhub/migrations/m140226_111945_ldap.php b/protected/humhub/migrations/m140226_111945_ldap.php index 90336c0642..fe9fab1e35 100644 --- a/protected/humhub/migrations/m140226_111945_ldap.php +++ b/protected/humhub/migrations/m140226_111945_ldap.php @@ -5,7 +5,6 @@ use yii\db\Migration; class m140226_111945_ldap extends Migration { - public function up() { $this->addColumn('profile_field', 'ldap_attribute', 'string'); diff --git a/protected/humhub/migrations/m140321_000917_content.php b/protected/humhub/migrations/m140321_000917_content.php index c7010090b3..c1b094e462 100644 --- a/protected/humhub/migrations/m140321_000917_content.php +++ b/protected/humhub/migrations/m140321_000917_content.php @@ -5,7 +5,6 @@ use yii\db\Migration; class m140321_000917_content extends Migration { - public function up() { // Fix: empty user_id in content table diff --git a/protected/humhub/migrations/m140830_145504_following.php b/protected/humhub/migrations/m140830_145504_following.php index 2d26da85e2..a45ec3aa24 100644 --- a/protected/humhub/migrations/m140830_145504_following.php +++ b/protected/humhub/migrations/m140830_145504_following.php @@ -5,7 +5,6 @@ use yii\db\Migration; class m140830_145504_following extends Migration { - public function up() { diff --git a/protected/humhub/migrations/m141015_173305_follow_notifications.php b/protected/humhub/migrations/m141015_173305_follow_notifications.php index 9f9d846afd..28ecb3d75d 100644 --- a/protected/humhub/migrations/m141015_173305_follow_notifications.php +++ b/protected/humhub/migrations/m141015_173305_follow_notifications.php @@ -5,7 +5,6 @@ use yii\db\Migration; class m141015_173305_follow_notifications extends Migration { - public function up() { $this->renameTable('follow', 'user_follow'); diff --git a/protected/humhub/migrations/m141020_162639_fix_default.php b/protected/humhub/migrations/m141020_162639_fix_default.php index 632517ac33..e0eb59db40 100644 --- a/protected/humhub/migrations/m141020_162639_fix_default.php +++ b/protected/humhub/migrations/m141020_162639_fix_default.php @@ -5,7 +5,6 @@ use yii\db\Migration; class m141020_162639_fix_default extends Migration { - public function up() { diff --git a/protected/humhub/migrations/m141021_162639_oembed_setting.php b/protected/humhub/migrations/m141021_162639_oembed_setting.php index 6b09a750e0..53586ef3bc 100644 --- a/protected/humhub/migrations/m141021_162639_oembed_setting.php +++ b/protected/humhub/migrations/m141021_162639_oembed_setting.php @@ -6,7 +6,6 @@ use yii\helpers\Json; class m141021_162639_oembed_setting extends Migration { - public function up() { $this->insert('setting', [ diff --git a/protected/humhub/migrations/m150928_140718_setColorVariables.php b/protected/humhub/migrations/m150928_140718_setColorVariables.php index be70a51ee9..fd90aed1cf 100644 --- a/protected/humhub/migrations/m150928_140718_setColorVariables.php +++ b/protected/humhub/migrations/m150928_140718_setColorVariables.php @@ -2,7 +2,6 @@ use yii\db\Migration; - class m150928_140718_setColorVariables extends Migration { public function up() diff --git a/protected/humhub/migrations/m160508_005740_settings_cleanup.php b/protected/humhub/migrations/m160508_005740_settings_cleanup.php index 7aa3eccf59..eb8f419ec4 100644 --- a/protected/humhub/migrations/m160508_005740_settings_cleanup.php +++ b/protected/humhub/migrations/m160508_005740_settings_cleanup.php @@ -5,7 +5,6 @@ use yii\db\Expression; class m160508_005740_settings_cleanup extends Migration { - public function up() { $this->dropColumn('setting', 'created_at'); diff --git a/protected/humhub/migrations/m171015_155102_contentcontainer_module.php b/protected/humhub/migrations/m171015_155102_contentcontainer_module.php index 99840f029a..34dec89544 100644 --- a/protected/humhub/migrations/m171015_155102_contentcontainer_module.php +++ b/protected/humhub/migrations/m171015_155102_contentcontainer_module.php @@ -4,7 +4,6 @@ use yii\db\Migration; class m171015_155102_contentcontainer_module extends Migration { - public function safeUp() { $this->createTable('contentcontainer_module', [ diff --git a/protected/humhub/migrations/m181029_160453_collation.php b/protected/humhub/migrations/m181029_160453_collation.php index 26e18cef56..e6dc694a2e 100644 --- a/protected/humhub/migrations/m181029_160453_collation.php +++ b/protected/humhub/migrations/m181029_160453_collation.php @@ -38,7 +38,7 @@ class m181029_160453_collation extends Migration protected function migrateTable($dbName, $tableName) { #print 'Migrate table ' . $tableName . " to collation: utf8mb4\n"; - + try { $this->db->createCommand('ALTER TABLE `' . $tableName . '` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci')->execute(); } catch (\Exception $e) { diff --git a/protected/humhub/models/ModuleEnabled.php b/protected/humhub/models/ModuleEnabled.php index 39fb034f44..39e97a768d 100644 --- a/protected/humhub/models/ModuleEnabled.php +++ b/protected/humhub/models/ModuleEnabled.php @@ -17,8 +17,7 @@ use Yii; */ class ModuleEnabled extends \yii\db\ActiveRecord { - - const CACHE_ID_ALL_IDS = 'enabledModuleIds'; + public const CACHE_ID_ALL_IDS = 'enabledModuleIds'; /** * @inheritdoc diff --git a/protected/humhub/models/Setting.php b/protected/humhub/models/Setting.php index 35b27dd530..ef5f81c508 100644 --- a/protected/humhub/models/Setting.php +++ b/protected/humhub/models/Setting.php @@ -16,7 +16,7 @@ use yii\base\Exception; /** * This is the model class for table "setting". * - * @property integer $id + * @property int $id * @property string $name * @property string $value * @property string $module_id @@ -67,7 +67,7 @@ class Setting extends SettingActiveRecord */ public static function get($name, $moduleId = '') { - list ($name, $moduleId) = self::fixModuleIdAndName($name, $moduleId); + list($name, $moduleId) = self::fixModuleIdAndName($name, $moduleId); return self::getModule($moduleId)->settings->get($name); } @@ -82,7 +82,7 @@ class Setting extends SettingActiveRecord */ public static function set($name, $value, $moduleId = '') { - list ($name, $moduleId) = self::fixModuleIdAndName($name, $moduleId); + list($name, $moduleId) = self::fixModuleIdAndName($name, $moduleId); return self::getModule($moduleId)->settings->set($name, $value); } @@ -111,7 +111,7 @@ class Setting extends SettingActiveRecord * @param string $name * @param string $moduleId * - * @return boolean + * @return bool */ public static function isFixed($name, $moduleId = '') { @@ -121,7 +121,7 @@ class Setting extends SettingActiveRecord /** * Checks if Humhub is installed * - * @return boolean + * @return bool * @deprecated since v1.16; use Yii::$app->isInstalled() * @see Yii::$app->isInstalled() */ diff --git a/protected/humhub/models/UrlOembed.php b/protected/humhub/models/UrlOembed.php index 0fc13aec48..4ed4b781aa 100644 --- a/protected/humhub/models/UrlOembed.php +++ b/protected/humhub/models/UrlOembed.php @@ -41,7 +41,7 @@ class UrlOembed extends ActiveRecord * @event * @since 1.4 */ - const EVENT_FETCH = 'fetch'; + public const EVENT_FETCH = 'fetch'; /** * @var int Maximum amount of remote fetch calls per request @@ -348,7 +348,7 @@ class UrlOembed extends ActiveRecord * Checks if a given URL Supports OEmbed * * @param string $url - * @return boolean + * @return bool */ public static function hasOEmbedSupport(string $url): bool { @@ -474,7 +474,7 @@ class UrlOembed extends ActiveRecord return true; } - if (preg_match('#^(https?:)?//#i',$url)) { + if (preg_match('#^(https?:)?//#i', $url)) { $url = parse_url($url); if (!isset($url['host'])) { return false; diff --git a/protected/humhub/models/forms/ChooseLanguage.php b/protected/humhub/models/forms/ChooseLanguage.php index 26e2f97c3c..ada0a451c4 100644 --- a/protected/humhub/models/forms/ChooseLanguage.php +++ b/protected/humhub/models/forms/ChooseLanguage.php @@ -17,7 +17,6 @@ use yii\base\Model; */ class ChooseLanguage extends Model { - /** * @var string the language */ @@ -47,7 +46,7 @@ class ChooseLanguage extends Model * Stores language as cookie * * @since 1.2 - * @return boolean + * @return bool */ public function save() { diff --git a/protected/humhub/models/forms/CropProfileImage.php b/protected/humhub/models/forms/CropProfileImage.php index dbb902c86c..a53c1306dc 100644 --- a/protected/humhub/models/forms/CropProfileImage.php +++ b/protected/humhub/models/forms/CropProfileImage.php @@ -21,7 +21,6 @@ use yii\web\JsExpression; */ class CropProfileImage extends Model { - /** * @var Int X Coordinates of the area */ @@ -77,7 +76,7 @@ class CropProfileImage extends Model public $boxWidth = '440'; /** - * @var boolean + * @var bool */ public $keySupport = true; diff --git a/protected/humhub/models/forms/UploadProfileImage.php b/protected/humhub/models/forms/UploadProfileImage.php index 30fe50497c..137702f338 100644 --- a/protected/humhub/models/forms/UploadProfileImage.php +++ b/protected/humhub/models/forms/UploadProfileImage.php @@ -21,7 +21,6 @@ use yii\base\Model; */ class UploadProfileImage extends Model { - /** * @var String uploaded image */ diff --git a/protected/humhub/tests/c3.php b/protected/humhub/tests/c3.php index 9b9b65e7d3..332df3bb2d 100644 --- a/protected/humhub/tests/c3.php +++ b/protected/humhub/tests/c3.php @@ -1,4 +1,5 @@ amOnRoute($params); } - public function dontSeeInDropDown($selector, $text) { + public function dontSeeInDropDown($selector, $text) + { $this->click($selector); $this->wait(1); $this->dontSee($text, $selector); $this->click($selector); } - public function seeInDropDown($selector, $text) { + public function seeInDropDown($selector, $text) + { $this->click($selector); $this->wait(1); $this->see($text, $selector); $this->click($selector); } - public function allowGuestAccess() { + public function allowGuestAccess() + { $this->amOnRoute(['/admin/authentication']); $this->jsClick('#authenticationsettingsform-allowguestaccess'); $this->click('button.btn-primary', '#authentication-settings-form'); @@ -119,7 +122,8 @@ class AcceptanceTester extends BaseTester $this->guestAccessAllowed = true; } - public function amOnRoute($route) { + public function amOnRoute($route) + { $this->amOnPage(Url::to($route)); } @@ -135,7 +139,7 @@ class AcceptanceTester extends BaseTester foreach ($topics as $topic) { $this->fillField('#topic-name', $topic); $this->click('.input-group-btn .btn-default'); - $this->waitForText($topic, null,'.layout-content-container .table-hover'); + $this->waitForText($topic, null, '.layout-content-container .table-hover'); } } @@ -253,9 +257,9 @@ class AcceptanceTester extends BaseTester public function enableModule($guid, $moduleId) { $this->amOnSpace($guid, '/space/manage/module'); - $this->seeElement('.enable-module-'.$moduleId); - $this->jsClick('.enable-module-'.$moduleId); - $this->waitForElement('.disable-module-'.$moduleId); + $this->seeElement('.enable-module-' . $moduleId); + $this->jsClick('.enable-module-' . $moduleId); + $this->waitForElement('.disable-module-' . $moduleId); $this->amOnSpace($guid); } @@ -298,7 +302,7 @@ class AcceptanceTester extends BaseTester $this->waitForText($text, 5, '.notifications'); if($click) { - $this->click($text,'.notifications'); + $this->click($text, '.notifications'); $this->wait(2); } else { $this->click('.notifications .fa-bell'); diff --git a/protected/humhub/tests/codeception/_support/BaseTester.php b/protected/humhub/tests/codeception/_support/BaseTester.php index 7e5a2ddaa9..82c830f08a 100644 --- a/protected/humhub/tests/codeception/_support/BaseTester.php +++ b/protected/humhub/tests/codeception/_support/BaseTester.php @@ -17,7 +17,7 @@ class BaseTester extends \Codeception\Actor */ private $spaces; - public function getFixtureSpace(int $index) : ?Space + public function getFixtureSpace(int $index): ?Space { if (isset($this->spaces[$index])) { return $this->spaces[$index]; @@ -29,7 +29,7 @@ class BaseTester extends \Codeception\Actor $this->haveFixtures(['space' => SpaceFixture::class]); } $this->spaces[$index] = $this->grabFixture('space', $index); - } else if (!isset($this->spaces)) { + } elseif (!isset($this->spaces)) { // Acceptance tests have no the methods above, try to get spaces from DB instead: $this->spaces = Space::find()->orderBy('id')->all(); if (!isset($this->spaces[$index])) { @@ -40,7 +40,7 @@ class BaseTester extends \Codeception\Actor return $this->spaces[$index]; } - public function getFixtureSpaceGuid(int $index) : string + public function getFixtureSpaceGuid(int $index): string { $space = $this->getFixtureSpace($index); return ($space instanceof Space ? $space->guid : ''); diff --git a/protected/humhub/tests/codeception/_support/CodeHelper.php b/protected/humhub/tests/codeception/_support/CodeHelper.php index 7922fc30a0..49acaeef02 100644 --- a/protected/humhub/tests/codeception/_support/CodeHelper.php +++ b/protected/humhub/tests/codeception/_support/CodeHelper.php @@ -12,7 +12,6 @@ use Codeception\Module; */ class CodeHelper extends Module { - /** * Method called before any suite tests run. Loads User fixture login user * to use in acceptance and functional tests. @@ -36,7 +35,7 @@ class CodeHelper extends Module } $this->assertTrue($result); } - + public function assertNotContainsError($model, $message) { $result = false; diff --git a/protected/humhub/tests/codeception/_support/DynamicFixtureHelper.php b/protected/humhub/tests/codeception/_support/DynamicFixtureHelper.php index 7a66c64c63..0e341e2568 100644 --- a/protected/humhub/tests/codeception/_support/DynamicFixtureHelper.php +++ b/protected/humhub/tests/codeception/_support/DynamicFixtureHelper.php @@ -29,9 +29,6 @@ use yii\test\InitDbFixture; */ class DynamicFixtureHelper extends Module { - - public $beforeTest = true; - /** * Redeclare visibility because codeception includes all public methods that do not start with "_" * and are not excluded by module settings, in actor class. @@ -46,6 +43,8 @@ class DynamicFixtureHelper extends Module getFixture as protected; } + public $beforeTest = true; + public function _beforeSuite($settings = []) { @@ -57,7 +56,7 @@ class DynamicFixtureHelper extends Module } } - public function _afterSuite($settings = []) + public function _afterSuite($settings = []) { if (!$this->beforeTest) { $this->unloadFixtures(); diff --git a/protected/humhub/tests/codeception/_support/FixtureHelper.php b/protected/humhub/tests/codeception/_support/FixtureHelper.php index 41882574a0..2d2bf89e32 100644 --- a/protected/humhub/tests/codeception/_support/FixtureHelper.php +++ b/protected/humhub/tests/codeception/_support/FixtureHelper.php @@ -16,7 +16,6 @@ use yii\test\InitDbFixture; */ class FixtureHelper extends Module { - /** * Redeclare visibility because codeception includes all public methods that do not start with "_" * and are not excluded by module settings, in actor class. @@ -39,7 +38,7 @@ class FixtureHelper extends Module public function _beforeSuite($settings = []) { //Prevents [ReflectionException] Class db does not exist for included module tests - include __DIR__.'/../functional/_bootstrap.php'; + include __DIR__ . '/../functional/_bootstrap.php'; $this->unloadFixtures(); $this->loadFixtures(); } diff --git a/protected/humhub/tests/codeception/_support/FunctionalTester.php b/protected/humhub/tests/codeception/_support/FunctionalTester.php index 325aa298ca..9542fcc92d 100644 --- a/protected/humhub/tests/codeception/_support/FunctionalTester.php +++ b/protected/humhub/tests/codeception/_support/FunctionalTester.php @@ -24,7 +24,6 @@ use yii\helpers\Url; */ class FunctionalTester extends BaseTester { - use _generated\FunctionalTesterActions; public function amAdmin($logout = false) @@ -248,9 +247,9 @@ class FunctionalTester extends BaseTester if(is_int($spaceOrIndexOrGuid)) { $guid = $this->getFixtureSpaceGuid(--$spaceOrIndexOrGuid); - } else if(is_string($spaceOrIndexOrGuid)) { + } elseif(is_string($spaceOrIndexOrGuid)) { $guid = $spaceOrIndexOrGuid; - } else if($spaceOrIndexOrGuid instanceof Space) { + } elseif($spaceOrIndexOrGuid instanceof Space) { $guid = $spaceOrIndexOrGuid->guid; } else { $guid = ''; diff --git a/protected/humhub/tests/codeception/_support/HumHubApiTestCest.php b/protected/humhub/tests/codeception/_support/HumHubApiTestCest.php index f9632f70d9..ab1122b804 100644 --- a/protected/humhub/tests/codeception/_support/HumHubApiTestCest.php +++ b/protected/humhub/tests/codeception/_support/HumHubApiTestCest.php @@ -7,7 +7,6 @@ use Yii; class HumHubApiTestCest { - /** * @var string $recordModelClass Class name of the model to find a record */ diff --git a/protected/humhub/tests/codeception/_support/HumHubExtension.php b/protected/humhub/tests/codeception/_support/HumHubExtension.php index 4767edc302..c1a89bd5ba 100644 --- a/protected/humhub/tests/codeception/_support/HumHubExtension.php +++ b/protected/humhub/tests/codeception/_support/HumHubExtension.php @@ -4,6 +4,7 @@ * @copyright Copyright (c) 2017 HumHub GmbH & Co. KG * @license https://www.humhub.com/licences */ + namespace tests\codeception\_support; use Codeception\Events; @@ -17,7 +18,8 @@ class HumHubExtension extends \Codeception\Extension #Events::RESULT_PRINT_AFTER => 'print', ]; - public function moduleInit($test) { + public function moduleInit($test) + { $GLOBALS['env'] = $this->options['env']; } } diff --git a/protected/humhub/tests/codeception/_support/HumHubHelperTrait.php b/protected/humhub/tests/codeception/_support/HumHubHelperTrait.php index 23825009df..8d1ca7d98b 100644 --- a/protected/humhub/tests/codeception/_support/HumHubHelperTrait.php +++ b/protected/humhub/tests/codeception/_support/HumHubHelperTrait.php @@ -576,8 +576,8 @@ trait HumHubHelperTrait $this->expectExceptionMessageRegExp( sprintf( - // Php < 8 uses: "Argument n passed to class::method() ..." - // PHP > 7 uses: "class::method(): Argument #n ($argument) ..." + // Php < 8 uses: "Argument n passed to class::method() ..." + // PHP > 7 uses: "class::method(): Argument #n ($argument) ..." '@^((Argument %d passed to )?%s::%s\\(\\)(?(2)|: Argument #%d \\(\\$%s\\))) must be of( the)? type %s, %s given, called in /.*@', $argumentNumber, $calledClass, diff --git a/protected/humhub/tests/codeception/_support/HumHubTestConfiguration.php b/protected/humhub/tests/codeception/_support/HumHubTestConfiguration.php index f663a75f30..7920e6f464 100644 --- a/protected/humhub/tests/codeception/_support/HumHubTestConfiguration.php +++ b/protected/humhub/tests/codeception/_support/HumHubTestConfiguration.php @@ -16,14 +16,14 @@ use Yii; */ class HumHubTestConfiguration { - /** - * This function is used for retrieving the humhub configuration for - * a given test suite by merging default configuration with the test configuration and - * environment configuration of the user. - * - * @param type $suite - * @return type - */ + /** + * This function is used for retrieving the humhub configuration for + * a given test suite by merging default configuration with the test configuration and + * environment configuration of the user. + * + * @param type $suite + * @return type + */ public static function getSuiteConfig($suite) { $config = self::initConfig($suite); diff --git a/protected/humhub/tests/codeception/_support/TestHelper.php b/protected/humhub/tests/codeception/_support/TestHelper.php index 361a813631..6454fe7c16 100644 --- a/protected/humhub/tests/codeception/_support/TestHelper.php +++ b/protected/humhub/tests/codeception/_support/TestHelper.php @@ -12,7 +12,6 @@ use Codeception\Module; */ class TestHelper extends Module { - /** * Method called before any suite tests run. Loads User fixture login user * to use in acceptance and functional tests. @@ -20,7 +19,7 @@ class TestHelper extends Module */ public function _beforeSuite($settings = []) { - include __DIR__.'/../functional/_bootstrap.php'; + include __DIR__ . '/../functional/_bootstrap.php'; } } diff --git a/protected/humhub/tests/codeception/_support/UnitTester.php b/protected/humhub/tests/codeception/_support/UnitTester.php index 28353572c1..8d3cc473b7 100644 --- a/protected/humhub/tests/codeception/_support/UnitTester.php +++ b/protected/humhub/tests/codeception/_support/UnitTester.php @@ -20,7 +20,7 @@ class UnitTester extends \Codeception\Actor { use _generated\UnitTesterActions; - /** - * Define custom actions here - */ + /** + * Define custom actions here + */ } diff --git a/protected/humhub/tests/codeception/_support/WebHelper.php b/protected/humhub/tests/codeception/_support/WebHelper.php index e86a4956a6..571e040550 100644 --- a/protected/humhub/tests/codeception/_support/WebHelper.php +++ b/protected/humhub/tests/codeception/_support/WebHelper.php @@ -13,7 +13,6 @@ use Yii; */ class WebHelper extends Module { - /** * Method called before any suite tests run. Loads User fixture login user * to use in acceptance and functional tests. @@ -21,7 +20,7 @@ class WebHelper extends Module */ public function _beforeSuite($settings = []) { - include __DIR__.'/../acceptance/_bootstrap.php'; + include __DIR__ . '/../acceptance/_bootstrap.php'; $this->initModules(); } @@ -34,7 +33,8 @@ class WebHelper extends Module * Initializes modules defined in @tests/codeception/config/test.config.php * Note the config key in test.config.php is modules and not humhubModules! */ - protected function initModules() { + protected function initModules() + { $cfg = \Codeception\Configuration::config(); if(!empty($cfg['humhub_modules'])) { Yii::$app->moduleManager->enableModules($cfg['humhub_modules']); diff --git a/protected/humhub/tests/codeception/acceptance/_bootstrap.php b/protected/humhub/tests/codeception/acceptance/_bootstrap.php index 1bbff17135..76a7e23883 100644 --- a/protected/humhub/tests/codeception/acceptance/_bootstrap.php +++ b/protected/humhub/tests/codeception/acceptance/_bootstrap.php @@ -1,3 +1,4 @@ 'HumHub', 'language' => 'en-US', 'timeZone' => 'Europe/Berlin', - 'components' => + 'components' => [ - 'formatter' => + 'formatter' => [ 'defaultTimeZone' => 'Europe/Berlin', ], - 'user' => + 'user' => [ ], - 'mailer' => + 'mailer' => [ 'useFileTransport' => true, ], - 'cache' => + 'cache' => [ 'class' => 'yii\\caching\\DummyCache', 'keyPrefix' => 'humhub', ], ], - 'params' => + 'params' => [ 'config_created_at' => 1509135303, 'horImageScrollOnMobile' => null, ], -]; ?> \ No newline at end of file +]; diff --git a/protected/humhub/tests/codeception/config/functional.php b/protected/humhub/tests/codeception/config/functional.php index bdc0b0a3cf..19828af86d 100644 --- a/protected/humhub/tests/codeception/config/functional.php +++ b/protected/humhub/tests/codeception/config/functional.php @@ -34,12 +34,12 @@ $testConfig = [ defined('YII_APP_BASE_PATH') or define('YII_APP_BASE_PATH', dirname(dirname(dirname(dirname(__DIR__))))); return yii\helpers\ArrayHelper::merge( - // Common Config - require(YII_APP_BASE_PATH . '/humhub/config/common.php'), - // Web Config - require(YII_APP_BASE_PATH . '/humhub/config/web.php'), - // Test Common Config - require(__DIR__ . '/config.php'), - // Functional Test Config - $testConfig + // Common Config + require(YII_APP_BASE_PATH . '/humhub/config/common.php'), + // Web Config + require(YII_APP_BASE_PATH . '/humhub/config/web.php'), + // Test Common Config + require(__DIR__ . '/config.php'), + // Functional Test Config + $testConfig ); diff --git a/protected/humhub/tests/codeception/config/unit.php b/protected/humhub/tests/codeception/config/unit.php index 1cf556a766..a28f6581c0 100644 --- a/protected/humhub/tests/codeception/config/unit.php +++ b/protected/humhub/tests/codeception/config/unit.php @@ -34,7 +34,7 @@ $testConfig = [ defined('YII_APP_BASE_PATH') or define('YII_APP_BASE_PATH', dirname(dirname(dirname(dirname(__DIR__))))); return yii\helpers\ArrayHelper::merge( -// Common Config + // Common Config require(YII_APP_BASE_PATH . '/humhub/config/common.php'), // Web Config require(YII_APP_BASE_PATH . '/humhub/config/web.php'), diff --git a/protected/humhub/tests/codeception/fixtures/ModulesEnabledFixture.php b/protected/humhub/tests/codeception/fixtures/ModulesEnabledFixture.php index b1a5e50f5e..d868bdd7ce 100644 --- a/protected/humhub/tests/codeception/fixtures/ModulesEnabledFixture.php +++ b/protected/humhub/tests/codeception/fixtures/ModulesEnabledFixture.php @@ -13,7 +13,6 @@ use yii\test\ActiveFixture; class ModulesEnabledFixture extends ActiveFixture { - public $modelClass = ModuleEnabled::class; } diff --git a/protected/humhub/tests/codeception/fixtures/SettingFixture.php b/protected/humhub/tests/codeception/fixtures/SettingFixture.php index 2aeed69693..d5a3f0820a 100644 --- a/protected/humhub/tests/codeception/fixtures/SettingFixture.php +++ b/protected/humhub/tests/codeception/fixtures/SettingFixture.php @@ -12,7 +12,6 @@ use yii\test\ActiveFixture; class SettingFixture extends ActiveFixture { - public $modelClass = 'humhub\models\Setting'; } diff --git a/protected/humhub/tests/codeception/fixtures/UrlOembedFixture.php b/protected/humhub/tests/codeception/fixtures/UrlOembedFixture.php index b6a7f20abe..cefa201dab 100644 --- a/protected/humhub/tests/codeception/fixtures/UrlOembedFixture.php +++ b/protected/humhub/tests/codeception/fixtures/UrlOembedFixture.php @@ -14,7 +14,6 @@ use yii\test\ActiveFixture; class UrlOembedFixture extends ActiveFixture { - public $modelClass = UrlOembed::class; } diff --git a/protected/humhub/tests/codeception/fixtures/data/module_enabled.php b/protected/humhub/tests/codeception/fixtures/data/module_enabled.php index 881ab67d03..0b67a5fe47 100644 --- a/protected/humhub/tests/codeception/fixtures/data/module_enabled.php +++ b/protected/humhub/tests/codeception/fixtures/data/module_enabled.php @@ -1,2 +1,3 @@ doEnable = true; static::assertTrue($module->enable()); -// static::assertEquals(ExitCode::OK, $module->migrationResult); -// static::assertNotLog('Module has not been enabled due to beforeEnable() returning false', Logger::LEVEL_WARNING, [$module->id]); -// static::assertLogRegex('@\*\*\* applied m230911_000100_create_test_table \(time: \d+\.\d+s\)@', Logger::LEVEL_INFO, [$module->id]); + // static::assertEquals(ExitCode::OK, $module->migrationResult); + // static::assertNotLog('Module has not been enabled due to beforeEnable() returning false', Logger::LEVEL_WARNING, [$module->id]); + // static::assertLogRegex('@\*\*\* applied m230911_000100_create_test_table \(time: \d+\.\d+s\)@', Logger::LEVEL_INFO, [$module->id]); static::logFlush(); $this->assertEvents([ @@ -717,20 +717,20 @@ class ModuleManagerTest extends HumHubDbTestCase ], ]); -// $module->doDisable = false; -// static::assertNull($module->disable()); -// static::assertNull($module->migrationResult); -// static::assertNull($module->migrationOutput); -// $this->assertEvents(); -// -// static::assertLog('Module has not been disabled due to beforeDisable() returning false', Logger::LEVEL_WARNING, [$module->id]); -// static::logFlush(); + // $module->doDisable = false; + // static::assertNull($module->disable()); + // static::assertNull($module->migrationResult); + // static::assertNull($module->migrationOutput); + // $this->assertEvents(); + // + // static::assertLog('Module has not been disabled due to beforeDisable() returning false', Logger::LEVEL_WARNING, [$module->id]); + // static::logFlush(); $module->doDisable = true; static::assertTrue($module->disable()); -// static::assertEquals(ExitCode::OK, $module->migrationResult); -// static::assertNotLog('Module has not been enabled due to beforeEnable() returning false', Logger::LEVEL_WARNING, [$module->id]); -// static::assertLogRegex('@ > drop table test_module_with_migration \.\.\. done \(time: \d+\.\d+s\)@', Logger::LEVEL_INFO, [$module->id]); + // static::assertEquals(ExitCode::OK, $module->migrationResult); + // static::assertNotLog('Module has not been enabled due to beforeEnable() returning false', Logger::LEVEL_WARNING, [$module->id]); + // static::assertLogRegex('@ > drop table test_module_with_migration \.\.\. done \(time: \d+\.\d+s\)@', Logger::LEVEL_INFO, [$module->id]); static::logFlush(); } @@ -967,7 +967,7 @@ class ModuleManagerTest extends HumHubDbTestCase } static::assertInstanceOf($this->moduleClass, $module = $this->moduleManager->getModule($this->moduleId)); -// $module->setBasePath($basePath); + // $module->setBasePath($basePath); static::assertEquals($isCore, $this->moduleManager->isCoreModule($this->moduleId)); diff --git a/protected/humhub/tests/codeception/unit/components/access/AccessTestPermission1.php b/protected/humhub/tests/codeception/unit/components/access/AccessTestPermission1.php index a9c235f838..c6d05a7025 100644 --- a/protected/humhub/tests/codeception/unit/components/access/AccessTestPermission1.php +++ b/protected/humhub/tests/codeception/unit/components/access/AccessTestPermission1.php @@ -4,6 +4,7 @@ * @copyright Copyright (c) 2017 HumHub GmbH & Co. KG * @license https://www.humhub.com/licences */ + namespace humhub\tests\codeception\unit\components\access; use humhub\libs\BasePermission; diff --git a/protected/humhub/tests/codeception/unit/components/access/AccessTestPermission2.php b/protected/humhub/tests/codeception/unit/components/access/AccessTestPermission2.php index 202dccf95b..1f2433cac8 100644 --- a/protected/humhub/tests/codeception/unit/components/access/AccessTestPermission2.php +++ b/protected/humhub/tests/codeception/unit/components/access/AccessTestPermission2.php @@ -4,6 +4,7 @@ * @copyright Copyright (c) 2017 HumHub GmbH & Co. KG * @license https://www.humhub.com/licences */ + namespace humhub\tests\codeception\unit\components\access; use humhub\libs\BasePermission; diff --git a/protected/humhub/tests/codeception/unit/components/access/TestActionValidator.php b/protected/humhub/tests/codeception/unit/components/access/TestActionValidator.php index 95070ee3fb..1867b749a3 100644 --- a/protected/humhub/tests/codeception/unit/components/access/TestActionValidator.php +++ b/protected/humhub/tests/codeception/unit/components/access/TestActionValidator.php @@ -4,6 +4,7 @@ * @copyright Copyright (c) 2017 HumHub GmbH & Co. KG * @license https://www.humhub.com/licences */ + namespace humhub\tests\codeception\unit\components\access; use humhub\components\access\ActionAccessValidator; diff --git a/protected/humhub/tests/codeception/unit/components/access/TestControllerAccess.php b/protected/humhub/tests/codeception/unit/components/access/TestControllerAccess.php index d080479262..770e893792 100644 --- a/protected/humhub/tests/codeception/unit/components/access/TestControllerAccess.php +++ b/protected/humhub/tests/codeception/unit/components/access/TestControllerAccess.php @@ -4,6 +4,7 @@ * @copyright Copyright (c) 2017 HumHub GmbH & Co. KG * @license https://www.humhub.com/licences */ + namespace humhub\tests\codeception\unit\components\access; use humhub\commands\TestController; diff --git a/protected/humhub/tests/codeception/unit/components/export/ExportResultTest.php b/protected/humhub/tests/codeception/unit/components/export/ExportResultTest.php index 3c748686af..4c51375717 100644 --- a/protected/humhub/tests/codeception/unit/components/export/ExportResultTest.php +++ b/protected/humhub/tests/codeception/unit/components/export/ExportResultTest.php @@ -19,7 +19,7 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet; */ class ExportResultTest extends Unit { - const TEST_FILE = 'test.csv'; + public const TEST_FILE = 'test.csv'; /** * @var \UnitTester diff --git a/protected/humhub/tests/codeception/unit/components/export/SpreadsheetExportTest.php b/protected/humhub/tests/codeception/unit/components/export/SpreadsheetExportTest.php index f0d077ba9e..faede91ce7 100644 --- a/protected/humhub/tests/codeception/unit/components/export/SpreadsheetExportTest.php +++ b/protected/humhub/tests/codeception/unit/components/export/SpreadsheetExportTest.php @@ -5,7 +5,6 @@ * @license https://www.humhub.com/licences */ - namespace humhub\tests\codeception\unit; use Codeception\Test\Unit; @@ -21,7 +20,7 @@ use yii\data\ArrayDataProvider; */ class SpreadsheetExportTest extends Unit { - const TEST_FILE = 'test.csv'; + public const TEST_FILE = 'test.csv'; /** * @var \UnitTester diff --git a/protected/humhub/tests/codeception/unit/components/rendering/DefaultViewPathRendererTest.php b/protected/humhub/tests/codeception/unit/components/rendering/DefaultViewPathRendererTest.php index c5346b948b..571f71ffc6 100644 --- a/protected/humhub/tests/codeception/unit/components/rendering/DefaultViewPathRendererTest.php +++ b/protected/humhub/tests/codeception/unit/components/rendering/DefaultViewPathRendererTest.php @@ -9,7 +9,6 @@ use humhub\components\rendering\DefaultViewPathRenderer; class DefaultViewPathRendererTest extends HumHubDbTestCase { - use Specify; public function testSimpleDefaultView() @@ -18,7 +17,7 @@ class DefaultViewPathRendererTest extends HumHubDbTestCase $renderer = new DefaultViewPathRenderer(['defaultView' => '@tests/codeception/unit/components/rendering/views/parent.php']); $this->assertEquals('
getOptions() function.
*
- * @param boolean $autoGenerate
+ * @param bool $autoGenerate
* @return string
*/
public function getId($autoGenerate = true)
diff --git a/protected/humhub/widgets/Label.php b/protected/humhub/widgets/Label.php
index 0fc8aba0bb..482be75eef 100644
--- a/protected/humhub/widgets/Label.php
+++ b/protected/humhub/widgets/Label.php
@@ -12,7 +12,6 @@ use humhub\components\Widget;
use humhub\libs\Html;
use Yii;
-
/**
* Labels for Wall Entries
* This widget will attached labels like Pinned, Archived to Wall Entries
@@ -21,7 +20,6 @@ use Yii;
*/
class Label extends BootstrapComponent
{
-
/**
* @since 1.9
*/
@@ -96,7 +94,7 @@ class Label extends BootstrapComponent
*/
public function getTypedClass($type)
{
- return 'label-'.$type;
+ return 'label-' . $type;
}
public function getWidgetOptions()
@@ -121,5 +119,3 @@ class Label extends BootstrapComponent
return $labels;
}
}
-
-?>
diff --git a/protected/humhub/widgets/LanguageChooser.php b/protected/humhub/widgets/LanguageChooser.php
index 8d2d06aaf9..868af76aaa 100644
--- a/protected/humhub/widgets/LanguageChooser.php
+++ b/protected/humhub/widgets/LanguageChooser.php
@@ -32,7 +32,6 @@ use yii\base\Widget;
*/
class LanguageChooser extends Widget
{
-
/**
* Displays / Run the Widget
*/
diff --git a/protected/humhub/widgets/Link.php b/protected/humhub/widgets/Link.php
index ea43b65f53..3b4b118a2f 100644
--- a/protected/humhub/widgets/Link.php
+++ b/protected/humhub/widgets/Link.php
@@ -4,11 +4,13 @@
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
* @license https://www.humhub.com/licences
*/
+
namespace humhub\widgets;
use humhub\components\Widget;
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
+
/**
* Helper class for creating links.
* @package humhub\widgets
@@ -17,12 +19,14 @@ class Link extends Button
{
public $_link = true;
- public static function to($text, $url = '#', $pjax = true) {
+ public static function to($text, $url = '#', $pjax = true)
+ {
return self::asLink($text, $url)->pjax($pjax);
}
- public static function withAction($text, $action, $url = null, $target = null) {
- return self::asLink($text)->action($action,$url, $target);
+ public static function withAction($text, $action, $url = null, $target = null)
+ {
+ return self::asLink($text)->action($action, $url, $target);
}
/**
diff --git a/protected/humhub/widgets/LinkPager.php b/protected/humhub/widgets/LinkPager.php
index 4ef526bb6c..5b978b3ef3 100644
--- a/protected/humhub/widgets/LinkPager.php
+++ b/protected/humhub/widgets/LinkPager.php
@@ -8,14 +8,11 @@
namespace humhub\widgets;
-
-
/**
* @inheritdoc
*/
class LinkPager extends \yii\widgets\LinkPager
{
-
/**
* @inheritdoc
*/
diff --git a/protected/humhub/widgets/LoaderWidget.php b/protected/humhub/widgets/LoaderWidget.php
index 4ed94656f3..c8e97d8ad8 100644
--- a/protected/humhub/widgets/LoaderWidget.php
+++ b/protected/humhub/widgets/LoaderWidget.php
@@ -29,7 +29,6 @@ namespace humhub\widgets;
*/
class LoaderWidget extends \yii\base\Widget
{
-
/**
* id for DOM element
*
@@ -43,7 +42,7 @@ class LoaderWidget extends \yii\base\Widget
* @var string
*/
public $cssClass = "";
-
+
/**
* defines if the loader is initially shown
*/
@@ -62,5 +61,3 @@ class LoaderWidget extends \yii\base\Widget
}
}
-
-?>
\ No newline at end of file
diff --git a/protected/humhub/widgets/Modal.php b/protected/humhub/widgets/Modal.php
index e20d3c8003..b2832f1670 100644
--- a/protected/humhub/widgets/Modal.php
+++ b/protected/humhub/widgets/Modal.php
@@ -63,7 +63,7 @@ class Modal extends JsWidget
* there is no headtext available, or set to false if the button should not
* be rendered.
*
- * @var boolean
+ * @var bool
*/
public $showClose;
@@ -77,25 +77,25 @@ class Modal extends JsWidget
/**
* Defines if a click on the modal background should close the modal
- * @var boolean
+ * @var bool
*/
public $backdrop = true;
/**
* Defines if the modal can be closed by pressing escape
- * @var boolean
+ * @var bool
*/
public $keyboard = true;
/**
* Defines if the modal should be shown at startup
- * @var boolean
+ * @var bool
*/
public $show = false;
/**
* Defines if the text should be centered
- * @var boolean
+ * @var bool
*/
public $centerText = false;
@@ -103,7 +103,7 @@ class Modal extends JsWidget
* Can be set to false if the modal body should not be initialized with an
* loader animation. Default is true, if no body is provided.
*
- * @var boolean
+ * @var bool
*/
public $initialLoader;
diff --git a/protected/humhub/widgets/ModalButton.php b/protected/humhub/widgets/ModalButton.php
index 0ce877e4d2..930caceb8a 100644
--- a/protected/humhub/widgets/ModalButton.php
+++ b/protected/humhub/widgets/ModalButton.php
@@ -4,6 +4,7 @@
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
* @license https://www.humhub.com/licences
*/
+
namespace humhub\widgets;
use humhub\components\Widget;
@@ -11,6 +12,7 @@ use humhub\libs\Html;
use Yii;
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
+
/**
* Helper class for creating buttons.
*
diff --git a/protected/humhub/widgets/ModalClose.php b/protected/humhub/widgets/ModalClose.php
index a4442565c9..0c2c1c28aa 100644
--- a/protected/humhub/widgets/ModalClose.php
+++ b/protected/humhub/widgets/ModalClose.php
@@ -6,7 +6,7 @@ namespace humhub\widgets;
* This Widget can be used to finish a modal process.
* If the frontend requires a modal response, this widget will close the global modal
* and show an status message.
- *
+ *
*
* @author buddha
*/
@@ -19,7 +19,7 @@ class ModalClose extends \yii\base\Widget
public $saved;
public $script;
public $reload = false;
-
+
/**
* @inheritdoc
*/
diff --git a/protected/humhub/widgets/ModalDialog.php b/protected/humhub/widgets/ModalDialog.php
index 9037b6c2f4..7e3896f6a3 100644
--- a/protected/humhub/widgets/ModalDialog.php
+++ b/protected/humhub/widgets/ModalDialog.php
@@ -1,4 +1,5 @@
centerText ? ' text-center' : '';
- $this->initialLoader = ($this->initialLoader ==! null) ? $this->initialLoader : ($this->body === null);
+ $this->initialLoader = ($this->initialLoader == ! null) ? $this->initialLoader : ($this->body === null);
return $this->render('modalDialog', [
'header' => $this->header,
@@ -63,9 +63,9 @@ class ModalDialog extends Modal
public function getAttributes()
{
$dialogClass = 'modal-dialog';
- $dialogClass .= $this->size ? ' modal-dialog-'.$this->size : '';
- $dialogClass .= $this->animation ? ' animated '.$this->animation : '';
- $dialogClass .= ' '.$this->dialogClass;
+ $dialogClass .= $this->size ? ' modal-dialog-' . $this->size : '';
+ $dialogClass .= $this->animation ? ' animated ' . $this->animation : '';
+ $dialogClass .= ' ' . $this->dialogClass;
return [
'class' => $dialogClass
diff --git a/protected/humhub/widgets/NotificationArea.php b/protected/humhub/widgets/NotificationArea.php
index d40a199be6..094f3f9fae 100644
--- a/protected/humhub/widgets/NotificationArea.php
+++ b/protected/humhub/widgets/NotificationArea.php
@@ -16,7 +16,6 @@ namespace humhub\widgets;
*/
class NotificationArea extends BaseStack
{
-
/**
* @inheritdoc
*/
diff --git a/protected/humhub/widgets/PageAddonStack.php b/protected/humhub/widgets/PageAddonStack.php
index 8b5fb0150a..a0e6458391 100644
--- a/protected/humhub/widgets/PageAddonStack.php
+++ b/protected/humhub/widgets/PageAddonStack.php
@@ -29,5 +29,4 @@ namespace humhub\widgets;
*/
class PageAddonStack extends Stack
{
-
}
diff --git a/protected/humhub/widgets/PanelMenu.php b/protected/humhub/widgets/PanelMenu.php
index 906aff9625..759fe35f23 100644
--- a/protected/humhub/widgets/PanelMenu.php
+++ b/protected/humhub/widgets/PanelMenu.php
@@ -19,7 +19,6 @@ use yii\base\Widget;
*/
class PanelMenu extends Widget
{
-
/**
* @var String unique id from panel element
*/
diff --git a/protected/humhub/widgets/PjaxLayoutContent.php b/protected/humhub/widgets/PjaxLayoutContent.php
index 210e3cd4ce..d0f50fd476 100644
--- a/protected/humhub/widgets/PjaxLayoutContent.php
+++ b/protected/humhub/widgets/PjaxLayoutContent.php
@@ -19,7 +19,6 @@ use humhub\assets\PjaxAsset;
*/
class PjaxLayoutContent extends \humhub\components\Widget
{
-
/**
* @var array options passed to pjax scrpit
*/
diff --git a/protected/humhub/widgets/PoweredBy.php b/protected/humhub/widgets/PoweredBy.php
index d677f12b89..44a435fcd3 100644
--- a/protected/humhub/widgets/PoweredBy.php
+++ b/protected/humhub/widgets/PoweredBy.php
@@ -20,7 +20,6 @@ use Yii;
*/
class PoweredBy extends Widget
{
-
/**
* @var bool return text link only
*/
diff --git a/protected/humhub/widgets/SettingsTabs.php b/protected/humhub/widgets/SettingsTabs.php
index ef72af8b5d..d1e7c2933e 100644
--- a/protected/humhub/widgets/SettingsTabs.php
+++ b/protected/humhub/widgets/SettingsTabs.php
@@ -4,6 +4,7 @@
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
* @license https://www.humhub.com/licences
*/
+
namespace humhub\widgets;
class SettingsTabs extends Tabs
diff --git a/protected/humhub/widgets/ShowMorePager.php b/protected/humhub/widgets/ShowMorePager.php
index f9b9bbd383..9aab7f9e21 100644
--- a/protected/humhub/widgets/ShowMorePager.php
+++ b/protected/humhub/widgets/ShowMorePager.php
@@ -24,7 +24,6 @@ use yii\web\JsExpression;
*/
class ShowMorePager extends \humhub\widgets\LinkPager
{
-
/**
* @var Pagination the pagination object that this pager is associated with.
* You must set this property in order to make LinkPager work.
diff --git a/protected/humhub/widgets/SiteLogo.php b/protected/humhub/widgets/SiteLogo.php
index d5a32e29a9..7a2ba60336 100644
--- a/protected/humhub/widgets/SiteLogo.php
+++ b/protected/humhub/widgets/SiteLogo.php
@@ -6,7 +6,6 @@ use humhub\libs\LogoImage;
class SiteLogo extends \yii\base\Widget
{
-
public $place = 'topMenu';
public function run()
diff --git a/protected/humhub/widgets/StatusBar.php b/protected/humhub/widgets/StatusBar.php
index be5de12334..206ee1067b 100644
--- a/protected/humhub/widgets/StatusBar.php
+++ b/protected/humhub/widgets/StatusBar.php
@@ -17,7 +17,6 @@ namespace humhub\widgets;
*/
class StatusBar extends \yii\base\Widget
{
-
/**
* @inheritdoc
*/
diff --git a/protected/humhub/widgets/Tabs.php b/protected/humhub/widgets/Tabs.php
index 964bce817b..781ff040a5 100644
--- a/protected/humhub/widgets/Tabs.php
+++ b/protected/humhub/widgets/Tabs.php
@@ -124,7 +124,7 @@ class Tabs extends \yii\bootstrap\Tabs
if (isset($item['view'])) {
$view = $item['view'];
if ($this->viewPath && strpos($view, '@') === false) {
- $view = $this->viewPath . '/'.$item['view'];
+ $view = $this->viewPath . '/' . $item['view'];
}
$this->items[$key]['content'] = $this->render($view, $this->getParams($item));
diff --git a/protected/humhub/widgets/TimeAgo.php b/protected/humhub/widgets/TimeAgo.php
index f25c9bbe2f..188e0863d5 100644
--- a/protected/humhub/widgets/TimeAgo.php
+++ b/protected/humhub/widgets/TimeAgo.php
@@ -19,7 +19,6 @@ use yii\base\Widget;
*/
class TimeAgo extends Widget
{
-
/**
* @var string Database (Y-m-d H:i:s) or Unix timestamp
*/
diff --git a/protected/humhub/widgets/TimePicker.php b/protected/humhub/widgets/TimePicker.php
index 7f65dc3641..3309155cc9 100644
--- a/protected/humhub/widgets/TimePicker.php
+++ b/protected/humhub/widgets/TimePicker.php
@@ -18,5 +18,4 @@ use Yii;
*/
class TimePicker extends \humhub\modules\ui\form\widgets\TimePicker
{
-
}
diff --git a/protected/humhub/widgets/TopMenu.php b/protected/humhub/widgets/TopMenu.php
index a405b940f3..ca179c2458 100644
--- a/protected/humhub/widgets/TopMenu.php
+++ b/protected/humhub/widgets/TopMenu.php
@@ -20,7 +20,6 @@ use humhub\modules\user\components\User;
*/
class TopMenu extends Menu
{
-
/**
* @inheritdoc
*/
diff --git a/protected/humhub/widgets/TopMenuRightStack.php b/protected/humhub/widgets/TopMenuRightStack.php
index eed61501fd..88893cc814 100644
--- a/protected/humhub/widgets/TopMenuRightStack.php
+++ b/protected/humhub/widgets/TopMenuRightStack.php
@@ -19,7 +19,6 @@ use humhub\modules\user\components\User;
*/
class TopMenuRightStack extends BaseStack
{
-
/**
* @inheritdoc
*/
diff --git a/protected/humhub/widgets/mails/MailButton.php b/protected/humhub/widgets/mails/MailButton.php
index 3f3e0eec66..91445be29c 100644
--- a/protected/humhub/widgets/mails/MailButton.php
+++ b/protected/humhub/widgets/mails/MailButton.php
@@ -18,19 +18,18 @@ use Yii;
*/
class MailButton extends \yii\base\Widget
{
-
/**
* @var string hex color, default is primary theme color
*/
public $color;
/**
- * @var string can be used instead of $color and accepts values as primary|info|success or any other theme variable etc.
+ * @var string can be used instead of $color and accepts values as primary|info|success or any other theme variable etc.
*/
public $type;
/**
- * @var string target url
+ * @var string target url
*/
public $url;
diff --git a/protected/humhub/widgets/mails/MailButtonList.php b/protected/humhub/widgets/mails/MailButtonList.php
index 3788bee267..5785557429 100644
--- a/protected/humhub/widgets/mails/MailButtonList.php
+++ b/protected/humhub/widgets/mails/MailButtonList.php
@@ -16,7 +16,6 @@ namespace humhub\widgets\mails;
*/
class MailButtonList extends \yii\base\Widget
{
-
/**
* @var string hex color
*/
diff --git a/protected/humhub/widgets/mails/MailCommentEntry.php b/protected/humhub/widgets/mails/MailCommentEntry.php
index 3d3fe9b9d9..7d4f6a996b 100644
--- a/protected/humhub/widgets/mails/MailCommentEntry.php
+++ b/protected/humhub/widgets/mails/MailCommentEntry.php
@@ -19,9 +19,8 @@ use humhub\modules\content\interfaces\ContentOwner;
*/
class MailCommentEntry extends \yii\base\Widget
{
-
/**
- * @var \humhub\modules\user\models\User content originator
+ * @var \humhub\modules\user\models\User content originator
*/
public $originator;
@@ -29,19 +28,19 @@ class MailCommentEntry extends \yii\base\Widget
* @var \humhub\modules\user\models\User notification receiver
*/
public $receiver;
-
+
/**
- * @var string|Viewable|ContentOwner content to render
+ * @var string|Viewable|ContentOwner content to render
*/
public $comment;
-
+
/**
* @var \humhub\modules\space\models\Space space of content (optional)
*/
public $space;
-
- /**
- * @var string content date
+
+ /**
+ * @var string content date
*/
public $date;
@@ -61,5 +60,3 @@ class MailCommentEntry extends \yii\base\Widget
}
}
-
-?>
\ No newline at end of file
diff --git a/protected/humhub/widgets/mails/MailContentContainerImage.php b/protected/humhub/widgets/mails/MailContentContainerImage.php
index 081bd54469..95577c94ec 100644
--- a/protected/humhub/widgets/mails/MailContentContainerImage.php
+++ b/protected/humhub/widgets/mails/MailContentContainerImage.php
@@ -18,7 +18,6 @@ use humhub\modules\space\models\Space;
*/
class MailContentContainerImage extends \yii\base\Widget
{
-
/**
* @var \humhub\modules\content\components\ContentContainerActiveRecord
*/
@@ -29,10 +28,10 @@ class MailContentContainerImage extends \yii\base\Widget
*/
public function run()
{
- $url = ($this->container instanceof Space)
+ $url = ($this->container instanceof Space)
? $this->container->createUrl('/space/space', [], true)
: $this->container->createUrl('/user/profile', [], true);
-
+
return $this->render('mailContentContainerImage', [
'container' => $this->container,
'url' => $url,
@@ -40,5 +39,3 @@ class MailContentContainerImage extends \yii\base\Widget
}
}
-
-?>
\ No newline at end of file
diff --git a/protected/humhub/widgets/mails/MailContentEntry.php b/protected/humhub/widgets/mails/MailContentEntry.php
index c431782499..6b30bce25d 100644
--- a/protected/humhub/widgets/mails/MailContentEntry.php
+++ b/protected/humhub/widgets/mails/MailContentEntry.php
@@ -24,7 +24,6 @@ use humhub\modules\content\interfaces\ContentOwner;
*/
class MailContentEntry extends \yii\base\Widget
{
-
/**
* @var \humhub\modules\user\models\User content originator
*/
@@ -51,7 +50,7 @@ class MailContentEntry extends \yii\base\Widget
public $date;
/**
- * @var boolean will render the content as comment
+ * @var bool will render the content as comment
*/
public $isComment;
@@ -91,4 +90,3 @@ class MailContentEntry extends \yii\base\Widget
]);
}
}
-?>
diff --git a/protected/humhub/widgets/mails/MailHeadline.php b/protected/humhub/widgets/mails/MailHeadline.php
index f1ec7c8358..53ce82045d 100644
--- a/protected/humhub/widgets/mails/MailHeadline.php
+++ b/protected/humhub/widgets/mails/MailHeadline.php
@@ -22,12 +22,12 @@ class MailHeadline extends \yii\base\Widget
* @var string button text
*/
public $text;
-
+
/**
* @var int headline level 1-3
*/
public $level;
-
+
/**
* @var string optional additional text style
*/
@@ -41,7 +41,7 @@ class MailHeadline extends \yii\base\Widget
if(!$this->level) {
$this->level = 1;
}
-
+
return $this->render('mailHeadline', [
'text' => $this->text,
'level' => $this->level,