Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
90.91% |
10 / 11 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| Uri | |
90.91% |
10 / 11 |
|
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
| __construct | |
90.91% |
10 / 11 |
|
0.00% |
0 / 1 |
2.00 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BO\Zmsclient\Psr7; |
| 4 | |
| 5 | use Slim\Psr7\Factory\UriFactory; |
| 6 | |
| 7 | /** |
| 8 | * Layer to change PSR7 implementation if necessary |
| 9 | */ |
| 10 | class Uri extends \Slim\Psr7\Uri implements \Psr\Http\Message\UriInterface |
| 11 | { |
| 12 | public function __construct( |
| 13 | $schemeOrUri = '', |
| 14 | $host = null, |
| 15 | $port = null, |
| 16 | $path = '/', |
| 17 | $query = '', |
| 18 | $fragment = '', |
| 19 | $user = '', |
| 20 | $password = '' |
| 21 | ) { |
| 22 | if ($host !== null) { |
| 23 | parent::__construct($schemeOrUri, $host, $port, $path, $query, $fragment, $user, $password); |
| 24 | } else { |
| 25 | $temp = (new UriFactory())->createUri($schemeOrUri); |
| 26 | $this->scheme = $temp->scheme; |
| 27 | $this->host = $temp->host; |
| 28 | $this->port = $temp->port; |
| 29 | $this->path = $temp->path; |
| 30 | $this->query = $temp->query; |
| 31 | $this->fragment = $temp->fragment; |
| 32 | $this->user = $temp->user; |
| 33 | $this->password = $temp->password; |
| 34 | } |
| 35 | } |
| 36 | } |