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

HttpProtocolTransport   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
ccs 0
cts 2
cp 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A send() 0 2 1
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