| Conditions | 1 |
| Paths | 1 |
| Total Lines | 106 |
| Code Lines | 69 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 1 |
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 |
||
| 32 | public function configurationDataProvider() |
||
| 33 | { |
||
| 34 | return array( |
||
| 35 | 'server curl transport configuration' => array( |
||
| 36 | 'options' => array( |
||
| 37 | 'notifier' => array( |
||
| 38 | 'server' => array( |
||
| 39 | 'transport' => array( |
||
| 40 | 'type' => 'curl', |
||
| 41 | 'access_token' => 'token', |
||
| 42 | ), |
||
| 43 | ), |
||
| 44 | ), |
||
| 45 | ), |
||
| 46 | 'check config key' => 'notifier', |
||
| 47 | 'expected config' => array( |
||
| 48 | 'server' => array( |
||
| 49 | 'batched' => false, |
||
| 50 | 'batch_size' => '50', |
||
| 51 | 'transport' => array( |
||
| 52 | 'type' => 'curl', |
||
| 53 | 'access_token' => 'token', |
||
| 54 | ), |
||
| 55 | ), |
||
| 56 | ), |
||
| 57 | ), |
||
| 58 | 'server agent transport configuration' => array( |
||
| 59 | 'options' => array( |
||
| 60 | 'notifier' => array( |
||
| 61 | 'server' => array( |
||
| 62 | 'transport' => array( |
||
| 63 | 'type' => 'agent', |
||
| 64 | 'agent_log_location' => '/path/to/log', |
||
| 65 | ), |
||
| 66 | ), |
||
| 67 | ), |
||
| 68 | ), |
||
| 69 | 'check config key' => 'notifier', |
||
| 70 | 'expected config' => array( |
||
| 71 | 'server' => array( |
||
| 72 | 'batched' => false, |
||
| 73 | 'batch_size' => '50', |
||
| 74 | 'transport' => array( |
||
| 75 | 'type' => 'agent', |
||
| 76 | 'agent_log_location' => '/path/to/log', |
||
| 77 | ), |
||
| 78 | ), |
||
| 79 | ), |
||
| 80 | ), |
||
| 81 | 'client js configuration' => array( |
||
| 82 | 'options' => array( |
||
| 83 | 'notifier' => array( |
||
| 84 | 'client' => array( |
||
| 85 | 'access_token' => 'token', |
||
| 86 | ), |
||
| 87 | ), |
||
| 88 | ), |
||
| 89 | 'check config key' => 'notifier', |
||
| 90 | 'expected config' => array( |
||
| 91 | 'client' => array( |
||
| 92 | 'access_token' => 'token', |
||
| 93 | 'source_map_enabled' => false, |
||
| 94 | 'code_version' => '', |
||
| 95 | 'guess_uncaught_frames' => false, |
||
| 96 | 'rollbarjs_version' => 'v1', |
||
| 97 | 'allowed_js_hosts' => array(), |
||
| 98 | ), |
||
| 99 | ), |
||
| 100 | ), |
||
| 101 | 'environment configuration' => array( |
||
| 102 | 'options' => array( |
||
| 103 | 'notifier' => array(), |
||
| 104 | 'environment' => array( |
||
| 105 | 'environment' => 'production', |
||
| 106 | 'branch' => 'master', |
||
| 107 | 'code_version' => '12345', |
||
| 108 | ), |
||
| 109 | ), |
||
| 110 | 'check config key' => 'environment', |
||
| 111 | 'expected config' => array( |
||
| 112 | 'environment' => 'production', |
||
| 113 | 'branch' => 'master', |
||
| 114 | 'root_dir' => '', |
||
| 115 | 'code_version' => '12345', |
||
| 116 | ), |
||
| 117 | ), |
||
| 118 | ); |
||
| 119 | } |
||
| 120 | } |
||
| 121 |