Skip to content

Commit

Permalink
feat: switching $self to a bool instead of true vs null
Browse files Browse the repository at this point in the history
  • Loading branch information
preimpression committed May 18, 2024
1 parent 3ec5045 commit 0aeae46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/Services/DesignUpdateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -799,11 +799,11 @@ public function rejectRequest($data, $request, $user, $forceReject = false, $not
* @param array $data
* @param CharacterDesignUpdate $request
* @param User $user
* @param mixed|null $self
* @param boolean $self
*
* @return bool
*/
public function cancelRequest($data, $request, $user, $self = null) {
public function cancelRequest($data, $request, $user, $self = 0) {
DB::beginTransaction();

try {
Expand All @@ -820,7 +820,7 @@ public function cancelRequest($data, $request, $user, $self = null) {
// to add a comment to it. Status is returned to Draft status.
// Use when rejecting a request that just requires minor modifications to approve.

if ($self == null) {
if (!$self) {
// Set staff comment if this is not a self-cancel
$request->staff_id = $user->id;
$request->staff_comments = $data['staff_comments'] ?? null;
Expand All @@ -835,7 +835,7 @@ public function cancelRequest($data, $request, $user, $self = null) {
$request->status = 'Draft';
$request->save();

if ($self == null) {
if (!$self) {
// Notify the user if it is not being canceled by the user themself.
// Note that an admin canceling their own will also not result in a notification
Notifications::create('DESIGN_CANCELED', $request->user, [
Expand Down

0 comments on commit 0aeae46

Please sign in to comment.