This repository has been archived by the owner on Nov 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace ParserException by Exception
- Loading branch information
Showing
5 changed files
with
33 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,65 +22,65 @@ | |
* @author Ignace Nyamagana Butera <[email protected]> | ||
* @since 0.2.0 | ||
*/ | ||
class ParserException extends InvalidArgumentException | ||
class Exception extends InvalidArgumentException | ||
{ | ||
/** | ||
* Returns a new Instance from an error in URI characters | ||
* | ||
* @param string $uri | ||
* | ||
* @return self | ||
* @return static | ||
*/ | ||
public static function createFromInvalidCharacters($uri) | ||
{ | ||
return new self(sprintf('The submitted uri `%s` contains invalid characters', $uri)); | ||
return new static(sprintf('The submitted uri `%s` contains invalid characters', $uri)); | ||
} | ||
|
||
/** | ||
* Returns a new Instance from an error in URI characters | ||
* | ||
* @param string $uri | ||
* | ||
* @return self | ||
* @return static | ||
*/ | ||
public static function createFromInvalidScheme($uri) | ||
{ | ||
return new self(sprintf('The submitted uri `%s` contains an invalid scheme', $uri)); | ||
return new static(sprintf('The submitted uri `%s` contains an invalid scheme', $uri)); | ||
} | ||
|
||
/** | ||
* Returns a new Instance from an error in Host validation | ||
* | ||
* @param string $host | ||
* | ||
* @return self | ||
* @return static | ||
*/ | ||
public static function createFromInvalidHost($host) | ||
{ | ||
return new self(sprintf('The submitted host `%s` is invalid', $host)); | ||
return new static(sprintf('The submitted host `%s` is invalid', $host)); | ||
} | ||
|
||
/** | ||
* Returns a new Instance from an error in port validation | ||
* | ||
* @param string $port | ||
* | ||
* @return self | ||
* @return static | ||
*/ | ||
public static function createFromInvalidPort($port) | ||
{ | ||
return new self(sprintf('The submitted port `%s` is invalid', $port)); | ||
return new static(sprintf('The submitted port `%s` is invalid', $port)); | ||
} | ||
|
||
/** | ||
* Returns a new Instance from an error in Uri path component | ||
* | ||
* @param string $uri | ||
* | ||
* @return self | ||
* @return static | ||
*/ | ||
public static function createFromInvalidPath($uri) | ||
{ | ||
return new self(sprintf('The submitted uri `%s` contains an invalid path', $uri)); | ||
return new static(sprintf('The submitted uri `%s` contains an invalid path', $uri)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters