From 266c6bfe702d9603bb317f26ba7d5b123dc7693b Mon Sep 17 00:00:00 2001 From: Dennis Meckel Date: Fri, 22 Jul 2016 15:26:52 +0200 Subject: [PATCH] Renamed NoSemanticVersionException to InvalidVersionException --- README.md | 2 +- ...ersionException.php => InvalidVersionException.php} | 4 ++-- src/SemanticVersion.php | 10 +++++----- src/autoload.php | 2 +- tests/SemanticVersionTest.php | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) rename src/{NoSemanticVersionException.php => InvalidVersionException.php} (78%) diff --git a/README.md b/README.md index 60b9c3f..d998321 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Download and extract the library. Then include `src/autoload.php`. The library contains the following classes: -* `NoSemanticVersionException`: Thrown by `SemanticVersion` on invalid input +* `InvalidVersionException`: Thrown by `SemanticVersion` on invalid input * `SemanticComparator`: The semantic versioning comparator for comparing `SemanticVersion` objects diff --git a/src/NoSemanticVersionException.php b/src/InvalidVersionException.php similarity index 78% rename from src/NoSemanticVersionException.php rename to src/InvalidVersionException.php index 91c5040..ecc9ac0 100644 --- a/src/NoSemanticVersionException.php +++ b/src/InvalidVersionException.php @@ -14,8 +14,8 @@ /** * Exception thrown when parsing invalid versions. * - * @since 1.0.0-rc.1 + * @since 1.0.0-rc.3 */ -class NoSemanticVersionException extends RuntimeException +class InvalidVersionException extends RuntimeException { } diff --git a/src/SemanticVersion.php b/src/SemanticVersion.php index 825d13a..0f867d0 100644 --- a/src/SemanticVersion.php +++ b/src/SemanticVersion.php @@ -60,7 +60,7 @@ class SemanticVersion implements SemanticVersionInterface /** * @param string $version - * @throws NoSemanticVersionException On incompatible `$version`. + * @throws InvalidVersionException On incompatible `$version`. */ public function __construct($version) { @@ -90,7 +90,7 @@ public function __toString() /** * @param string $pre - * @throws NoSemanticVersionException + * @throws InvalidVersionException */ private function setPre($pre) { @@ -106,7 +106,7 @@ private function setPre($pre) /** * @param string $meta - * @throws NoSemanticVersionException + * @throws InvalidVersionException */ private function setMeta($meta) { @@ -121,11 +121,11 @@ private function setMeta($meta) } /** - * @return NoSemanticVersionException + * @return InvalidVersionException */ private function buildException() { - return new NoSemanticVersionException(sprintf('Invalid semantic version `%s`.', $this->getVersion())); + return new InvalidVersionException(sprintf('Invalid semantic version `%s`.', $this->getVersion())); } /** diff --git a/src/autoload.php b/src/autoload.php index f82d39e..4163ee7 100644 --- a/src/autoload.php +++ b/src/autoload.php @@ -9,7 +9,7 @@ * @since 1.0.0-rc.1 */ -require_once __DIR__ . '/NoSemanticVersionException.php'; +require_once __DIR__ . '/InvalidVersionException.php'; require_once __DIR__ . '/SemanticComparatorInterface.php'; require_once __DIR__ . '/SemanticComparator.php'; require_once __DIR__ . '/SemanticVersionInterface.php'; diff --git a/tests/SemanticVersionTest.php b/tests/SemanticVersionTest.php index a178c15..88e5fe6 100644 --- a/tests/SemanticVersionTest.php +++ b/tests/SemanticVersionTest.php @@ -142,7 +142,7 @@ public function testValidVersion($version, $major, $minor, $patch, $pre, $meta, /** * @dataProvider provideInvalidVersions - * @expectedException \Rayne\SemanticVersioning\NoSemanticVersionException + * @expectedException \Rayne\SemanticVersioning\InvalidVersionException * @param mixed $version */ public function testInvalidVersion($version)