@@ -10,56 +10,56 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | return [ |
| 12 | 12 | |
| 13 | - 'ok' => 'موفق', |
|
| 14 | - 'no_error_message' => 'خطای شماره :api_code', |
|
| 13 | + 'ok' => 'موفق', |
|
| 14 | + 'no_error_message' => 'خطای شماره :api_code', |
|
| 15 | 15 | |
| 16 | - // can be used by Exception Handler (if enabled) |
|
| 17 | - 'uncaught_exception' => 'استثناء مدیریت نشده :message', |
|
| 18 | - // we talking API call here, hence we have http_not_found |
|
| 19 | - 'http_exception' => 'استثناء HTTP :message', |
|
| 16 | + // can be used by Exception Handler (if enabled) |
|
| 17 | + 'uncaught_exception' => 'استثناء مدیریت نشده :message', |
|
| 18 | + // we talking API call here, hence we have http_not_found |
|
| 19 | + 'http_exception' => 'استثناء HTTP :message', |
|
| 20 | 20 | |
| 21 | - // HttpException handler (added in 6.4.0) |
|
| 22 | - // Error messages for HttpException caught w/o custom messages |
|
| 23 | - // https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml |
|
| 24 | - 'http_400' => 'Bad Request', |
|
| 25 | - 'http_401' => 'اجازه دسترسی ندارید', |
|
| 26 | - 'http_402' => 'Payment Required', |
|
| 27 | - 'http_403' => 'Forbidden', |
|
| 28 | - 'http_404' => 'Not Found', |
|
| 29 | - 'http_405' => 'Method Not Allowed', |
|
| 30 | - 'http_406' => 'Not Acceptable', |
|
| 31 | - 'http_407' => 'Proxy Authentication Required', |
|
| 32 | - 'http_408' => 'Request Timeout', |
|
| 33 | - 'http_409' => 'Conflict', |
|
| 34 | - 'http_410' => 'Gone', |
|
| 35 | - 'http_411' => 'Length Required', |
|
| 36 | - 'http_412' => 'Precondition Failed', |
|
| 37 | - 'http_413' => 'Payload Too Large', |
|
| 38 | - 'http_414' => 'URI Too Long', |
|
| 39 | - 'http_415' => 'Unsupported Media Type', |
|
| 40 | - 'http_416' => 'Range Not Satisfiable', |
|
| 41 | - 'http_417' => 'Expectation Failed', |
|
| 42 | - 'http_421' => 'Misdirected Request', |
|
| 43 | - 'http_422' => 'داده معتبر نیست', |
|
| 44 | - 'http_423' => 'Locked', |
|
| 45 | - 'http_424' => 'Failed Dependency', |
|
| 46 | - 'http_425' => 'Too Early', |
|
| 47 | - 'http_426' => 'Upgrade Required', |
|
| 48 | - 'http_428' => 'Precondition Required', |
|
| 49 | - 'http_429' => 'Too Many Requests', |
|
| 50 | - 'http_431' => 'Request Header Fields Too Large', |
|
| 51 | - 'http_451' => 'Unavailable For Legal Reasons', |
|
| 52 | - 'http_500' => 'Internal Server Error', |
|
| 53 | - 'http_501' => 'Not Implemented', |
|
| 54 | - 'http_502' => 'Bad Gateway', |
|
| 55 | - 'http_503' => 'Service Unavailable', |
|
| 56 | - 'http_504' => 'Gateway Timeout', |
|
| 57 | - 'http_505' => 'HTTP Version Not Supported', |
|
| 58 | - 'http_506' => 'Variant Also Negotiates', |
|
| 59 | - 'http_507' => 'Insufficient Storage', |
|
| 60 | - 'http_508' => 'Loop Detected', |
|
| 61 | - 'http_509' => 'Unassigned', |
|
| 62 | - 'http_510' => 'Not Extended', |
|
| 63 | - 'http_511' => 'Network Authentication Required', |
|
| 21 | + // HttpException handler (added in 6.4.0) |
|
| 22 | + // Error messages for HttpException caught w/o custom messages |
|
| 23 | + // https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml |
|
| 24 | + 'http_400' => 'Bad Request', |
|
| 25 | + 'http_401' => 'اجازه دسترسی ندارید', |
|
| 26 | + 'http_402' => 'Payment Required', |
|
| 27 | + 'http_403' => 'Forbidden', |
|
| 28 | + 'http_404' => 'Not Found', |
|
| 29 | + 'http_405' => 'Method Not Allowed', |
|
| 30 | + 'http_406' => 'Not Acceptable', |
|
| 31 | + 'http_407' => 'Proxy Authentication Required', |
|
| 32 | + 'http_408' => 'Request Timeout', |
|
| 33 | + 'http_409' => 'Conflict', |
|
| 34 | + 'http_410' => 'Gone', |
|
| 35 | + 'http_411' => 'Length Required', |
|
| 36 | + 'http_412' => 'Precondition Failed', |
|
| 37 | + 'http_413' => 'Payload Too Large', |
|
| 38 | + 'http_414' => 'URI Too Long', |
|
| 39 | + 'http_415' => 'Unsupported Media Type', |
|
| 40 | + 'http_416' => 'Range Not Satisfiable', |
|
| 41 | + 'http_417' => 'Expectation Failed', |
|
| 42 | + 'http_421' => 'Misdirected Request', |
|
| 43 | + 'http_422' => 'داده معتبر نیست', |
|
| 44 | + 'http_423' => 'Locked', |
|
| 45 | + 'http_424' => 'Failed Dependency', |
|
| 46 | + 'http_425' => 'Too Early', |
|
| 47 | + 'http_426' => 'Upgrade Required', |
|
| 48 | + 'http_428' => 'Precondition Required', |
|
| 49 | + 'http_429' => 'Too Many Requests', |
|
| 50 | + 'http_431' => 'Request Header Fields Too Large', |
|
| 51 | + 'http_451' => 'Unavailable For Legal Reasons', |
|
| 52 | + 'http_500' => 'Internal Server Error', |
|
| 53 | + 'http_501' => 'Not Implemented', |
|
| 54 | + 'http_502' => 'Bad Gateway', |
|
| 55 | + 'http_503' => 'Service Unavailable', |
|
| 56 | + 'http_504' => 'Gateway Timeout', |
|
| 57 | + 'http_505' => 'HTTP Version Not Supported', |
|
| 58 | + 'http_506' => 'Variant Also Negotiates', |
|
| 59 | + 'http_507' => 'Insufficient Storage', |
|
| 60 | + 'http_508' => 'Loop Detected', |
|
| 61 | + 'http_509' => 'Unassigned', |
|
| 62 | + 'http_510' => 'Not Extended', |
|
| 63 | + 'http_511' => 'Network Authentication Required', |
|
| 64 | 64 | ]; |
| 65 | 65 | |
@@ -21,172 +21,172 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | class BaseApiCodes |
| 23 | 23 | { |
| 24 | - use ApiCodesHelpers; |
|
| 25 | - |
|
| 26 | - /** |
|
| 27 | - * protected code range - lowest code for reserved range. |
|
| 28 | - * |
|
| 29 | - * @var int |
|
| 30 | - */ |
|
| 31 | - public const RESERVED_MIN_API_CODE_OFFSET = 0; |
|
| 32 | - |
|
| 33 | - /** |
|
| 34 | - * protected code range - highest code for reserved range |
|
| 35 | - * |
|
| 36 | - * @var int |
|
| 37 | - */ |
|
| 38 | - public const RESERVED_MAX_API_CODE_OFFSET = 19; |
|
| 39 | - |
|
| 40 | - /** |
|
| 41 | - * built-in codes: OK |
|
| 42 | - * |
|
| 43 | - * @var int |
|
| 44 | - */ |
|
| 45 | - protected const OK_OFFSET = 0; |
|
| 46 | - /** |
|
| 47 | - * built-in code for fallback message mapping |
|
| 48 | - * |
|
| 49 | - * @var int |
|
| 50 | - */ |
|
| 51 | - protected const NO_ERROR_MESSAGE_OFFSET = 1; |
|
| 52 | - /** |
|
| 53 | - * built-in error code for HTTP_NOT_FOUND exception |
|
| 54 | - * |
|
| 55 | - * @var int |
|
| 56 | - */ |
|
| 57 | - protected const EX_HTTP_NOT_FOUND_OFFSET = 10; |
|
| 58 | - /** |
|
| 59 | - * built-in error code for HTTP_SERVICE_UNAVAILABLE exception |
|
| 60 | - * |
|
| 61 | - * @var int |
|
| 62 | - */ |
|
| 63 | - protected const EX_HTTP_SERVICE_UNAVAILABLE_OFFSET = 11; |
|
| 64 | - /** |
|
| 65 | - * built-in error code for HTTP_EXCEPTION |
|
| 66 | - * |
|
| 67 | - * @var int |
|
| 68 | - */ |
|
| 69 | - protected const EX_HTTP_EXCEPTION_OFFSET = 12; |
|
| 70 | - /** |
|
| 71 | - * built-in error code for UNCAUGHT_EXCEPTION |
|
| 72 | - * |
|
| 73 | - * @var int |
|
| 74 | - */ |
|
| 75 | - protected const EX_UNCAUGHT_EXCEPTION_OFFSET = 13; |
|
| 76 | - |
|
| 77 | - /** |
|
| 78 | - * built-in error code for \Illuminate\Auth\AuthenticationException |
|
| 79 | - * |
|
| 80 | - * @var int |
|
| 81 | - */ |
|
| 82 | - protected const EX_AUTHENTICATION_EXCEPTION_OFFSET = 14; |
|
| 83 | - |
|
| 84 | - /** |
|
| 85 | - * built-in error code for \Illuminate\Auth\AuthenticationException |
|
| 86 | - * |
|
| 87 | - * @var int |
|
| 88 | - */ |
|
| 89 | - protected const EX_VALIDATION_EXCEPTION_OFFSET = 15; |
|
| 90 | - |
|
| 91 | - /** |
|
| 92 | - * Returns base code mapping array |
|
| 93 | - * |
|
| 94 | - * @return array |
|
| 95 | - */ |
|
| 96 | - protected static function getBaseMap(): array |
|
| 97 | - { |
|
| 98 | - $tpl = 'response-builder::builder.http_%d'; |
|
| 99 | - |
|
| 100 | - return [ |
|
| 101 | - self::OK() => 'response-builder::builder.ok', |
|
| 102 | - self::NO_ERROR_MESSAGE() => 'response-builder::builder.no_error_message', |
|
| 103 | - self::EX_HTTP_EXCEPTION() => 'response-builder::builder.http_exception', |
|
| 104 | - self::EX_UNCAUGHT_EXCEPTION() => 'response-builder::builder.uncaught_exception', |
|
| 105 | - self::EX_HTTP_NOT_FOUND() => sprintf($tpl, HttpResponse::HTTP_NOT_FOUND), |
|
| 106 | - self::EX_HTTP_SERVICE_UNAVAILABLE() => sprintf($tpl, HttpResponse::HTTP_SERVICE_UNAVAILABLE), |
|
| 107 | - self::EX_AUTHENTICATION_EXCEPTION() => sprintf($tpl, HttpResponse::HTTP_UNAUTHORIZED), |
|
| 108 | - self::EX_VALIDATION_EXCEPTION() => sprintf($tpl, HttpResponse::HTTP_UNPROCESSABLE_ENTITY), |
|
| 109 | - ]; |
|
| 110 | - } |
|
| 111 | - |
|
| 112 | - /** |
|
| 113 | - * Returns API code for internal code OK |
|
| 114 | - * |
|
| 115 | - * @return int valid API code in current range |
|
| 116 | - */ |
|
| 117 | - public static function OK(): int |
|
| 118 | - { |
|
| 119 | - return static::getCodeForInternalOffset(static::OK_OFFSET); |
|
| 120 | - } |
|
| 121 | - |
|
| 122 | - /** |
|
| 123 | - * Returns API code for internal code NO_ERROR_MESSAGE |
|
| 124 | - * |
|
| 125 | - * @return int valid API code in current range |
|
| 126 | - */ |
|
| 127 | - public static function NO_ERROR_MESSAGE(): int |
|
| 128 | - { |
|
| 129 | - return static::getCodeForInternalOffset(static::NO_ERROR_MESSAGE_OFFSET); |
|
| 130 | - } |
|
| 131 | - |
|
| 132 | - /** |
|
| 133 | - * Returns API code for internal code EX_HTTP_NOT_FOUND |
|
| 134 | - * |
|
| 135 | - * @return int valid API code in current range |
|
| 136 | - */ |
|
| 137 | - public static function EX_HTTP_NOT_FOUND(): int |
|
| 138 | - { |
|
| 139 | - return static::getCodeForInternalOffset(static::EX_HTTP_NOT_FOUND_OFFSET); |
|
| 140 | - } |
|
| 141 | - |
|
| 142 | - /** |
|
| 143 | - * Returns API code for internal code EX_HTTP_EXCEPTION |
|
| 144 | - * |
|
| 145 | - * @return int valid API code in current range |
|
| 146 | - */ |
|
| 147 | - public static function EX_HTTP_EXCEPTION(): int |
|
| 148 | - { |
|
| 149 | - return static::getCodeForInternalOffset(static::EX_HTTP_EXCEPTION_OFFSET); |
|
| 150 | - } |
|
| 151 | - |
|
| 152 | - /** |
|
| 153 | - * Returns API code for internal code EX_UNCAUGHT_EXCEPTION |
|
| 154 | - * |
|
| 155 | - * @return int valid API code in current range |
|
| 156 | - */ |
|
| 157 | - public static function EX_UNCAUGHT_EXCEPTION(): int |
|
| 158 | - { |
|
| 159 | - return static::getCodeForInternalOffset(static::EX_UNCAUGHT_EXCEPTION_OFFSET); |
|
| 160 | - } |
|
| 161 | - |
|
| 162 | - /** |
|
| 163 | - * Returns API code for internal code EX_AUTHENTICATION_EXCEPTION |
|
| 164 | - * |
|
| 165 | - * @return int valid API code in current range |
|
| 166 | - */ |
|
| 167 | - public static function EX_AUTHENTICATION_EXCEPTION(): int |
|
| 168 | - { |
|
| 169 | - return static::getCodeForInternalOffset(static::EX_AUTHENTICATION_EXCEPTION_OFFSET); |
|
| 170 | - } |
|
| 171 | - |
|
| 172 | - /** |
|
| 173 | - * Returns API code for internal code EX_VALIDATION_EXCEPTION |
|
| 174 | - * |
|
| 175 | - * @return int valid API code in current range |
|
| 176 | - */ |
|
| 177 | - public static function EX_VALIDATION_EXCEPTION(): int |
|
| 178 | - { |
|
| 179 | - return static::getCodeForInternalOffset(static::EX_VALIDATION_EXCEPTION_OFFSET); |
|
| 180 | - } |
|
| 181 | - |
|
| 182 | - /** |
|
| 183 | - * Returns API code for internal code EX_HTTP_SERVICE_UNAVAILABLE |
|
| 184 | - * |
|
| 185 | - * @return int valid API code in current range |
|
| 186 | - */ |
|
| 187 | - public static function EX_HTTP_SERVICE_UNAVAILABLE(): int |
|
| 188 | - { |
|
| 189 | - return static::getCodeForInternalOffset(static::EX_HTTP_SERVICE_UNAVAILABLE_OFFSET); |
|
| 190 | - } |
|
| 24 | + use ApiCodesHelpers; |
|
| 25 | + |
|
| 26 | + /** |
|
| 27 | + * protected code range - lowest code for reserved range. |
|
| 28 | + * |
|
| 29 | + * @var int |
|
| 30 | + */ |
|
| 31 | + public const RESERVED_MIN_API_CODE_OFFSET = 0; |
|
| 32 | + |
|
| 33 | + /** |
|
| 34 | + * protected code range - highest code for reserved range |
|
| 35 | + * |
|
| 36 | + * @var int |
|
| 37 | + */ |
|
| 38 | + public const RESERVED_MAX_API_CODE_OFFSET = 19; |
|
| 39 | + |
|
| 40 | + /** |
|
| 41 | + * built-in codes: OK |
|
| 42 | + * |
|
| 43 | + * @var int |
|
| 44 | + */ |
|
| 45 | + protected const OK_OFFSET = 0; |
|
| 46 | + /** |
|
| 47 | + * built-in code for fallback message mapping |
|
| 48 | + * |
|
| 49 | + * @var int |
|
| 50 | + */ |
|
| 51 | + protected const NO_ERROR_MESSAGE_OFFSET = 1; |
|
| 52 | + /** |
|
| 53 | + * built-in error code for HTTP_NOT_FOUND exception |
|
| 54 | + * |
|
| 55 | + * @var int |
|
| 56 | + */ |
|
| 57 | + protected const EX_HTTP_NOT_FOUND_OFFSET = 10; |
|
| 58 | + /** |
|
| 59 | + * built-in error code for HTTP_SERVICE_UNAVAILABLE exception |
|
| 60 | + * |
|
| 61 | + * @var int |
|
| 62 | + */ |
|
| 63 | + protected const EX_HTTP_SERVICE_UNAVAILABLE_OFFSET = 11; |
|
| 64 | + /** |
|
| 65 | + * built-in error code for HTTP_EXCEPTION |
|
| 66 | + * |
|
| 67 | + * @var int |
|
| 68 | + */ |
|
| 69 | + protected const EX_HTTP_EXCEPTION_OFFSET = 12; |
|
| 70 | + /** |
|
| 71 | + * built-in error code for UNCAUGHT_EXCEPTION |
|
| 72 | + * |
|
| 73 | + * @var int |
|
| 74 | + */ |
|
| 75 | + protected const EX_UNCAUGHT_EXCEPTION_OFFSET = 13; |
|
| 76 | + |
|
| 77 | + /** |
|
| 78 | + * built-in error code for \Illuminate\Auth\AuthenticationException |
|
| 79 | + * |
|
| 80 | + * @var int |
|
| 81 | + */ |
|
| 82 | + protected const EX_AUTHENTICATION_EXCEPTION_OFFSET = 14; |
|
| 83 | + |
|
| 84 | + /** |
|
| 85 | + * built-in error code for \Illuminate\Auth\AuthenticationException |
|
| 86 | + * |
|
| 87 | + * @var int |
|
| 88 | + */ |
|
| 89 | + protected const EX_VALIDATION_EXCEPTION_OFFSET = 15; |
|
| 90 | + |
|
| 91 | + /** |
|
| 92 | + * Returns base code mapping array |
|
| 93 | + * |
|
| 94 | + * @return array |
|
| 95 | + */ |
|
| 96 | + protected static function getBaseMap(): array |
|
| 97 | + { |
|
| 98 | + $tpl = 'response-builder::builder.http_%d'; |
|
| 99 | + |
|
| 100 | + return [ |
|
| 101 | + self::OK() => 'response-builder::builder.ok', |
|
| 102 | + self::NO_ERROR_MESSAGE() => 'response-builder::builder.no_error_message', |
|
| 103 | + self::EX_HTTP_EXCEPTION() => 'response-builder::builder.http_exception', |
|
| 104 | + self::EX_UNCAUGHT_EXCEPTION() => 'response-builder::builder.uncaught_exception', |
|
| 105 | + self::EX_HTTP_NOT_FOUND() => sprintf($tpl, HttpResponse::HTTP_NOT_FOUND), |
|
| 106 | + self::EX_HTTP_SERVICE_UNAVAILABLE() => sprintf($tpl, HttpResponse::HTTP_SERVICE_UNAVAILABLE), |
|
| 107 | + self::EX_AUTHENTICATION_EXCEPTION() => sprintf($tpl, HttpResponse::HTTP_UNAUTHORIZED), |
|
| 108 | + self::EX_VALIDATION_EXCEPTION() => sprintf($tpl, HttpResponse::HTTP_UNPROCESSABLE_ENTITY), |
|
| 109 | + ]; |
|
| 110 | + } |
|
| 111 | + |
|
| 112 | + /** |
|
| 113 | + * Returns API code for internal code OK |
|
| 114 | + * |
|
| 115 | + * @return int valid API code in current range |
|
| 116 | + */ |
|
| 117 | + public static function OK(): int |
|
| 118 | + { |
|
| 119 | + return static::getCodeForInternalOffset(static::OK_OFFSET); |
|
| 120 | + } |
|
| 121 | + |
|
| 122 | + /** |
|
| 123 | + * Returns API code for internal code NO_ERROR_MESSAGE |
|
| 124 | + * |
|
| 125 | + * @return int valid API code in current range |
|
| 126 | + */ |
|
| 127 | + public static function NO_ERROR_MESSAGE(): int |
|
| 128 | + { |
|
| 129 | + return static::getCodeForInternalOffset(static::NO_ERROR_MESSAGE_OFFSET); |
|
| 130 | + } |
|
| 131 | + |
|
| 132 | + /** |
|
| 133 | + * Returns API code for internal code EX_HTTP_NOT_FOUND |
|
| 134 | + * |
|
| 135 | + * @return int valid API code in current range |
|
| 136 | + */ |
|
| 137 | + public static function EX_HTTP_NOT_FOUND(): int |
|
| 138 | + { |
|
| 139 | + return static::getCodeForInternalOffset(static::EX_HTTP_NOT_FOUND_OFFSET); |
|
| 140 | + } |
|
| 141 | + |
|
| 142 | + /** |
|
| 143 | + * Returns API code for internal code EX_HTTP_EXCEPTION |
|
| 144 | + * |
|
| 145 | + * @return int valid API code in current range |
|
| 146 | + */ |
|
| 147 | + public static function EX_HTTP_EXCEPTION(): int |
|
| 148 | + { |
|
| 149 | + return static::getCodeForInternalOffset(static::EX_HTTP_EXCEPTION_OFFSET); |
|
| 150 | + } |
|
| 151 | + |
|
| 152 | + /** |
|
| 153 | + * Returns API code for internal code EX_UNCAUGHT_EXCEPTION |
|
| 154 | + * |
|
| 155 | + * @return int valid API code in current range |
|
| 156 | + */ |
|
| 157 | + public static function EX_UNCAUGHT_EXCEPTION(): int |
|
| 158 | + { |
|
| 159 | + return static::getCodeForInternalOffset(static::EX_UNCAUGHT_EXCEPTION_OFFSET); |
|
| 160 | + } |
|
| 161 | + |
|
| 162 | + /** |
|
| 163 | + * Returns API code for internal code EX_AUTHENTICATION_EXCEPTION |
|
| 164 | + * |
|
| 165 | + * @return int valid API code in current range |
|
| 166 | + */ |
|
| 167 | + public static function EX_AUTHENTICATION_EXCEPTION(): int |
|
| 168 | + { |
|
| 169 | + return static::getCodeForInternalOffset(static::EX_AUTHENTICATION_EXCEPTION_OFFSET); |
|
| 170 | + } |
|
| 171 | + |
|
| 172 | + /** |
|
| 173 | + * Returns API code for internal code EX_VALIDATION_EXCEPTION |
|
| 174 | + * |
|
| 175 | + * @return int valid API code in current range |
|
| 176 | + */ |
|
| 177 | + public static function EX_VALIDATION_EXCEPTION(): int |
|
| 178 | + { |
|
| 179 | + return static::getCodeForInternalOffset(static::EX_VALIDATION_EXCEPTION_OFFSET); |
|
| 180 | + } |
|
| 181 | + |
|
| 182 | + /** |
|
| 183 | + * Returns API code for internal code EX_HTTP_SERVICE_UNAVAILABLE |
|
| 184 | + * |
|
| 185 | + * @return int valid API code in current range |
|
| 186 | + */ |
|
| 187 | + public static function EX_HTTP_SERVICE_UNAVAILABLE(): int |
|
| 188 | + { |
|
| 189 | + return static::getCodeForInternalOffset(static::EX_HTTP_SERVICE_UNAVAILABLE_OFFSET); |
|
| 190 | + } |
|
| 191 | 191 | |
| 192 | 192 | } |
@@ -10,58 +10,58 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | return [ |
| 12 | 12 | |
| 13 | - 'ok' => 'OK', |
|
| 14 | - 'no_error_message' => 'Fehler #:api_code', |
|
| 13 | + 'ok' => 'OK', |
|
| 14 | + 'no_error_message' => 'Fehler #:api_code', |
|
| 15 | 15 | |
| 16 | - // Used by Exception Handler Helper (when used) |
|
| 17 | - 'uncaught_exception' => 'Ungefangene Ausnahme: :message', |
|
| 18 | - 'http_exception' => 'HTTP Ausnahme: :message', |
|
| 16 | + // Used by Exception Handler Helper (when used) |
|
| 17 | + 'uncaught_exception' => 'Ungefangene Ausnahme: :message', |
|
| 18 | + 'http_exception' => 'HTTP Ausnahme: :message', |
|
| 19 | 19 | |
| 20 | - // HttpException handler (added in 6.4.0) |
|
| 21 | - // Error messages for HttpException caught w/o custom messages |
|
| 22 | - // https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml |
|
| 23 | - // |
|
| 24 | - // German translation based on https://wiki.selfhtml.org/wiki/HTTP/Statuscodes |
|
| 25 | - 'http_400' => 'Ungültige Anfrage', |
|
| 26 | - 'http_401' => 'Unautorisiert', |
|
| 27 | - 'http_402' => 'Bezahlung benötigt', |
|
| 28 | - 'http_403' => 'Verboten', |
|
| 29 | - 'http_404' => 'Nicht gefunden', |
|
| 30 | - 'http_405' => 'Methode nicht erlaubt', |
|
| 31 | - 'http_406' => 'Nicht akzeptabel', |
|
| 32 | - 'http_407' => 'Proxy-Authentifizierung benötigt', |
|
| 33 | - 'http_408' => 'Anfrage-Zeitüberschreitung', |
|
| 34 | - 'http_409' => 'Konflikt', |
|
| 35 | - 'http_410' => 'Verschwunden', |
|
| 36 | - 'http_411' => 'Länge benötigt', |
|
| 37 | - 'http_412' => 'Vorbedingung missglückt', |
|
| 38 | - 'http_413' => 'Anfrage-Entität zu groß', |
|
| 39 | - 'http_414' => 'Anfrage-URI zu lang', |
|
| 40 | - 'http_415' => 'Nicht unterstützter Medientyp', |
|
| 41 | - 'http_416' => 'Anfrage-Bereich nicht erfüllbar', |
|
| 42 | - 'http_417' => 'Erwartung missglückt', |
|
| 43 | - 'http_421' => 'Fehlgeleitete Anforderung', |
|
| 44 | - 'http_422' => 'Kann nicht verarbeitet werden', |
|
| 45 | - 'http_423' => 'Gesperrt', |
|
| 46 | - 'http_424' => 'Vorhergehende Bedingung nicht erfüllt', |
|
| 47 | - 'http_425' => 'Too Early', // FIXME |
|
| 48 | - 'http_426' => 'Update benötigt', |
|
| 49 | - 'http_428' => ' Vorbedingung benötigt', |
|
| 50 | - 'http_429' => 'Zu viele Anfragen', |
|
| 51 | - 'http_431' => 'Headerfelds zu groß', |
|
| 52 | - 'http_451' => 'Ressource aus rechtlichen Gründen nicht verfügbar', |
|
| 20 | + // HttpException handler (added in 6.4.0) |
|
| 21 | + // Error messages for HttpException caught w/o custom messages |
|
| 22 | + // https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml |
|
| 23 | + // |
|
| 24 | + // German translation based on https://wiki.selfhtml.org/wiki/HTTP/Statuscodes |
|
| 25 | + 'http_400' => 'Ungültige Anfrage', |
|
| 26 | + 'http_401' => 'Unautorisiert', |
|
| 27 | + 'http_402' => 'Bezahlung benötigt', |
|
| 28 | + 'http_403' => 'Verboten', |
|
| 29 | + 'http_404' => 'Nicht gefunden', |
|
| 30 | + 'http_405' => 'Methode nicht erlaubt', |
|
| 31 | + 'http_406' => 'Nicht akzeptabel', |
|
| 32 | + 'http_407' => 'Proxy-Authentifizierung benötigt', |
|
| 33 | + 'http_408' => 'Anfrage-Zeitüberschreitung', |
|
| 34 | + 'http_409' => 'Konflikt', |
|
| 35 | + 'http_410' => 'Verschwunden', |
|
| 36 | + 'http_411' => 'Länge benötigt', |
|
| 37 | + 'http_412' => 'Vorbedingung missglückt', |
|
| 38 | + 'http_413' => 'Anfrage-Entität zu groß', |
|
| 39 | + 'http_414' => 'Anfrage-URI zu lang', |
|
| 40 | + 'http_415' => 'Nicht unterstützter Medientyp', |
|
| 41 | + 'http_416' => 'Anfrage-Bereich nicht erfüllbar', |
|
| 42 | + 'http_417' => 'Erwartung missglückt', |
|
| 43 | + 'http_421' => 'Fehlgeleitete Anforderung', |
|
| 44 | + 'http_422' => 'Kann nicht verarbeitet werden', |
|
| 45 | + 'http_423' => 'Gesperrt', |
|
| 46 | + 'http_424' => 'Vorhergehende Bedingung nicht erfüllt', |
|
| 47 | + 'http_425' => 'Too Early', // FIXME |
|
| 48 | + 'http_426' => 'Update benötigt', |
|
| 49 | + 'http_428' => ' Vorbedingung benötigt', |
|
| 50 | + 'http_429' => 'Zu viele Anfragen', |
|
| 51 | + 'http_431' => 'Headerfelds zu groß', |
|
| 52 | + 'http_451' => 'Ressource aus rechtlichen Gründen nicht verfügbar', |
|
| 53 | 53 | |
| 54 | - 'http_500' => 'Interner Server-Fehler', |
|
| 55 | - 'http_501' => 'Nicht implementiert', |
|
| 56 | - 'http_502' => 'Schlechtes Portal', |
|
| 57 | - 'http_503' => 'Dienst nicht verfügbar', |
|
| 58 | - 'http_504' => 'Portal-Auszeit', |
|
| 59 | - 'http_505' => 'HTTP-Version nicht unterstützt', |
|
| 60 | - 'http_506' => 'Variant Also Negotiates', // FIXME |
|
| 61 | - 'http_507' => 'Speicher des Servers reicht nicht aus', |
|
| 62 | - 'http_508' => 'Endlosschleife', |
|
| 63 | - 'http_509' => 'Unassigned', // FIXME |
|
| 64 | - 'http_510' => 'Zu wenig Informationen', |
|
| 65 | - 'http_511' => 'Identizifierung benötigt', |
|
| 54 | + 'http_500' => 'Interner Server-Fehler', |
|
| 55 | + 'http_501' => 'Nicht implementiert', |
|
| 56 | + 'http_502' => 'Schlechtes Portal', |
|
| 57 | + 'http_503' => 'Dienst nicht verfügbar', |
|
| 58 | + 'http_504' => 'Portal-Auszeit', |
|
| 59 | + 'http_505' => 'HTTP-Version nicht unterstützt', |
|
| 60 | + 'http_506' => 'Variant Also Negotiates', // FIXME |
|
| 61 | + 'http_507' => 'Speicher des Servers reicht nicht aus', |
|
| 62 | + 'http_508' => 'Endlosschleife', |
|
| 63 | + 'http_509' => 'Unassigned', // FIXME |
|
| 64 | + 'http_510' => 'Zu wenig Informationen', |
|
| 65 | + 'http_511' => 'Identizifierung benötigt', |
|
| 66 | 66 | ]; |
| 67 | 67 | |
@@ -10,56 +10,56 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | return [ |
| 12 | 12 | |
| 13 | - 'ok' => 'OK', |
|
| 14 | - 'no_error_message' => 'Error #:api_code', |
|
| 13 | + 'ok' => 'OK', |
|
| 14 | + 'no_error_message' => 'Error #:api_code', |
|
| 15 | 15 | |
| 16 | - // Used by Exception Handler Helper (when used) |
|
| 17 | - 'uncaught_exception' => 'Uncaught exception: :message', |
|
| 18 | - 'http_exception' => 'HTTP exception: :message', |
|
| 16 | + // Used by Exception Handler Helper (when used) |
|
| 17 | + 'uncaught_exception' => 'Uncaught exception: :message', |
|
| 18 | + 'http_exception' => 'HTTP exception: :message', |
|
| 19 | 19 | |
| 20 | - // HttpException handler (added in 6.4.0) |
|
| 21 | - // Error messages for HttpException caught w/o custom messages |
|
| 22 | - // https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml |
|
| 23 | - 'http_400' => 'Bad Request', |
|
| 24 | - 'http_401' => 'Unauthorized', |
|
| 25 | - 'http_402' => 'Payment Required', |
|
| 26 | - 'http_403' => 'Forbidden', |
|
| 27 | - 'http_404' => 'Not Found', |
|
| 28 | - 'http_405' => 'Method Not Allowed', |
|
| 29 | - 'http_406' => 'Not Acceptable', |
|
| 30 | - 'http_407' => 'Proxy Authentication Required', |
|
| 31 | - 'http_408' => 'Request Timeout', |
|
| 32 | - 'http_409' => 'Conflict', |
|
| 33 | - 'http_410' => 'Gone', |
|
| 34 | - 'http_411' => 'Length Required', |
|
| 35 | - 'http_412' => 'Precondition Failed', |
|
| 36 | - 'http_413' => 'Payload Too Large', |
|
| 37 | - 'http_414' => 'URI Too Long', |
|
| 38 | - 'http_415' => 'Unsupported Media Type', |
|
| 39 | - 'http_416' => 'Range Not Satisfiable', |
|
| 40 | - 'http_417' => 'Expectation Failed', |
|
| 41 | - 'http_421' => 'Misdirected Request', |
|
| 42 | - 'http_422' => 'Unprocessable Entity', |
|
| 43 | - 'http_423' => 'Locked', |
|
| 44 | - 'http_424' => 'Failed Dependency', |
|
| 45 | - 'http_425' => 'Too Early', |
|
| 46 | - 'http_426' => 'Upgrade Required', |
|
| 47 | - 'http_428' => 'Precondition Required', |
|
| 48 | - 'http_429' => 'Too Many Requests', |
|
| 49 | - 'http_431' => 'Request Header Fields Too Large', |
|
| 50 | - 'http_451' => 'Unavailable For Legal Reasons', |
|
| 20 | + // HttpException handler (added in 6.4.0) |
|
| 21 | + // Error messages for HttpException caught w/o custom messages |
|
| 22 | + // https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml |
|
| 23 | + 'http_400' => 'Bad Request', |
|
| 24 | + 'http_401' => 'Unauthorized', |
|
| 25 | + 'http_402' => 'Payment Required', |
|
| 26 | + 'http_403' => 'Forbidden', |
|
| 27 | + 'http_404' => 'Not Found', |
|
| 28 | + 'http_405' => 'Method Not Allowed', |
|
| 29 | + 'http_406' => 'Not Acceptable', |
|
| 30 | + 'http_407' => 'Proxy Authentication Required', |
|
| 31 | + 'http_408' => 'Request Timeout', |
|
| 32 | + 'http_409' => 'Conflict', |
|
| 33 | + 'http_410' => 'Gone', |
|
| 34 | + 'http_411' => 'Length Required', |
|
| 35 | + 'http_412' => 'Precondition Failed', |
|
| 36 | + 'http_413' => 'Payload Too Large', |
|
| 37 | + 'http_414' => 'URI Too Long', |
|
| 38 | + 'http_415' => 'Unsupported Media Type', |
|
| 39 | + 'http_416' => 'Range Not Satisfiable', |
|
| 40 | + 'http_417' => 'Expectation Failed', |
|
| 41 | + 'http_421' => 'Misdirected Request', |
|
| 42 | + 'http_422' => 'Unprocessable Entity', |
|
| 43 | + 'http_423' => 'Locked', |
|
| 44 | + 'http_424' => 'Failed Dependency', |
|
| 45 | + 'http_425' => 'Too Early', |
|
| 46 | + 'http_426' => 'Upgrade Required', |
|
| 47 | + 'http_428' => 'Precondition Required', |
|
| 48 | + 'http_429' => 'Too Many Requests', |
|
| 49 | + 'http_431' => 'Request Header Fields Too Large', |
|
| 50 | + 'http_451' => 'Unavailable For Legal Reasons', |
|
| 51 | 51 | |
| 52 | - 'http_500' => 'Internal Server Error', |
|
| 53 | - 'http_501' => 'Not Implemented', |
|
| 54 | - 'http_502' => 'Bad Gateway', |
|
| 55 | - 'http_503' => 'Service Unavailable', |
|
| 56 | - 'http_504' => 'Gateway Timeout', |
|
| 57 | - 'http_505' => 'HTTP Version Not Supported', |
|
| 58 | - 'http_506' => 'Variant Also Negotiates', |
|
| 59 | - 'http_507' => 'Insufficient Storage', |
|
| 60 | - 'http_508' => 'Loop Detected', |
|
| 61 | - 'http_509' => 'Unassigned', |
|
| 62 | - 'http_510' => 'Not Extended', |
|
| 63 | - 'http_511' => 'Network Authentication Required', |
|
| 52 | + 'http_500' => 'Internal Server Error', |
|
| 53 | + 'http_501' => 'Not Implemented', |
|
| 54 | + 'http_502' => 'Bad Gateway', |
|
| 55 | + 'http_503' => 'Service Unavailable', |
|
| 56 | + 'http_504' => 'Gateway Timeout', |
|
| 57 | + 'http_505' => 'HTTP Version Not Supported', |
|
| 58 | + 'http_506' => 'Variant Also Negotiates', |
|
| 59 | + 'http_507' => 'Insufficient Storage', |
|
| 60 | + 'http_508' => 'Loop Detected', |
|
| 61 | + 'http_509' => 'Unassigned', |
|
| 62 | + 'http_510' => 'Not Extended', |
|
| 63 | + 'http_511' => 'Network Authentication Required', |
|
| 64 | 64 | ]; |
| 65 | 65 | |
@@ -10,55 +10,55 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | return [ |
| 12 | 12 | |
| 13 | - 'ok' => 'OK', |
|
| 14 | - 'no_error_message' => 'Błąd #:api_code', |
|
| 13 | + 'ok' => 'OK', |
|
| 14 | + 'no_error_message' => 'Błąd #:api_code', |
|
| 15 | 15 | |
| 16 | - // Used by Exception Handler Helper (when used) |
|
| 17 | - 'uncaught_exception' => 'Nieprzechwycony wyjątek: :message', |
|
| 18 | - 'http_exception' => 'Wyjątek HTTP: :message', |
|
| 16 | + // Used by Exception Handler Helper (when used) |
|
| 17 | + 'uncaught_exception' => 'Nieprzechwycony wyjątek: :message', |
|
| 18 | + 'http_exception' => 'Wyjątek HTTP: :message', |
|
| 19 | 19 | |
| 20 | - // HttpException handler (added in 6.4.0) |
|
| 21 | - // Error messages for HttpException caught w/o custom messages |
|
| 22 | - // https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml |
|
| 23 | - 'http_400' => 'Bad Request', |
|
| 24 | - 'http_401' => 'Unauthorized', |
|
| 25 | - 'http_402' => 'Payment Required', |
|
| 26 | - 'http_403' => 'Forbidden', |
|
| 27 | - 'http_404' => 'Not Found', |
|
| 28 | - 'http_405' => 'Method Not Allowed', |
|
| 29 | - 'http_406' => 'Not Acceptable', |
|
| 30 | - 'http_407' => 'Proxy Authentication Required', |
|
| 31 | - 'http_408' => 'Request Timeout', |
|
| 32 | - 'http_409' => 'Conflict', |
|
| 33 | - 'http_410' => 'Gone', |
|
| 34 | - 'http_411' => 'Length Required', |
|
| 35 | - 'http_412' => 'Precondition Failed', |
|
| 36 | - 'http_413' => 'Payload Too Large', |
|
| 37 | - 'http_414' => 'URI Too Long', |
|
| 38 | - 'http_415' => 'Unsupported Media Type', |
|
| 39 | - 'http_416' => 'Range Not Satisfiable', |
|
| 40 | - 'http_417' => 'Expectation Failed', |
|
| 41 | - 'http_421' => 'Misdirected Request', |
|
| 42 | - 'http_422' => 'Unprocessable Entity', |
|
| 43 | - 'http_423' => 'Locked', |
|
| 44 | - 'http_424' => 'Failed Dependency', |
|
| 45 | - 'http_425' => 'Too Early', |
|
| 46 | - 'http_426' => 'Upgrade Required', |
|
| 47 | - 'http_428' => 'Precondition Required', |
|
| 48 | - 'http_429' => 'Too Many Requests', |
|
| 49 | - 'http_431' => 'Request Header Fields Too Large', |
|
| 50 | - 'http_451' => 'Unavailable For Legal Reasons', |
|
| 20 | + // HttpException handler (added in 6.4.0) |
|
| 21 | + // Error messages for HttpException caught w/o custom messages |
|
| 22 | + // https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml |
|
| 23 | + 'http_400' => 'Bad Request', |
|
| 24 | + 'http_401' => 'Unauthorized', |
|
| 25 | + 'http_402' => 'Payment Required', |
|
| 26 | + 'http_403' => 'Forbidden', |
|
| 27 | + 'http_404' => 'Not Found', |
|
| 28 | + 'http_405' => 'Method Not Allowed', |
|
| 29 | + 'http_406' => 'Not Acceptable', |
|
| 30 | + 'http_407' => 'Proxy Authentication Required', |
|
| 31 | + 'http_408' => 'Request Timeout', |
|
| 32 | + 'http_409' => 'Conflict', |
|
| 33 | + 'http_410' => 'Gone', |
|
| 34 | + 'http_411' => 'Length Required', |
|
| 35 | + 'http_412' => 'Precondition Failed', |
|
| 36 | + 'http_413' => 'Payload Too Large', |
|
| 37 | + 'http_414' => 'URI Too Long', |
|
| 38 | + 'http_415' => 'Unsupported Media Type', |
|
| 39 | + 'http_416' => 'Range Not Satisfiable', |
|
| 40 | + 'http_417' => 'Expectation Failed', |
|
| 41 | + 'http_421' => 'Misdirected Request', |
|
| 42 | + 'http_422' => 'Unprocessable Entity', |
|
| 43 | + 'http_423' => 'Locked', |
|
| 44 | + 'http_424' => 'Failed Dependency', |
|
| 45 | + 'http_425' => 'Too Early', |
|
| 46 | + 'http_426' => 'Upgrade Required', |
|
| 47 | + 'http_428' => 'Precondition Required', |
|
| 48 | + 'http_429' => 'Too Many Requests', |
|
| 49 | + 'http_431' => 'Request Header Fields Too Large', |
|
| 50 | + 'http_451' => 'Unavailable For Legal Reasons', |
|
| 51 | 51 | |
| 52 | - 'http_500' => 'Internal Server Error', |
|
| 53 | - 'http_501' => 'Not Implemented', |
|
| 54 | - 'http_502' => 'Bad Gateway', |
|
| 55 | - 'http_503' => 'Service Unavailable', |
|
| 56 | - 'http_504' => 'Gateway Timeout', |
|
| 57 | - 'http_505' => 'HTTP Version Not Supported', |
|
| 58 | - 'http_506' => 'Variant Also Negotiates', |
|
| 59 | - 'http_507' => 'Insufficient Storage', |
|
| 60 | - 'http_508' => 'Loop Detected', |
|
| 61 | - 'http_509' => 'Unassigned', |
|
| 62 | - 'http_510' => 'Not Extended', |
|
| 63 | - 'http_511' => 'Network Authentication Required', |
|
| 52 | + 'http_500' => 'Internal Server Error', |
|
| 53 | + 'http_501' => 'Not Implemented', |
|
| 54 | + 'http_502' => 'Bad Gateway', |
|
| 55 | + 'http_503' => 'Service Unavailable', |
|
| 56 | + 'http_504' => 'Gateway Timeout', |
|
| 57 | + 'http_505' => 'HTTP Version Not Supported', |
|
| 58 | + 'http_506' => 'Variant Also Negotiates', |
|
| 59 | + 'http_507' => 'Insufficient Storage', |
|
| 60 | + 'http_508' => 'Loop Detected', |
|
| 61 | + 'http_509' => 'Unassigned', |
|
| 62 | + 'http_510' => 'Not Extended', |
|
| 63 | + 'http_511' => 'Network Authentication Required', |
|
| 64 | 64 | ]; |
@@ -15,14 +15,14 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | interface ConverterContract |
| 17 | 17 | { |
| 18 | - /** |
|
| 19 | - * Returns array representation of the object. |
|
| 20 | - * |
|
| 21 | - * @param object $obj Object to be converted |
|
| 22 | - * @param array $config Converter config array to be used for this object (based on exact class |
|
| 23 | - * name match or inheritance). |
|
| 24 | - * |
|
| 25 | - * @return array |
|
| 26 | - */ |
|
| 27 | - public function convert(object $obj, array $config): array; |
|
| 18 | + /** |
|
| 19 | + * Returns array representation of the object. |
|
| 20 | + * |
|
| 21 | + * @param object $obj Object to be converted |
|
| 22 | + * @param array $config Converter config array to be used for this object (based on exact class |
|
| 23 | + * name match or inheritance). |
|
| 24 | + * |
|
| 25 | + * @return array |
|
| 26 | + */ |
|
| 27 | + public function convert(object $obj, array $config): array; |
|
| 28 | 28 | } |
@@ -132,7 +132,7 @@ |
||
| 132 | 132 | * @throws \InvalidArgumentException |
| 133 | 133 | */ |
| 134 | 134 | public static function assertIsType(string $var_name, $value, array $allowed_types, |
| 135 | - string $ex_class = Ex\InvalidTypeException::class): void |
|
| 135 | + string $ex_class = Ex\InvalidTypeException::class): void |
|
| 136 | 136 | { |
| 137 | 137 | $type = \gettype($value); |
| 138 | 138 | if (!\in_array($type, $allowed_types, true)) { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * @return HttpResponse |
| 86 | 86 | */ |
| 87 | 87 | public static function success($data = null, $api_code = null, array $placeholders = null, |
| 88 | - int $http_code = null, int $json_opts = null): HttpResponse |
|
| 88 | + int $http_code = null, int $json_opts = null): HttpResponse |
|
| 89 | 89 | { |
| 90 | 90 | return static::asSuccess($api_code) |
| 91 | 91 | ->withData($data) |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | * @return HttpResponse |
| 114 | 114 | */ |
| 115 | 115 | public static function error(int $api_code, array $placeholders = null, $data = null, int $http_code = null, |
| 116 | - int $json_opts = null): HttpResponse |
|
| 116 | + int $json_opts = null): HttpResponse |
|
| 117 | 117 | { |
| 118 | 118 | return static::asError($api_code) |
| 119 | 119 | ->withPlaceholders($placeholders) |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | public function withJsonOptions(int $json_opts = null): self |
| 198 | 198 | { |
| 199 | 199 | Validator::assertIsType('json_opts', $json_opts, [Type::INTEGER, |
| 200 | - Type::NULL]); |
|
| 200 | + Type::NULL]); |
|
| 201 | 201 | $this->json_opts = $json_opts; |
| 202 | 202 | |
| 203 | 203 | return $this; |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | public function withDebugData(array $debug_data = null): self |
| 212 | 212 | { |
| 213 | 213 | Validator::assertIsType('$debug_data', $debug_data, [Type::ARRAY, |
| 214 | - Type::NULL]); |
|
| 214 | + Type::NULL]); |
|
| 215 | 215 | $this->debug_data = $debug_data; |
| 216 | 216 | |
| 217 | 217 | return $this; |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | public function withMessage(string $msg = null): self |
| 226 | 226 | { |
| 227 | 227 | Validator::assertIsType('message', $msg, [Type::STRING, |
| 228 | - Type::NULL]); |
|
| 228 | + Type::NULL]); |
|
| 229 | 229 | $this->message = $msg; |
| 230 | 230 | |
| 231 | 231 | return $this; |
@@ -312,8 +312,8 @@ discard block |
||
| 312 | 312 | * @noinspection PhpTooManyParametersInspection |
| 313 | 313 | */ |
| 314 | 314 | protected function make(bool $success, int $api_code, $msg_or_api_code, $data = null, |
| 315 | - int $http_code = null, array $placeholders = null, array $http_headers = null, |
|
| 316 | - int $json_opts = null, array $debug_data = null): HttpResponse |
|
| 315 | + int $http_code = null, array $placeholders = null, array $http_headers = null, |
|
| 316 | + int $json_opts = null, array $debug_data = null): HttpResponse |
|
| 317 | 317 | { |
| 318 | 318 | $http_headers = $http_headers ?? []; |
| 319 | 319 | $http_code = $http_code ?? ($success ? RB::DEFAULT_HTTP_CODE_OK : RB::DEFAULT_HTTP_CODE_ERROR); |
@@ -352,8 +352,8 @@ discard block |
||
| 352 | 352 | * @noinspection PhpTooManyParametersInspection |
| 353 | 353 | */ |
| 354 | 354 | protected function buildResponse(bool $success, int $api_code, |
| 355 | - $msg_or_api_code, array $placeholders = null, |
|
| 356 | - $data = null, array $debug_data = null): array |
|
| 355 | + $msg_or_api_code, array $placeholders = null, |
|
| 356 | + $data = null, array $debug_data = null): array |
|
| 357 | 357 | { |
| 358 | 358 | // ensure $data is either @null, array or object of class with configured mapping. |
| 359 | 359 | $data = (new Converter())->convert($data); |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | |
| 79 | 79 | Util::sortArrayByPri($merged_config['converter']['classes']); |
| 80 | 80 | |
| 81 | - $this->app['config']->set($key, $merged_config); |
|
| 82 | - } |
|
| 81 | + $this->app['config']->set($key, $merged_config); |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | 84 | } |