Passed
Push — master ( c0a3a7...3b84a4 )
by Jeroen
58:51
created

HttpProtocolTransport::send()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
ccs 0
cts 2
cp 0
crap 2
1
<?php
2
3
namespace Elgg\Http;
4
5
use Elgg\Http\ResponseTransport;
6
use Symfony\Component\HttpFoundation\Response;
7
8
/**
9
 * Transport for sending responses to HTTP clients via HTTP protocol
10
 *
11
 * @since 2.3
12
 * @access private
13
 */
14
class HttpProtocolTransport implements ResponseTransport {
15
	
16
	/**
17
	 * {@inheritdoc}
18
	 */
19
	public function send(Response $response) {
20
		return $response->send();
0 ignored issues
show
Bug Best Practice introduced by Ismayil Khayredinov
The expression return $response->send() returns the type Symfony\Component\HttpFoundation\Response which is incompatible with the return type mandated by Elgg\Http\ResponseTransport::send() of boolean.

In the issue above, the returned value is violating the contract defined by the mentioned interface.

Let's take a look at an example:

interface HasName {
    /** @return string */
    public function getName();
}

class Name {
    public $name;
}

class User implements HasName {
    /** @return string|Name */
    public function getName() {
        return new Name('foo'); // This is a violation of the ``HasName`` interface
                                // which only allows a string value to be returned.
    }
}
Loading history...
21
	}
22
23
}
24