| Conditions | 1 |
| Paths | 1 |
| Total Lines | 53 |
| Code Lines | 34 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 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 |
||
| 117 | public function testSetX() { |
||
| 118 | |||
| 119 | $obj = new CURLConfiguration(); |
||
| 120 | |||
| 121 | |||
| 122 | $obj->setAllowEncoding(true); |
||
| 123 | $this->assertEquals(true, $obj->getAllowEncoding()); |
||
| 124 | |||
| 125 | $obj->setConnectTimeout(1); |
||
| 126 | $this->assertEquals(1, $obj->getConnectTimeout()); |
||
| 127 | |||
| 128 | $obj->setDebug(true); |
||
| 129 | $this->assertEquals(true, $obj->getDebug()); |
||
| 130 | |||
| 131 | $obj->setDebugFile("./debugfile.log"); |
||
| 132 | $this->assertEquals("./debugfile.log", $obj->getDebugFile()); |
||
| 133 | |||
| 134 | $obj->setHost("host"); |
||
| 135 | $this->assertEquals("host", $obj->getHost()); |
||
| 136 | |||
| 137 | $obj->setHttpPassword("httpPassword"); |
||
| 138 | $this->assertEquals("httpPassword", $obj->getHttpPassword()); |
||
| 139 | |||
| 140 | $obj->setHttpUsername("httpUsername"); |
||
| 141 | $this->assertEquals("httpUsername", $obj->getHttpUsername()); |
||
| 142 | |||
| 143 | $obj->setProxyHost("proxyHost"); |
||
| 144 | $this->assertEquals("proxyHost", $obj->getProxyHost()); |
||
| 145 | |||
| 146 | $obj->setProxyPassword("proxyPassword"); |
||
| 147 | $this->assertEquals("proxyPassword", $obj->getProxyPassword()); |
||
| 148 | |||
| 149 | $obj->setProxyPort("proxyPort"); |
||
| 150 | $this->assertEquals("proxyPort", $obj->getProxyPort()); |
||
| 151 | |||
| 152 | $obj->setProxyType(1); |
||
| 153 | $this->assertEquals(1, $obj->getProxyType()); |
||
| 154 | |||
| 155 | $obj->setProxyUsername("proxyUsername"); |
||
| 156 | $this->assertEquals("proxyUsername", $obj->getProxyUsername()); |
||
| 157 | |||
| 158 | $obj->setRequestTimeout(1); |
||
| 159 | $this->assertEquals(1, $obj->getRequestTimeout()); |
||
| 160 | |||
| 161 | $obj->setSslVerification(false); |
||
| 162 | $this->assertEquals(false, $obj->getSslVerification()); |
||
| 163 | |||
| 164 | $obj->setUserAgent("userAgent"); |
||
| 165 | $this->assertEquals("userAgent", $obj->getUserAgent()); |
||
| 166 | |||
| 167 | $obj->setVerbose(true); |
||
| 168 | $this->assertEquals(true, $obj->getVerbose()); |
||
| 169 | } |
||
| 170 | |||
| 172 |