Skip to content

Commit

Permalink
Merge pull request #34 from jpahullo/fix-ci-errors
Browse files Browse the repository at this point in the history
CI: fix errors and warnings
  • Loading branch information
danmarsden authored Mar 12, 2024
2 parents c1c9d55 + d175f53 commit a18d438
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions classes/observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die;

/**
* User profile event observer class.
*
Expand Down
10 changes: 5 additions & 5 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
*/
function cohortauto_prepare_profile_data($data, $replaceempty = 'EMPTY') {
$reject = array('ajax_updatable_user_prefs', 'sesskey', 'preference', 'editing', 'access', 'message_lastpopup', 'enrol');
if (is_array($data) or is_object($data)) {
if (is_array($data) || is_object($data)) {
$newdata = array();
foreach ($data as $key => $val) {
if (!in_array($key, $reject)) {
if (is_array($val) or is_object($val)) {
if (is_array($val) || is_object($val)) {
$newdata[$key] = cohortauto_prepare_profile_data($val, $replaceempty);
} else {
if ($val === '' or $val === ' ' or $val === null) {
if ($val === '' || $val === ' ' || $val === null) {
$str = ($val === false) ? 'false' : $replaceempty;
} else {
$str = ($val === true) ? 'true' : strip_tags("$val");
Expand All @@ -55,7 +55,7 @@ function cohortauto_prepare_profile_data($data, $replaceempty = 'EMPTY') {
}
}
} else {
if ($data === '' or $data === ' ' or $data === null) {
if ($data === '' || $data === ' ' || $data === null) {
$str = ($data === false) ? 'false' : $replaceempty;
} else {
$str = ($data === true) ? 'true' : strip_tags("$data");
Expand Down Expand Up @@ -219,7 +219,7 @@ public function user_profile_hook(&$user) {
$ignore = explode(",", $this->config->donttouchusers);

// Skip explicitly ignored users.
if (!empty($ignore) AND array_search($user->username, $ignore) !== false) {
if (!empty($ignore) && array_search($user->username, $ignore) !== false) {
return;
};

Expand Down

0 comments on commit a18d438

Please sign in to comment.