Skip to content

Commit c263c2a

Browse files
committed
Refactor: Update functions params order in helpers.php
1 parent 0660982 commit c263c2a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/helpers.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<?php
22

3+
34
if ( ! function_exists('success_response')) {
45
/**
5-
* Generate username from random string
6+
* Return array of response
67
*
78
* @param array|null|Object $data
8-
* @param int $code
99
* @param string $message
10+
* @param int $code
1011
*
1112
* @return array
1213
*/
13-
function success_response($data = null, int $code = 200, string $message = 'Action performed successfully'): array {
14+
function success_response($data = null, string $message = 'Action performed successfully', int $code = 200): array {
1415
return [
1516
'code' => $code,
1617
'status' => 'success',
@@ -22,15 +23,15 @@ function success_response($data = null, int $code = 200, string $message = 'Acti
2223

2324
if ( ! function_exists('failure_response')) {
2425
/**
25-
* Generate username from random string
26+
* Return array of response
2627
*
2728
* @param array|null|Object $data
28-
* @param int $code
2929
* @param string $message
30+
* @param int $code
3031
*
3132
* @return array
3233
*/
33-
function failure_response($data = null, int $code = 0, string $message = 'Action attempted failed'): array {
34+
function failure_response($data = null, string $message = 'Action attempted failed', int $code = 0): array {
3435
return [
3536
'code' => $code,
3637
'status' => 'failed',

0 commit comments

Comments
 (0)