Completed
Push — 3.x ( 668272...4d1768 )
by Jeroen
156:21 queued 83:40
created

engine/classes/Elgg/Http/HttpProtocolTransport.php (1 issue)

1
<?php
2
3
namespace Elgg\Http;
4
5
use Symfony\Component\HttpFoundation\Response;
6
7
/**
8
 * Transport for sending responses to HTTP clients via HTTP protocol
9
 *
10
 * @since 2.3
11
 * @internal
12
 */
13
class HttpProtocolTransport implements ResponseTransport {
14
	
15
	/**
16
	 * {@inheritdoc}
17
	 *
18
	 * @return Response
19
	 */
20
	public function send(Response $response) {
21
		return $response->send();
0 ignored issues
show
Bug Best Practice introduced by
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...
22
	}
23
24
}
25