| Conditions | 11 | 
| Paths | 48 | 
| Total Lines | 56 | 
| Code Lines | 33 | 
| 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  | 
            ||
| 86 | public function push(): array  | 
            ||
| 87 |     { | 
            ||
| 88 |         if (!$this->curlMultiHandle) { | 
            ||
| 89 | $this->curlMultiHandle = curl_multi_init();  | 
            ||
| 
                                                                                                    
                        
                         | 
                |||
| 90 | |||
| 91 |             if (!defined('CURLPIPE_MULTIPLEX')) { | 
            ||
| 92 |                 define('CURLPIPE_MULTIPLEX', 2); | 
            ||
| 93 | }  | 
            ||
| 94 | |||
| 95 | curl_multi_setopt($this->curlMultiHandle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX);  | 
            ||
| 96 | curl_multi_setopt($this->curlMultiHandle, CURLMOPT_MAX_HOST_CONNECTIONS, $this->maxConcurrentConnections);  | 
            ||
| 97 | }  | 
            ||
| 98 | |||
| 99 | $mh = $this->curlMultiHandle;  | 
            ||
| 100 | |||
| 101 | $i = 0;  | 
            ||
| 102 |         while (!empty($this->notifications) && $i++ < $this->nbConcurrentRequests) { | 
            ||
| 103 | $notification = array_pop($this->notifications);  | 
            ||
| 104 | curl_multi_add_handle($mh, $this->prepareHandle($notification));  | 
            ||
| 105 | }  | 
            ||
| 106 | |||
| 107 |         do { | 
            ||
| 108 | while (($execrun = curl_multi_exec($mh, $running)) == CURLM_CALL_MULTI_PERFORM);  | 
            ||
| 109 | |||
| 110 |             if ($execrun != CURLM_OK) { | 
            ||
| 111 | break;  | 
            ||
| 112 | }  | 
            ||
| 113 | |||
| 114 |             while ($done = curl_multi_info_read($mh)) { | 
            ||
| 115 | $handle = $done['handle'];  | 
            ||
| 116 | |||
| 117 | $result = curl_multi_getcontent($handle);  | 
            ||
| 118 | |||
| 119 | // find out which token the response is about  | 
            ||
| 120 | $token = curl_getinfo($handle, CURLINFO_PRIVATE);  | 
            ||
| 121 | |||
| 122 |                 list($headers, $body) = explode("\r\n\r\n", $result, 2); | 
            ||
| 123 | $statusCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);  | 
            ||
| 124 | $responseCollection[] = new Response($statusCode, $headers, $body, $token);  | 
            ||
| 125 | curl_multi_remove_handle($mh, $handle);  | 
            ||
| 126 | curl_close($handle);  | 
            ||
| 127 | |||
| 128 |                 if (!empty($this->notifications)) { | 
            ||
| 129 | $notification = array_pop($this->notifications);  | 
            ||
| 130 | curl_multi_add_handle($mh, $this->prepareHandle($notification));  | 
            ||
| 131 | }  | 
            ||
| 132 | }  | 
            ||
| 133 | } while ($running);  | 
            ||
| 134 | |||
| 135 |         if ($this->autoCloseConnections) { | 
            ||
| 136 | curl_multi_close($mh);  | 
            ||
| 137 | $this->curlMultiHandle = null;  | 
            ||
| 138 | }  | 
            ||
| 139 | |||
| 140 | return $responseCollection;  | 
            ||
| 141 | }  | 
            ||
| 142 | |||
| 243 | 
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..