X-Git-Url: https://git.mxchange.org/?p=shipsimu.git;a=blobdiff_plain;f=application%2Fship-simu%2Fmain%2Fclass_WorksContract.php;h=bbe2f35aaad07e1fddf0156b640647d5057507bc;hp=64333f6bbc02e522a96a77edafedd69629a54e3f;hb=4f70843ae8428f051d70ccff5bb43fc4c03dda8d;hpb=2b7c3e43b2fe0f3c5ae0455d13fa7743b638049f diff --git a/application/ship-simu/main/class_WorksContract.php b/application/ship-simu/main/class_WorksContract.php index 64333f6..bbe2f35 100644 --- a/application/ship-simu/main/class_WorksContract.php +++ b/application/ship-simu/main/class_WorksContract.php @@ -2,11 +2,11 @@ /** * The work constract class which can be used for contract parties * - * @author Roland Haeder + * @author Roland Haeder * @version 0.0.0 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org + * @link http://www.shipsimu.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,14 +44,10 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Clean up a little - $this->removeSystemArray(); - $this->removeNumberFormaters(); } // Neuen Bauvertrag generieren - public final static function createWorksContract ($shipType, $shipName, ContractPartner $partnerInstance) { + public static final function createWorksContract ($shipType, $shipName, ContractPartner $partnerInstance) { // Strings absichern $shipType = (string) $shipType; $shipName = (string) $shipName; @@ -65,7 +61,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { // Existiert die Klasse ueberhaupt? if (!class_exists($shipType)) { // Klasse nicht gefunden - throw new ClassNotFoundException ($shipType, self::EXCEPTION_CLASS_NOT_FOUND); + throw new NoClassException ($shipType, self::EXCEPTION_CLASS_NOT_FOUND); } // Schiff-Instanz temporaer erzeugen und in den Bauvertrag einfuegen @@ -144,9 +140,9 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { $this->getShipInstance()->getShipName() )); } - } catch (ClassNotFoundException $e) { + } catch (NoClassException $e) { // Throw it again... - throw new ClassNotFoundException($e->getMessage(), $e->getCode()); + throw new NoClassException($e->getMessage(), $e->getCode()); } // Get price for this item @@ -255,7 +251,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 +280,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 +295,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);