-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use Wei\Ret; | ||
|
||
if (!function_exists('suc')) { | ||
/** | ||
* Return operation successful result | ||
* | ||
* @param string|array|null $message | ||
* @return Ret | ||
*/ | ||
function suc($message = null): Ret | ||
{ | ||
return Ret::suc($message); | ||
} | ||
} | ||
|
||
if (!function_exists('err')) { | ||
/** | ||
* Return operation failed result, and logs with an info level | ||
* | ||
* @param array|string $message | ||
* @param int|null $code | ||
* @param string|null $level | ||
* @return Ret | ||
*/ | ||
function err($message, ?int $code = null, ?string $level = null): Ret | ||
{ | ||
return Ret::err(...func_get_args()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters