| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4.0092 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 12 | public function __construct($method, UriInterface $uri, array $headers = [], $body = 'php://temp', $protocolVersion = '1.1') |
|
| 23 | { |
||
| 24 | 12 | $this->method = $method; |
|
| 25 | 12 | $this->uri = new Uri($uri); |
|
| 26 | |||
| 27 | 12 | if ($body instanceof StreamInterface) { |
|
| 28 | 2 | $this->body = $body; |
|
| 29 | 11 | } else if (is_resource($body)) { |
|
| 30 | $this->body = (new Factory\StreamFactory())->createStreamFromResource($body, "r+"); |
||
|
|
|||
| 31 | 10 | } else if (is_string($body)) { |
|
| 32 | 10 | $this->body = (new Factory\StreamFactory())->createStreamFromFile($body); |
|
| 33 | 5 | } |
|
| 34 | |||
| 35 | 12 | $this->headers = $headers; |
|
| 36 | 12 | $this->protocolVersion = $protocolVersion; |
|
| 37 | 12 | } |
|
| 39 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.