Skip to content

Commit

Permalink
CS
Browse files Browse the repository at this point in the history
  • Loading branch information
dergel committed Mar 14, 2024
1 parent ad1e4c2 commit 4d3c932
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
rex_ycom::addTable(rex::getTablePrefix() . 'ycom_user');
rex_yform_manager_dataset::setModelClass(rex::getTablePrefix() . 'ycom_user', rex_ycom_user::class);

if (rex::isBackend() && ('index.php?page=content/edit' == rex_url::currentBackendPage() || 'mediapool' == rex_be_controller::getCurrentPagePart(1))) {
if (rex::isBackend() && ('index.php?page=content/edit' === rex_url::currentBackendPage() || 'mediapool' === rex_be_controller::getCurrentPagePart(1))) {
rex_view::addJsFile($this->getAssetsUrl('ycom_backend.js'));
}
2 changes: 1 addition & 1 deletion install.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
rex_yform_manager_table::deleteCache();

$content = rex_file::get(rex_path::addon('ycom', 'install/tablesets/yform_user.json'));
if (is_string($content) && '' != $content) {
if (is_string($content) && '' !== $content) {
rex_yform_manager_table_api::importTablesets($content);
}

Expand Down
26 changes: 13 additions & 13 deletions lib/ycom_log.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

class rex_ycom_log
{
public const TYPE_ACCESS = 'access';
public const TYPE_LOGOUT = 'logout';
public const TYPE_CLICK = 'click';
public const TYPE_LOGIN_FAILED = 'login_failed';
public const TYPE_LOGIN_NOT_FOUND = 'login_not_found';
public const TYPE_LOGIN_SUCCESS = 'login_success';
public const TYPE_LOGIN_UPDATED = 'login_updated';
public const TYPE_LOGIN_DELETED = 'login_deleted';
public const TYPE_REGISTERD = 'registerd';
public const TYPE_SESSION_FAILED = 'session_failed';
public const TYPE_COOKIE_FAILED = 'cookie_failed';
public const TYPE_IMPERSONATE = 'session_impersonate';
public const TYPE_ACCESS = 'access'; /** @api */
public const TYPE_LOGOUT = 'logout'; /** @api */
public const TYPE_CLICK = 'click'; /** @api */
public const TYPE_LOGIN_FAILED = 'login_failed'; /** @api */
public const TYPE_LOGIN_NOT_FOUND = 'login_not_found'; /** @api */
public const TYPE_LOGIN_SUCCESS = 'login_success'; /** @api */
public const TYPE_LOGIN_UPDATED = 'login_updated'; /** @api */
public const TYPE_LOGIN_DELETED = 'login_deleted'; /** @api */
public const TYPE_REGISTERD = 'registerd'; /** @api */
public const TYPE_SESSION_FAILED = 'session_failed'; /** @api */
public const TYPE_COOKIE_FAILED = 'cookie_failed'; /** @api */
public const TYPE_IMPERSONATE = 'session_impersonate'; /** @api */

public const TYPES = [self::TYPE_COOKIE_FAILED, self::TYPE_SESSION_FAILED, self::TYPE_ACCESS, self::TYPE_LOGIN_SUCCESS, self::TYPE_LOGOUT, self::TYPE_LOGIN_UPDATED, self::TYPE_CLICK, self::TYPE_LOGIN_FAILED, self::TYPE_REGISTERD, self::TYPE_LOGIN_DELETED, self::TYPE_LOGIN_NOT_FOUND];
/** @var null|bool */
/** @var bool|null */
private static $active;
private static int $maxFileSize = 20000000; // 20 Mb Default

Expand Down
6 changes: 3 additions & 3 deletions lib/ycom_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ public function isInGroup(int $group_id): bool
{
$ycom_groups = (string) $this->getValue('ycom_groups');

if ('' == $group_id) {
if ('' === $group_id) {
return true;
}
if ('' != $ycom_groups) {
if ('' !== $ycom_groups) {
$ycom_groups_array = explode(',', $ycom_groups);
if (in_array((string) $group_id, $ycom_groups_array, true)) {
return true;
Expand All @@ -40,7 +40,7 @@ public function getPassword(): string
*/
public function getGroups(): array
{
if ('' == $this->getValue('ycom_groups')) {
if ('' === $this->getValue('ycom_groups')) {
return [];
}

Expand Down
4 changes: 2 additions & 2 deletions lib/yform/value/ycom_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function enterObject(): void
$wc = $this->params['warning'][$this->getId()];
}

if ('hidden' != trim($this->getElement(4))) {
if ('hidden' !== trim($this->getElement(4))) {
$this->params['form_output'][$this->getId()] = '
<p class="formtext">
<label class="text ' . $wc . '" for="' . $this->getFieldId() . '" >' . $this->getElement(3) . '</label>
Expand All @@ -27,7 +27,7 @@ public function enterObject(): void
}

$this->params['value_pool']['email'][$this->getElement(1)] = stripslashes($this->getValue());
if ('no_db' != $this->getElement(5)) {
if ('no_db' !== $this->getElement(5)) {
$this->params['value_pool']['sql'][$this->getElement(1)] = $this->getValue();
}
}
Expand Down
2 changes: 1 addition & 1 deletion pages/docs.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
(new rex_be_page($key, rex_i18n::msg('ycom_docs_' . $keyWithoudPrio)))
->setSubPath($mdFile)
->setHref('index.php?page=ycom/docs&mdfile=' . $key)
->setIsActive($key == $currenMDFile),
->setIsActive($key === $currenMDFile),
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/auth/boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
$params = $ep->getParams();
/** @var rex_yform_manager_table $table */
$table = $params['table'];
if (rex::getTablePrefix() . 'ycom_user' == $table->getTableName()) {
if (rex::getTablePrefix() . 'ycom_user' === $table->getTableName()) {
if (rex::getUser() && rex::getUser()->isAdmin()) {
$actionButtons = $ep->getSubject();
$actionButtons['ycom_impersonate'] = [
Expand Down
2 changes: 1 addition & 1 deletion plugins/auth/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
$articleTable = rex_sql_table::get(rex::getTable('article'));
if ($articleTable->hasColumn('ycom_auth_type')) {
$Column = $articleTable->getColumn('ycom_auth_type');
if (null !== $Column && 'enum' == substr($Column->getType(), 0, 4)) {
if (null !== $Column && 'enum' === substr($Column->getType(), 0, 4)) {
$articleAuthTypeWasEnum = true;
}
}
Expand Down

0 comments on commit 4d3c932

Please sign in to comment.