| Conditions | 1 |
| Paths | 1 |
| Total Lines | 91 |
| Code Lines | 71 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 68 | public function getReponseCodes() |
||
| 69 | { |
||
| 70 | return array( |
||
| 71 | array( |
||
| 72 | 'code' => 0, |
||
| 73 | 'message' => 'Success', |
||
| 74 | 'description' => 'The message was successfully accepted for delivery by Nexmo', |
||
| 75 | ), |
||
| 76 | array( |
||
| 77 | 'code' => 1, |
||
| 78 | 'message' => 'Throttled', |
||
| 79 | 'description' => 'You have exceeded the submission capacity allowed on this account, please back-off and retry', |
||
| 80 | ), |
||
| 81 | array( |
||
| 82 | 'code' => 2, |
||
| 83 | 'message' => 'Missing params', |
||
| 84 | 'description' => 'Your request is incomplete and missing some mandatory parameters', |
||
| 85 | ), |
||
| 86 | array( |
||
| 87 | 'code' => 3, |
||
| 88 | 'message' => 'Invalid params', |
||
| 89 | 'description' => 'The value of one or more parameters is invalid', |
||
| 90 | ), |
||
| 91 | array( |
||
| 92 | 'code' => 4, |
||
| 93 | 'message' => 'Invalid credentials', |
||
| 94 | 'description' => 'The api_key / api_secret you supplied is either invalid or disabled', |
||
| 95 | ), |
||
| 96 | array( |
||
| 97 | 'code' => 5, |
||
| 98 | 'message' => 'Internal error', |
||
| 99 | 'description' => 'An error has occurred in the Nexmo platform whilst processing this message', |
||
| 100 | ), |
||
| 101 | array( |
||
| 102 | 'code' => 6, |
||
| 103 | 'message' => 'Invalid message', |
||
| 104 | 'description' => 'The Nexmo platform was unable to process this message, for example, an un-recognized number prefix or the number is not whitelisted if your account is new', |
||
| 105 | ), |
||
| 106 | array( |
||
| 107 | 'code' => 7, |
||
| 108 | 'message' => 'Number barred', |
||
| 109 | 'description' => 'The number you are trying to submit to is blacklisted and may not receive messages', |
||
| 110 | ), |
||
| 111 | array( |
||
| 112 | 'code' => 8, |
||
| 113 | 'message' => 'Partner account barred', |
||
| 114 | 'description' => 'The api_key you supplied is for an account that has been barred from submitting messages', |
||
| 115 | ), |
||
| 116 | array( |
||
| 117 | 'code' => 9, |
||
| 118 | 'message' => 'Partner quota exceeded', |
||
| 119 | 'description' => 'Your pre-pay account does not have sufficient credit to process this message', |
||
| 120 | ), |
||
| 121 | array( |
||
| 122 | 'code' => 11, |
||
| 123 | 'message' => 'Account not enabled for REST', |
||
| 124 | 'description' => 'This account is not provisioned for REST submission, you should use SMPP instead', |
||
| 125 | ), |
||
| 126 | array( |
||
| 127 | 'code' => 12, |
||
| 128 | 'message' => 'Message too long', |
||
| 129 | 'description' => 'Applies to Binary submissions, where the length of the UDH and the message body combined exceed 140 octets', |
||
| 130 | ), |
||
| 131 | array( |
||
| 132 | 'code' => 13, |
||
| 133 | 'message' => 'Communication Failed', |
||
| 134 | 'description' => 'Message was not submitted because there was a communication failure', |
||
| 135 | ), |
||
| 136 | array( |
||
| 137 | 'code' => 14, |
||
| 138 | 'message' => 'Invalid Signature', |
||
| 139 | 'description' => 'Message was not submitted due to a verification failure in the submitted signature', |
||
| 140 | ), |
||
| 141 | array( |
||
| 142 | 'code' => 15, |
||
| 143 | 'message' => 'Invalid sender address', |
||
| 144 | 'description' => 'The sender address (from parameter) was not allowed for this message. Restrictions may apply depending on the destination see https://help.nexmo.com/hc/en-us/sections/200622473-Country-Specific-Features-and-Restrictions', |
||
| 145 | ), |
||
| 146 | array('code' => 16, 'message' => 'Invalid TTL', 'description' => 'The ttl parameter values is invalid'), |
||
| 147 | array( |
||
| 148 | 'code' => 19, |
||
| 149 | 'message' => 'Facility not allowed', |
||
| 150 | 'description' => 'Your request makes use of a facility that is not enabled on your account', |
||
| 151 | ), |
||
| 152 | array( |
||
| 153 | 'code' => 20, |
||
| 154 | 'message' => 'Invalid Message class', |
||
| 155 | 'description' => 'The message class value supplied was out of range (0 - 3)', |
||
| 156 | ), |
||
| 157 | ); |
||
| 158 | } |
||
| 159 | } |
||
| 160 |