From 668183f924eab85c95bef61decac6d16e7360c3d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 5 Apr 2009 14:21:37 +0000 Subject: [PATCH] No longer throwing deprecated exceptions --- application/ship-simu/main/class_WorksContract.php | 6 +++--- .../ship-simu/main/companies/class_ShippingCompany.php | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/application/ship-simu/main/class_WorksContract.php b/application/ship-simu/main/class_WorksContract.php index 64333f6..424cd8b 100644 --- a/application/ship-simu/main/class_WorksContract.php +++ b/application/ship-simu/main/class_WorksContract.php @@ -255,7 +255,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { throw new NullPointerException($shipInstance, self::EXCEPTION_IS_NULL_POINTER); } elseif (!is_object($shipInstance)) { // Not an object! ;-( - throw new NoObjectException($shipInstance, self::EXCEPTION_IS_NO_OBJECT); + throw new InvalidObjectException($shipInstance, self::EXCEPTION_IS_NO_OBJECT); } elseif (!$shipInstance instanceof ConstructableShip) { // Does not have the required feature (method) throw new ShipIsInvalidException(array($shipInstance), self::EXCEPTION_INVALID_SHIP_INSTANCE); @@ -284,7 +284,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { throw new NullPointerException($item, self::EXCEPTION_IS_NULL_POINTER); } elseif (!is_object($item)) { // Not an object! ;-( - throw new NoObjectException($item, self::EXCEPTION_IS_NO_OBJECT); + throw new InvalidObjectException($item, self::EXCEPTION_IS_NO_OBJECT); } elseif (!$item instanceof BaseSimulator) { // Does not have the required feature (method) throw new MissingMethodException(array($item, 'getPartInstance'), self::EXCEPTION_MISSING_METHOD); @@ -299,7 +299,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { throw new NullPointerException($part, self::EXCEPTION_IS_NULL_POINTER); } elseif (!is_object($part)) { // Not an object! ;-( - throw new NoObjectException($part, self::EXCEPTION_IS_NO_OBJECT); + throw new InvalidObjectException($part, self::EXCEPTION_IS_NO_OBJECT); } elseif (!method_exists($part, 'getPrice')) { // Does not have the required feature (method) throw new MissingMethodException(array($part, 'getPrice'), self::EXCEPTION_MISSING_METHOD); diff --git a/application/ship-simu/main/companies/class_ShippingCompany.php b/application/ship-simu/main/companies/class_ShippingCompany.php index 972e6e4..9ffb604 100644 --- a/application/ship-simu/main/companies/class_ShippingCompany.php +++ b/application/ship-simu/main/companies/class_ShippingCompany.php @@ -403,7 +403,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); } elseif (!is_object($shipyard)) { // Not an object! ;-( - throw new NoObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); + throw new InvalidObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); } elseif ($shipyard->isClass("Shipyard") === false) { // Nope, so throw exception throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING); @@ -491,7 +491,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); } elseif (!is_object($shipyard)) { // Not an object! ;-( - throw new NoObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); + throw new InvalidObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); } elseif ($shipyard->isClass("Shipyard") === false) { // Class is not a shipyard throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING); @@ -513,7 +513,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); } elseif (!is_object($shipInstance)) { // Not an object! ;-( - throw new NoObjectException($shipInstance, self::EXCEPTION_IS_NO_OBJECT); + throw new InvalidObjectException($shipInstance, self::EXCEPTION_IS_NO_OBJECT); } // Get it's real class name @@ -550,7 +550,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); } elseif (!is_object($shipyard)) { // Not an object! ;-( - throw new NoObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); + throw new InvalidObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); } elseif ($shipyard->isClass("Shipyard") === false) { // Class is not a shipyard throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING); @@ -651,7 +651,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); } elseif (!is_object($contractInstance)) { // Not an object! ;-( - throw new NoObjectException($contractInstance, self::EXCEPTION_IS_NO_OBJECT); + throw new InvalidObjectException($contractInstance, self::EXCEPTION_IS_NO_OBJECT); } elseif ($contractInstance->isClass("WorksContract") === false) { // Is not a merchant throw new ClassMismatchException(array($contractInstance->__toString(), "WorksContract"), self::EXCEPTION_CLASSES_NOT_MATCHING); -- 2.39.2