summaryrefslogtreecommitdiff
path: root/includes/model/Shifts_model.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-08-20 20:58:51 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-08-20 21:07:57 +0200
commitd6c8f1a61475fefa9594141aaf12a28d220bdaf8 (patch)
tree905051fdb1307f947c3a3a7be240609f8bc00e59 /includes/model/Shifts_model.php
parentbf6efe532c8f2de84e95b090911280a9b1b61ce8 (diff)
parent2f41b9e4418def9b69cf237312bc592364585025 (diff)
Merge branch 'master' to 'rebuild-database'
Diffstat (limited to 'includes/model/Shifts_model.php')
-rw-r--r--includes/model/Shifts_model.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php
index 62335882..94513ff3 100644
--- a/includes/model/Shifts_model.php
+++ b/includes/model/Shifts_model.php
@@ -182,7 +182,7 @@ function NeededAngeltypes_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
/**
* @param array $shift
* @param array $angeltype
- * @return array|null
+ * @return array
*/
function NeededAngeltype_by_Shift_and_Angeltype($shift, $angeltype)
{
@@ -323,7 +323,7 @@ function Shift_signup_allowed_angel(
return new ShiftSignupState(ShiftSignupState::NOT_ARRIVED, $free_entries);
}
- if ($user_shifts == null) {
+ if (empty($user_shifts)) {
$user_shifts = Shifts_by_user($user);
}
@@ -349,14 +349,14 @@ function Shift_signup_allowed_angel(
return new ShiftSignupState(ShiftSignupState::OCCUPIED, $free_entries);
}
- if ($user_angeltype == null) {
+ if (empty($user_angeltype)) {
$user_angeltype = UserAngelType_by_User_and_AngelType($user, $angeltype);
}
if (
- $user_angeltype == null
- || ($angeltype['no_self_signup'] == 1 && $user_angeltype != null)
- || ($angeltype['restricted'] == 1 && $user_angeltype != null && !isset($user_angeltype['confirm_user_id']))
+ empty($user_angeltype)
+ || ($angeltype['no_self_signup'] == 1 && !empty($user_angeltype))
+ || ($angeltype['restricted'] == 1 && !empty($user_angeltype) && !isset($user_angeltype['confirm_user_id']))
) {
// you cannot join if user is not of this angel type
// you cannot join if you are not confirmed
@@ -552,7 +552,7 @@ function Shift_update($shift)
* Update a shift by its external id.
*
* @param array $shift
- * @return bool|null
+ * @return int
* @throws Exception
*/
function Shift_update_by_psid($shift)