Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface's methods should not return concrete class #23

Open
wants to merge 1 commit into
base: 2.13.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/UriInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface UriInterface
/**
* Create a new URI object
*
* @param Uri|string|null $uri
* @param UriInterface|string|null $uri
* @throws Exception\InvalidArgumentException
*/
public function __construct($uri = null);
Expand Down Expand Up @@ -42,7 +42,7 @@ public function isAbsolute();
* Parse a URI string
*
* @param string $uri
* @return Uri
* @return static
*/
public function parse($uri);

Expand All @@ -65,7 +65,7 @@ public function toString();
* Eventually, two normalized URLs pointing to the same resource should be
* equal even if they were originally represented by two different strings
*
* @return Uri
* @return static
*/
public function normalize();

Expand All @@ -79,7 +79,7 @@ public function normalize();
* way related to the base URI) the URI will not be modified.
*
* @param Uri|string $baseUri
* @return Uri
* @return static
*/
public function makeRelative($baseUri);

Expand Down Expand Up @@ -155,15 +155,15 @@ public function getFragment();
*
* @param string $scheme
* @throws Exception\InvalidUriPartException
* @return Uri
* @return static
*/
public function setScheme($scheme);

/**
* Set the URI User-info part (usually user:password)
*
* @param string $userInfo
* @return Uri
* @return static
* @throws Exception\InvalidUriPartException If the schema definition does not have this part.
*/
public function setUserInfo($userInfo);
Expand All @@ -184,23 +184,23 @@ public function setUserInfo($userInfo);
*
* @param string $host
* @throws Exception\InvalidUriPartException
* @return Uri
* @return static
*/
public function setHost($host);

/**
* Set the port part of the URI
*
* @param int $port
* @return Uri
* @return static
*/
public function setPort($port);

/**
* Set the path
*
* @param string $path
* @return Uri
* @return static
*/
public function setPath($path);

Expand All @@ -212,15 +212,15 @@ public function setPath($path);
* PHP's common square bracket notation.
*
* @param string|array $query
* @return Uri
* @return static
*/
public function setQuery($query);

/**
* Set the URI fragment part
*
* @param string $fragment
* @return Uri
* @return static
* @throws Exception\InvalidUriPartException If the schema definition does not have this part.
*/
public function setFragment($fragment);
Expand Down
Loading