Skip to content

Commit

Permalink
fix: use error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Dartui authored and jakubmikita committed Jul 24, 2024
1 parent e382709 commit 89e3016
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Traits/HasReturnField.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

namespace BracketSpace\Notification\Traits;

use BracketSpace\Notification\ErrorHandler;

/**
* HasName trait
*/
Expand Down Expand Up @@ -53,7 +55,9 @@ public function setReturnField(string $returnField)
$availableReturnFields = ['ID', 'user_email'];

if (!in_array($returnField, $availableReturnFields, true)) {
trigger_error(sprintf('Recipient return field "%s" is not supported.', $returnField), E_USER_ERROR);
ErrorHandler::error(sprintf('Recipient return field "%s" is not supported.', $returnField));

$returnField = $this->getDefaultReturnField();
}

$this->returnField = $returnField;
Expand Down

0 comments on commit 89e3016

Please sign in to comment.