From a76d51b4096b47436e269156547f02713d95af5b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 8 Mar 2008 12:51:42 +0000 Subject: [PATCH] getter, setter are all final; several code clean-ups --- .../selector/class_ApplicationSelector.php | 4 +- application/ship-simu/init.php | 2 +- .../ship-simu/main/class_BasePersonell.php | 14 ++-- .../ship-simu/main/class_BaseSimulator.php | 8 +-- application/ship-simu/main/class_Merchant.php | 12 ++-- .../ship-simu/main/class_WorksContract.php | 22 +++--- .../main/companies/class_ShippingCompany.php | 68 ++++++++++++------- .../constructions/class_BaseConstruction.php | 9 ++- .../constructions/harbors/class_Harbor.php | 4 +- .../constructions/yards/class_Shipyard.php | 14 ++-- .../ship-simu/main/drives/class_BaseDrive.php | 17 +++-- .../main/drives/motor/class_Motor.php | 2 +- .../main/parts/class_BaseShipPart.php | 13 ++-- .../parts/maschineroom/class_MaschineRoom.php | 2 +- .../personell/class_SimulatorPersonell.php | 17 ++--- .../ship-simu/main/ships/class_BaseShip.php | 21 +++--- .../ships/passenger/class_PassengerShip.php | 8 +-- .../main/structures/class_BaseStructure.php | 15 ++-- .../extended/cabines/class_BaseCabin.php | 36 +++------- .../cabines/ship/class_EconomyCabin.php | 2 +- .../extended/cabines/ship/class_LowCabin.php | 2 +- .../cabines/ship/class_LuxuryCabin.php | 2 +- .../cabines/ship/class_PremierCabin.php | 2 +- .../extended/class_BaseCabinStructure.php | 21 +++--- .../extended/class_BaseDeckStructure.php | 11 ++- .../extended/class_BaseUpperStructure.php | 27 -------- .../extended/decks/cargo/class_CarDeck.php | 6 +- .../extended/decks/cargo/class_TrainDeck.php | 6 +- .../extended/decks/cargo/class_TruckDeck.php | 6 +- .../extended/decks/class_BaseDeck.php | 38 +++-------- .../extended/upper/class_Bridge.php | 2 +- .../main/class_BaseFrameworkSystem.php | 14 ++-- .../classes/class_LocalFileDatabase.php | 2 +- tests/contract-test.php | 4 +- 34 files changed, 210 insertions(+), 223 deletions(-) diff --git a/application/selector/class_ApplicationSelector.php b/application/selector/class_ApplicationSelector.php index bd3a86b..cbfc91d 100644 --- a/application/selector/class_ApplicationSelector.php +++ b/application/selector/class_ApplicationSelector.php @@ -283,7 +283,7 @@ class ApplicationSelector extends BaseFrameworkSystem { * @return void * @see LanguageSystem */ - public function setLanguageInstance (ManageableLanguage $langInstance) { + public final function setLanguageInstance (ManageableLanguage $langInstance) { $this->langInstance = $langInstance; } @@ -293,7 +293,7 @@ class ApplicationSelector extends BaseFrameworkSystem { * @param $fileIOInstance An instance to the file I/O sub-system * @return void */ - public function setFileIOInstance (FileIOHandler $fileIOInstance) { + public final function setFileIOInstance (FileIOHandler $fileIOInstance) { $this->fileIOInstance = $fileIOInstance; } diff --git a/application/ship-simu/init.php b/application/ship-simu/init.php index 0446060..b14230c 100644 --- a/application/ship-simu/init.php +++ b/application/ship-simu/init.php @@ -7,7 +7,7 @@ // You can prevent adding this application to the selector by uncommenting the // following line: // -// if ((isset($this)) && (is_object($this)) && ($this->isClass("ApplicationSelector"))) { return; } +// if ((isset($this)) && (is_object($this)) && ($this->isSameClass("ApplicationSelector"))) { return; } // // isset() is required to prevent a warning and is_object() is highly required // when the application itself is requested in URL (hint: index.php?app=your_app) diff --git a/application/ship-simu/main/class_BasePersonell.php b/application/ship-simu/main/class_BasePersonell.php index 09e3576..d79a0d8 100644 --- a/application/ship-simu/main/class_BasePersonell.php +++ b/application/ship-simu/main/class_BasePersonell.php @@ -141,7 +141,7 @@ class BasePersonell extends BaseFrameworkSystem implements Personellizer { } // Getter for surname - public function getSurname () { + public final function getSurname () { return $this->surname; } @@ -203,35 +203,35 @@ class BasePersonell extends BaseFrameworkSystem implements Personellizer { } // Remove gender - public function removeGender () { + public final function removeGender () { unset($this->gender); } // Remove both names - public function removeNames () { + public final function removeNames () { unset($this->surname); unset($this->family); } // Remove complete birthday - public function removeBirthday () { + public final function removeBirthday () { unset($this->yearBirth); unset($this->monthBirth); unset($this->dayBirth); } // Remove salary - public function removeSalary () { + public final function removeSalary () { unset($this->salary); } // Remove employment status - public function removeEmployed () { + public final function removeEmployed () { unset($this->employed); } // Remove marrital status - public function removeMarried () { + public final function removeMarried () { unset($this->married); } } diff --git a/application/ship-simu/main/class_BaseSimulator.php b/application/ship-simu/main/class_BaseSimulator.php index a63ce11..5671ee2 100644 --- a/application/ship-simu/main/class_BaseSimulator.php +++ b/application/ship-simu/main/class_BaseSimulator.php @@ -33,7 +33,7 @@ class BaseSimulator extends BaseFrameworkSystem { // Set part description and class name $this->setPartDescr("Simulator-Basis-Einheit"); - // Etwas aufraeumen, dies sollte ganz zum Schluss erfolgen! + // Clean up a little, dies sollte ganz zum Schluss erfolgen! $this->removeResizeFactorArray(); $this->removeCurrPart(); $this->removeCurrShip(); @@ -233,7 +233,7 @@ class BaseSimulator extends BaseFrameworkSystem { ), 1); } - // Nochmals etwas aufraeumen + // Nochmals Clean up a little $this->removeResizeFactorArray(); $this->removeCurrShip(); $this->removeCurrPart(); @@ -303,7 +303,7 @@ class BaseSimulator extends BaseFrameworkSystem { } // Getter-Methode fuer Element aus resizeFactor - public function getResizeFactorElement ($el) { + public final function getResizeFactorElement ($el) { if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] getResizeFactorElement erreicht. (element=%s)
\n", $this->__toString(), $el @@ -318,7 +318,7 @@ class BaseSimulator extends BaseFrameworkSystem { } // Setter-Methode fuer Element in resizeFactor - public function setResizeFactorElement ($el, $value) { + public final function setResizeFactorElement ($el, $value) { if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Umberechnungsfaktor %s=%s gesetzt.
\n", $this->__toString(), $el, diff --git a/application/ship-simu/main/class_Merchant.php b/application/ship-simu/main/class_Merchant.php index b45e8ee..3f13a63 100644 --- a/application/ship-simu/main/class_Merchant.php +++ b/application/ship-simu/main/class_Merchant.php @@ -39,7 +39,7 @@ class Merchant extends BaseFrameworkSystem { // String absichern $merchantName = (string) $merchantName; - // Instanz holen + // Get new instance $merchantInstance = new Merchant(); // Debug message @@ -76,7 +76,7 @@ class Merchant extends BaseFrameworkSystem { } // Setter for merchant name - public function setMerchantName ($merchantName) { + public final function setMerchantName ($merchantName) { // Secure string $merchantName = (string) $merchantName; @@ -90,7 +90,7 @@ class Merchant extends BaseFrameworkSystem { } // Getter for merchant name - public function getMerchantName () { + public final function getMerchantName () { if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Händlername %s wird verlangt.
\n", __CLASS__, __LINE__, @@ -100,7 +100,7 @@ class Merchant extends BaseFrameworkSystem { } // Setter for harbor instance - public function setHarborInstance (Harbor $harborInstance) { + public final function setHarborInstance (Harbor $harborInstance) { if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Händler %s lässt sich am %s nieder.
\n", __CLASS__, __LINE__, @@ -111,7 +111,7 @@ class Merchant extends BaseFrameworkSystem { } // Getter for harbor instance - public function getHarborInstance () { + public final function getHarborInstance () { if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Händler %s hat sich am %s niedergelassen.
\n", __CLASS__, __LINE__, @@ -147,7 +147,7 @@ class Merchant extends BaseFrameworkSystem { } // Get a price from the merchant's list - public function getPriceFromList (ItemIsTradeable $itemInstance) { + public final function getPriceFromList (ItemIsTradeable $itemInstance) { $price = 0; // Iterate throw whole list diff --git a/application/ship-simu/main/class_WorksContract.php b/application/ship-simu/main/class_WorksContract.php index c1e3dab..d2d4aec 100644 --- a/application/ship-simu/main/class_WorksContract.php +++ b/application/ship-simu/main/class_WorksContract.php @@ -61,7 +61,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { throw new MissingMethodException(array($partnerInstance, 'isContractPartner'), self::EXCEPTION_MISSING_METHOD); } - // Instanz holen + // Get new instance $contractInstance = new WorksContract(); // Debug-Meldung ausgeben @@ -127,7 +127,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { } // Getter for ship name - public function getShipName () { + public final function getShipName () { if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Schiffsname %s angefordert.
\n", __CLASS__, __LINE__, @@ -137,7 +137,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { } // Getter for ship instance - public function getShipInstance () { + public final function getShipInstance () { if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Schiff-Instanz angefordert.
\n", __CLASS__, __LINE__ @@ -258,27 +258,27 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { } // Setter for contract partner - public function setContractPartner (ContractPartner $partnerInstance) { + public final function setContractPartner (ContractPartner $partnerInstance) { $this->contractPartner = $partnerInstance; } // Getter for contract partner - public function getContractPartner () { + public final function getContractPartner () { return $this->contractPartner; } // Setter for contract party - public function setContractParty (ContractPartner $partyInstance) { + public final function setContractParty (ContractPartner $partyInstance) { $this->contractParty = $partyInstance; } // Getter for contract party - public function getContractParty () { + public final function getContractParty () { return $this->contractParty; } // Setter for signature - public function setSigned ($signed) { + public final function setSigned ($signed) { $this->signed = (boolean) $signed; } @@ -336,17 +336,17 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract { } // Setter for merchant instance - public function setMerchantInstance (Merchant $merchantInstance) { + public final function setMerchantInstance (Merchant $merchantInstance) { $this->merchantInstance = $merchantInstance; } // Getter for merchant instance - public function getMerchantInstance () { + public final function getMerchantInstance () { return $this->merchantInstance; } // Getter for total price - public function getTotalPrice () { + public final function getTotalPrice () { // Get ship instance $shipInstance = $this->getShipInstance(); diff --git a/application/ship-simu/main/companies/class_ShippingCompany.php b/application/ship-simu/main/companies/class_ShippingCompany.php index bac3bbf..3fca7ea 100644 --- a/application/ship-simu/main/companies/class_ShippingCompany.php +++ b/application/ship-simu/main/companies/class_ShippingCompany.php @@ -2,31 +2,51 @@ // Die Reederei-Klasse class ShippingCompany extends BaseSimulator implements Customer, ContractPartner { - // Firmenname + /** + * Full name of this company + */ private $companyName = "Namenlose Reederei"; - // Firmenkuerzel + /** + * Shorted name of this company + */ private $shortName = ""; - // Reederei-Gruender + /** + * Instance of the founder + */ private $founderInstance = null; - // Angestellten-Liste + /** + * Employed people by this company + */ private $employeeList = null; - // Zugewiesener Hafen + /** + * Headquarter harbor instance + */ private $hqInstance = null; - // Werftenliste + /** + * List of all assigned shipyards + */ private $shipyardList = null; - // Der Reederei gehoerenden Schiffe + /** + * List of owned ships + */ private $ownedShips = null; - // Bauauftraege als Kunde + /** + * Work constracts this company is currently working on + */ private $contractList = null; - // Konstruktor + /** + * Main constructor + * + * @return void + */ private function __construct () { // Call parent constructor parent::constructor(__CLASS__); @@ -51,7 +71,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Reederei gruenden (create wegen Namenskonvention) public static function createShippingCompany ($companyName, Harbor $hqInstance) { - // Instanz holen + // Get new instance $companyInstance = new ShippingCompany(); if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $companyInstance->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s wird gegründet.
\n", @@ -78,7 +98,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner // Auftragsliste erstellen $companyInstance->createContractList(); - // Etwas aufraeumen + // Clean up a little $companyInstance->removeWidth(); $companyInstance->removeHeight(); $companyInstance->removeLength(); @@ -120,17 +140,17 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner } // Setter-Methode fuer Firmennamen - public function setCompanyName ($companyName) { + public final function setCompanyName ($companyName) { $this->companyName = (string) $companyName; } // Getter-Methode fuer Firmennamen - public function getCompanyName () { + public final function getCompanyName () { return $this->companyName; } // Setter-Methode fuer Firmensitz - public function setHQInstance (Harbor $hqInstance) { + public final function setHQInstance (Harbor $hqInstance) { $this->hqInstance = $hqInstance; } @@ -165,7 +185,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner } // Setter fuer Reederei-Gruender - public function setCompanyFounder(CompanyEmployee $founderInstance) { + public final function setCompanyFounder(CompanyEmployee $founderInstance) { if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei %s ist von %s %s gegründet worden.
\n", __CLASS__, __LINE__, @@ -177,7 +197,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner } // Getter for founder instance - public function getFounderInstance () { + public final function getFounderInstance () { return $this->founderInstance; } @@ -327,7 +347,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner } elseif (!is_object($shipyard)) { // Not an object! ;-( throw new NoObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); - } elseif (!$shipyard->isClass("Shipyard")) { + } elseif (!$shipyard->isSameClass("Shipyard")) { // Nope, so throw exception throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING); } @@ -341,7 +361,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner } // Getter for total employees - public function getTotalEmployee () { + public final function getTotalEmployee () { // Count all... $total = $this->employeeList->count(); @@ -358,7 +378,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner } // Getter for total shipyards - public function getTotalShipyards () { + public final function getTotalShipyards () { if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Für die Reederei %s werden die Anzahl der Werften in allen Häfen ermittelt.
\n", __CLASS__, __LINE__, @@ -423,7 +443,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner } elseif (!is_object($shipyard)) { // Not an object! ;-( throw new NoObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); - } elseif (!$shipyard->isClass("Shipyard")) { + } elseif (!$shipyard->isSameClass("Shipyard")) { // Class is not a shipyard throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING); } @@ -498,7 +518,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner } elseif (!is_object($shipyard)) { // Not an object! ;-( throw new NoObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); - } elseif (!$shipyard->isClass("Shipyard")) { + } elseif (!$shipyard->isSameClass("Shipyard")) { // Class is not a shipyard throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING); } @@ -540,7 +560,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner } // Get latest added contract instance - public function getLastContractInstance () { + public final function getLastContractInstance () { // Get iterator $iter = $this->contractList->getIterator(); @@ -596,7 +616,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner } // Setter for merchant instance - public function setMerchantInstance (Merchant $merchantInstance) { + public final function setMerchantInstance (Merchant $merchantInstance) { // Get contract $contractInstance = $this->getLastContractInstance(); @@ -606,7 +626,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner } elseif (!is_object($contractInstance)) { // Not an object! ;-( throw new NoObjectException($contractInstance, self::EXCEPTION_IS_NO_OBJECT); - } elseif (!$contractInstance->isClass('WorksContract')) { + } elseif (!$contractInstance->isSameClass('WorksContract')) { // Is not a merchant throw new ClassMismatchException(array($contractInstance->__toString(), "WorksContract"), self::EXCEPTION_CLASSES_NOT_MATCHING); } diff --git a/application/ship-simu/main/constructions/class_BaseConstruction.php b/application/ship-simu/main/constructions/class_BaseConstruction.php index 014d278..8edd23d 100644 --- a/application/ship-simu/main/constructions/class_BaseConstruction.php +++ b/application/ship-simu/main/constructions/class_BaseConstruction.php @@ -17,11 +17,16 @@ class BaseConstruction extends BaseSimulator { // Set description $this->setPartDescr("Namenlose Landkonstruktion"); - // Etwas aufraeumen (brauchen wir hier nicht) + // Clean up a little $this->removeNumberFormaters(); } - // Konstruktor aufrufen + /** + * Calls the private constructor + * + * @param $class The class' name + * @return void + */ public function constructor ($class) { $this->__construct($class); } diff --git a/application/ship-simu/main/constructions/harbors/class_Harbor.php b/application/ship-simu/main/constructions/harbors/class_Harbor.php index 2dd43ea..2a687b0 100644 --- a/application/ship-simu/main/constructions/harbors/class_Harbor.php +++ b/application/ship-simu/main/constructions/harbors/class_Harbor.php @@ -63,13 +63,13 @@ class Harbor extends BaseConstruction { } // Setter fuer Hafennamen - public function setHarborName ($harborName) { + public final function setHarborName ($harborName) { if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[Harbor:] Der Hafen heisst jetzt %s.
\n", $harborName)); $this->harborName = (string) $harborName; } // Getter fuer Hafennamen - public function getHarborName () { + public final function getHarborName () { if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[Harbor:] Hafenname %s wurde angefordert.
\n", $this->harborName)); return $this->harborName; } diff --git a/application/ship-simu/main/constructions/yards/class_Shipyard.php b/application/ship-simu/main/constructions/yards/class_Shipyard.php index fa2dde0..641ffee 100644 --- a/application/ship-simu/main/constructions/yards/class_Shipyard.php +++ b/application/ship-simu/main/constructions/yards/class_Shipyard.php @@ -86,7 +86,7 @@ class Shipyard extends BaseConstruction { $shipyardInstance->setHeight(30); $shipyardInstance->setLength(100); - // Etwas aufraeumen + // Clean up a little $shipyardInstance->removeDraught(); $shipyardInstance->removeSystemArray(); @@ -122,32 +122,32 @@ class Shipyard extends BaseConstruction { } // Setter-Methode fuer Werft-Name - public function setShipyardName ($shipyardName) { + public final function setShipyardName ($shipyardName) { $this->shipyardName = (string) $shipyardName; } // Getter-Methode fuer Werft-Name - public function getShipyardName () { + public final function getShipyardName () { return $this->shipyardName; } // Setter-Methode fuer Hafen-Instanz - public function setHarborInstance (Harbor $harborInstance) { + public final function setHarborInstance (Harbor $harborInstance) { $this->harborInstance = $harborInstance; } // Getter-Methode fuer Hafen-Instanz - public function getHarborInstance () { + public final function getHarborInstance () { return $this->harborInstance; } // Setter fuer Reederei-Instanz - public function setCompanyInstance (ShippingCompany $companyInstance) { + public final function setCompanyInstance (ShippingCompany $companyInstance) { $this->shippingCompany = $companyInstance; } // Getter fuer Reederei-Instanz - public function getCompanyInstance () { + public final function getCompanyInstance () { return $this->shippingCompany; } diff --git a/application/ship-simu/main/drives/class_BaseDrive.php b/application/ship-simu/main/drives/class_BaseDrive.php index bda42a4..ad52dd2 100644 --- a/application/ship-simu/main/drives/class_BaseDrive.php +++ b/application/ship-simu/main/drives/class_BaseDrive.php @@ -25,18 +25,23 @@ class BaseDrive extends BaseSimulator { // Set description $this->setPartDescr("Namenloser Antrieb"); - // Etwas aufraeumen + // Clean up a little $this->removeNumberFormaters(); $this->removePartInstance(); } - // Konstruktor aufrufen + /** + * Calls the private constructor + * + * @param $class The class' name + * @return void + */ public function constructor ($class) { $this->__construct($class); } // Setter-Methode fuert PS-Zahl - public function setHorsePower ($hp) { + public final function setHorsePower ($hp) { if ((defined('DEBUG_DRIVE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Antriebsleistung wird auf %d PS gesetzt.
\n", __CLASS__, __LINE__, @@ -46,7 +51,7 @@ class BaseDrive extends BaseSimulator { } // Setter-Methode fuer Nockenanzahl - public function setNumCams ($cams) { + public final function setNumCams ($cams) { if ((defined('DEBUG_DRIVE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Nockenanzahl wird auf %d Nocken gesetzt.
\n", __CLASS__, __LINE__, @@ -56,12 +61,12 @@ class BaseDrive extends BaseSimulator { } // Setter for price - public function setPrice ($price) { + public final function setPrice ($price) { $this->price = (float) $price; } // Getter for price - public function getPrice () { + public final function getPrice () { return $this->price; } diff --git a/application/ship-simu/main/drives/motor/class_Motor.php b/application/ship-simu/main/drives/motor/class_Motor.php index 645741b..42e75f4 100644 --- a/application/ship-simu/main/drives/motor/class_Motor.php +++ b/application/ship-simu/main/drives/motor/class_Motor.php @@ -27,7 +27,7 @@ class Motor extends BaseDrive implements ItemIsTradeable, ConstructableShipPart // Einen Motor erstellen public static function createMotor ($descr, $hp, $cams, $w, $h, $l) { - // Instanz holen + // Get new instance $motorInstance = new Motor(); // Debug message diff --git a/application/ship-simu/main/parts/class_BaseShipPart.php b/application/ship-simu/main/parts/class_BaseShipPart.php index becf6c8..8a95e54 100644 --- a/application/ship-simu/main/parts/class_BaseShipPart.php +++ b/application/ship-simu/main/parts/class_BaseShipPart.php @@ -21,22 +21,27 @@ class BaseShipPart extends BaseSimulator { // Beschreibung $this->setPartDescr("Schiffsteil"); - // Etwas aufraeumen + // Clean up a little $this->removeNumberFormaters(); } - // Konstruktor aufrufen + /** + * Calls the private constructor + * + * @param $class The class' name + * @return void + */ public function constructor ($class) { $this->__construct($class); } // Setter for price - public function setPrice ($price) { + public final function setPrice ($price) { $this->price = (float) $price; } // Getter for price - public function getPrice () { + public final function getPrice () { return $this->price; } diff --git a/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php b/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php index 478ace6..f2ef225 100644 --- a/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php +++ b/application/ship-simu/main/parts/maschineroom/class_MaschineRoom.php @@ -27,7 +27,7 @@ class MaschineRoom extends BaseShipPart { // Maschinenraum erstellen public static function createMaschineRoom () { - // Instanz holen + // Get new instance $roomInstance = new MaschineRoom(); // Debug message diff --git a/application/ship-simu/main/personell/class_SimulatorPersonell.php b/application/ship-simu/main/personell/class_SimulatorPersonell.php index b46bb03..532ca3f 100644 --- a/application/ship-simu/main/personell/class_SimulatorPersonell.php +++ b/application/ship-simu/main/personell/class_SimulatorPersonell.php @@ -55,7 +55,7 @@ class SimulatorPersonell extends BasePersonell { * * @param $amountPersonell Number of personell we shall * generate - * @return $personellInstance An instance of this object with a + * @return $personellInstance An instance of this object with a * list of personells */ public static function createSimulatorPersonell ($amountPersonell) { @@ -65,9 +65,6 @@ class SimulatorPersonell extends BasePersonell { // Get a new instance $personellInstance = new SimulatorPersonell(); - // Generate unique ID number - $personellInstance->createUniqueID(); - // Debug message if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $personellInstance->getDebugInstance()->output(sprintf("[%s:%d] Es werden %d Personal bereitgestellt.
\n", __CLASS__, @@ -80,7 +77,7 @@ class SimulatorPersonell extends BasePersonell { // Create requested amount of personell for ($idx = 0; $idx < $amountPersonell; $idx++) { - $personellInstance->addPersonell(); + $personellInstance->addRandomPersonell(); } // Debug message @@ -110,7 +107,7 @@ class SimulatorPersonell extends BasePersonell { * list from an existing database backend * * @param $idNumber The ID number (only right part) of the list - * @return $personellInstance An instance of + * @return $personellInstance An instance of * @throws InvalidIDFormatException If the given id number * $idNumber is invalid * @throws NullPointerException If a null pointer (instance) @@ -201,7 +198,7 @@ class SimulatorPersonell extends BasePersonell { } // Add new personell object to our list - public function addPersonell () { + public function addRandomPersonell () { // Gender list... $genders = array('M', 'F'); @@ -286,7 +283,7 @@ class SimulatorPersonell extends BasePersonell { * * @return $count Amount of unemployed personell */ - public function getAllUnemployed () { + public final function getAllUnemployed () { if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Es werden alle erwerbslosen Personen gesucht.
\n", __CLASS__, __LINE__ @@ -379,7 +376,7 @@ class SimulatorPersonell extends BasePersonell { * @return void */ public function saveObjectToDatabase () { - // Get the database + // Get the database $dbInstance = $this->getDatabaseInstance(); // Prepare the limitation object. We just need the personellList array object. @@ -397,7 +394,7 @@ class SimulatorPersonell extends BasePersonell { * * @return $personellList The list of all personells */ - public function getPersonellList () { + public final function getPersonellList () { return $this->personellList; } diff --git a/application/ship-simu/main/ships/class_BaseShip.php b/application/ship-simu/main/ships/class_BaseShip.php index d7c394b..6893740 100644 --- a/application/ship-simu/main/ships/class_BaseShip.php +++ b/application/ship-simu/main/ships/class_BaseShip.php @@ -32,13 +32,18 @@ class BaseShip extends BaseSimulator { // Array-Objekt generieren $this->createStructuresArray(); - + // Instanz entfernen $this->removePartInstance(); $this->removeNumberFormaters(); } - // Konstruktor aufrufen + /** + * Calls the private constructor + * + * @param $class The class' name + * @return void + */ public function constructor ($class) { $this->__construct($class); } @@ -156,7 +161,7 @@ class BaseShip extends BaseSimulator { } // Getter-Methode fuer Strukturen-Array - public function getStructuresArray () { + public final function getStructuresArray () { return $this->structures; } @@ -167,7 +172,7 @@ class BaseShip extends BaseSimulator { } // Setter-Methode fuer Schiffsnamen - public function setShipName ($shipName) { + public final function setShipName ($shipName) { // Cast the string $shipName = (string) $shipName; @@ -184,7 +189,7 @@ class BaseShip extends BaseSimulator { } // Getter-Methode fuer Schiffsnamen - public function getShipName () { + public final function getShipName () { if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das %s ist auf den Namen %s getauft worden.
\n", __CLASS__, __LINE__, @@ -195,7 +200,7 @@ class BaseShip extends BaseSimulator { } // Setter-Methode fuer Tiefgang - public function setDraught ($draught) { + public final function setDraught ($draught) { if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das %s mit dem Namen %s hat einen Tiefgang von %sm.
\n", __CLASS__, __LINE__, @@ -207,7 +212,7 @@ class BaseShip extends BaseSimulator { } // Getter-Methode fuer Tiefgang - public function getDraught() { + public final function getDraught() { if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Tiefgang des Schiffes %s wurde angefordert.
\n", __CLASS__, __LINE__, @@ -217,7 +222,7 @@ class BaseShip extends BaseSimulator { } // Setter-Methode fuer Anzahl Anker - public function setNumAnchor ($numAnchor) { + public final function setNumAnchor ($numAnchor) { if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das %s mit dem Namen %s hat %s Anker.
\n", __CLASS__, __LINE__, diff --git a/application/ship-simu/main/ships/passenger/class_PassengerShip.php b/application/ship-simu/main/ships/passenger/class_PassengerShip.php index 9c53ed9..c5dfc01 100644 --- a/application/ship-simu/main/ships/passenger/class_PassengerShip.php +++ b/application/ship-simu/main/ships/passenger/class_PassengerShip.php @@ -1,6 +1,6 @@ getPartInstance(); if (!is_null($cab)) { @@ -103,7 +103,7 @@ class PassengerShip extends BaseShip implements ConstructableShip { $this->getShipName(), $numBeds )); - + // Anzahl zurueckliefern return $numBeds; } diff --git a/application/ship-simu/main/structures/class_BaseStructure.php b/application/ship-simu/main/structures/class_BaseStructure.php index 83c1d63..007f9bf 100644 --- a/application/ship-simu/main/structures/class_BaseStructure.php +++ b/application/ship-simu/main/structures/class_BaseStructure.php @@ -20,27 +20,32 @@ class BaseStructure extends BaseSimulator { // Set description $this->setPartDescr("Schiffsstrukturen"); - // Etwas aufraeumen + // Clean up a little $this->removeNumberFormaters(); } - // Konstruktor aufrufen + /** + * Calls the private constructor + * + * @param $class The class' name + * @return void + */ public function constructor ($class) { $this->__construct($class); } // Setter for price - public function setPrice ($price) { + public final function setPrice ($price) { $this->price = (float) $price; } // Getter for price - public function getPrice () { + public final function getPrice () { return $this->price; } // Remove price - public function removePrice () { + public function removePrice () { unset($this->price); } } diff --git a/application/ship-simu/main/structures/extended/cabines/class_BaseCabin.php b/application/ship-simu/main/structures/extended/cabines/class_BaseCabin.php index 2500226..b12cfcd 100644 --- a/application/ship-simu/main/structures/extended/cabines/class_BaseCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/class_BaseCabin.php @@ -6,7 +6,7 @@ class BaseCabin extends BaseCabinStructure { // Call parent constructor parent::constructor($class); - //�Debug message + // Debug message if (((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) { $this->getDebugInstance()->output(sprintf("[%s:%d] Konstruktor erreicht.
\n", __CLASS__, @@ -16,39 +16,21 @@ class BaseCabin extends BaseCabinStructure { // Set description $this->setPartDescr("Kabine"); - - // Maybe clean up a little - if ($class == __CLASS__) { - $this->removeSystemArray(); - } } - // Konstruktor aufrufen + /** + * Calls the private constructor + * + * @param $class The class' name + * @return void + */ public function constructor ($class) { $this->__construct($class); } - // Allgemeine Kabine erstellen - public static function createBaseCabin () { - // Instanz holen - $cabinInstance = new BaseCabin(__CLASS__); - - // Debug message - if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $cabinInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine allgemeine Kabine wird erstellt.
\n", - __CLASS__, - __LINE__ - )); - - // Generate unique ID number - $cabinInstance->createUniqueID(); - - // Instanz zurueckgeben - return $cabinInstance; - } - // Is this a cabin? - public function isCabin () { - return ($this->isClass("BaseCabin")); + public final function isCabin () { + return ($this->isSameClass("BaseCabin")); } /** diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php index 47616df..fadd15e 100644 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/ship/class_EconomyCabin.php @@ -26,7 +26,7 @@ class EconomyCabin extends BaseCabin implements ItemIsTradeable, ConstructableSh // Economy-Kabine erstellen public static function createEconomyCabin ($numLuxury, $numRooms, $numBeds, $dim) { - // Instanz holen + // Get new instance $ecoInstance = new EconomyCabin(); // Debug message diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php index de8393a..b1707ab 100644 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/ship/class_LowCabin.php @@ -24,7 +24,7 @@ class LowCabin extends BaseCabin implements ItemIsTradeable, ConstructableShipPa // 2-Sterne-Klasse erstellen public static function createLowCabin ($numLuxury, $numRooms, $numBeds, $dim) { - // Instanz holen + // Get new instance $lowInstance = new LowCabin(); // Debug message diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php index c7a6af0..bc70665 100644 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/ship/class_LuxuryCabin.php @@ -24,7 +24,7 @@ class LuxuryCabin extends BaseCabin implements ItemIsTradeable, ConstructableShi // Eine Luxuskabine erstellen public static function createLuxuryCabin ($numLuxury, $numRooms, $numBeds, $dim) { - // Instanz holen + // Get new instance $luxuryInstance = new LuxuryCabin(); // Debug message diff --git a/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php b/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php index 31f9e6b..c7d846d 100644 --- a/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php +++ b/application/ship-simu/main/structures/extended/cabines/ship/class_PremierCabin.php @@ -24,7 +24,7 @@ class PremierCabin extends BaseCabin implements ItemIsTradeable, ConstructableSh // Premier-Kabine erstellen public static function createPremierCabin ($numLuxury, $numRooms, $numBeds, $dim) { - // Instanz holen + // Get new instance $premierInstance = new PremierCabin(); // Debug message diff --git a/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php b/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php index b26f692..9f80e43 100644 --- a/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php +++ b/application/ship-simu/main/structures/extended/class_BaseCabinStructure.php @@ -28,7 +28,12 @@ class BaseCabinStructure extends BaseStructure { $this->setPartDescr("Kabinenstruktur"); } - // Konstruktor aufrufen + /** + * Calls the private constructor + * + * @param $class The class' name + * @return void + */ public function constructor ($class) { $this->__construct($class); } @@ -68,7 +73,7 @@ class BaseCabinStructure extends BaseStructure { } // Wrapper fuer setDeckInstance->setPartInstance - public function setDeckInstance ($deck) { + public final function setDeckInstance ($deck) { if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Wrapper setDeckInstance->setPartInstance erreicht.
\n", __CLASS__, __LINE__ @@ -77,7 +82,7 @@ class BaseCabinStructure extends BaseStructure { } // Getter-Methode fuer Anzahl Betten - public function getNumBeds () { + public final function getNumBeds () { if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %d Betten angefordert.
\n", __CLASS__, __LINE__, @@ -87,7 +92,7 @@ class BaseCabinStructure extends BaseStructure { } // Getter-Methode fuer Anzahl Kabinen - public function getNumCabin () { + public final function getNumCabin () { if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %d Kabine(n) angefordert.
\n", __CLASS__, __LINE__, @@ -97,7 +102,7 @@ class BaseCabinStructure extends BaseStructure { } // Setter-Methode fuer Anzahl Betten - public function setNumBeds ($numBeds) { + public final function setNumBeds ($numBeds) { if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %d Betten gesetzt.
\n", __CLASS__, __LINE__, @@ -107,7 +112,7 @@ class BaseCabinStructure extends BaseStructure { } // Setter-Methode fuer Anzahl Raeume - public function setNumRooms ($numRooms) { + public final function setNumRooms ($numRooms) { if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %d Raum/Räume gesetzt.
\n", __CLASS__, __LINE__, @@ -117,7 +122,7 @@ class BaseCabinStructure extends BaseStructure { } // Setter-Methode fuer Anzahl Kabinen - public function setNumCabin ($numCabin) { + public final function setNumCabin ($numCabin) { if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] %d Kabine(n) gesetzt.
\n", __CLASS__, __LINE__, @@ -160,7 +165,7 @@ class BaseCabinStructure extends BaseStructure { $num = $this->getNumCabin(); $cabinBeds = $beds * $num; if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) { - // Instanz holen + // Get new instance $cabType = "Kabine ohne Namen"; $cab = $this->getPartInstance(); if (!is_null($cab)) { diff --git a/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php b/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php index 7aee583..5c218cc 100644 --- a/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php +++ b/application/ship-simu/main/structures/extended/class_BaseDeckStructure.php @@ -21,7 +21,12 @@ class BaseDeckStructure extends BaseStructure { $this->setPartDescr("Deckstruktur"); } - // Konstruktor aufrufen + /** + * Calls the private constructor + * + * @param $class The class' name + * @return void + */ public function constructor ($class) { $this->__construct($class); } @@ -60,12 +65,12 @@ class BaseDeckStructure extends BaseStructure { } // Setter-Methode fuer Anzahl Decks - public function setNumDecks($numDecks) { + public final function setNumDecks($numDecks) { $this->numDecks = (int) $numDecks; } // Getter-Methode fuer Anzahl Decks - public function getNumDecks() { + public final function getNumDecks() { return $this->numDecks; } } diff --git a/application/ship-simu/main/structures/extended/class_BaseUpperStructure.php b/application/ship-simu/main/structures/extended/class_BaseUpperStructure.php index e4488cd..ee7264d 100644 --- a/application/ship-simu/main/structures/extended/class_BaseUpperStructure.php +++ b/application/ship-simu/main/structures/extended/class_BaseUpperStructure.php @@ -18,11 +18,6 @@ class BaseUpperStructure extends BaseStructure { // Set description $this->setPartDescr("Aufbauten"); - - // Shall we clean up? - if ($class == __CLASS__) { - $this->removeSystemArray(); - } } /** @@ -32,28 +27,6 @@ class BaseUpperStructure extends BaseStructure { $this->__construct($class); } - /** - * Creates an upper(=super) structure - */ - public static function createBaseUpperStructure () { - // Instanz holen - $upperInstance = new BaseUpperStructure (__CLASS__); - - // Debug message - if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) { - $upperInstance->getDebugInstance()->output(sprintf("[%s:%d] Aufbauten wird konstruiert.
\n", - __CLASS__, - __LINE__ - )); - } - - // Unique-ID setzen - $upperInstance->createUniqueID(); - - // Return instance - return $upperInstance; - } - /** * Stub! */ diff --git a/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php b/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php index e136198..110d360 100644 --- a/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php +++ b/application/ship-simu/main/structures/extended/decks/cargo/class_CarDeck.php @@ -24,7 +24,7 @@ class CarDeck extends BaseDeck implements ItemIsTradeable, ConstructableShipPart // Autodeck erstellen public static function createCarDeck ($numDecks, $dim) { - // Instanz holen + // Get new instance $carInstance = new CarDeck(); // Debug message @@ -56,12 +56,12 @@ class CarDeck extends BaseDeck implements ItemIsTradeable, ConstructableShipPart } // Setter-Methode fuer Anzahl Decks - public function setNumDecks($numDecks) { + public final function setNumDecks($numDecks) { parent::setNumDecks($numDecks); } // Getter-Methode fuer Anzahl Decks - public function getNumDecks() { + public final function getNumDecks() { return parent::getNumDecks(); } diff --git a/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php b/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php index 8535511..b643807 100644 --- a/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php +++ b/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php @@ -24,7 +24,7 @@ class TrainDeck extends BaseDeck implements ItemIsTradeable, ConstructableShipPa // LKW-Deck erstellen public static function createTrainDeck ($numDecks, $dim) { - // Instanz holen + // Get new instance $trainInstance = new TrainDeck(); // Debug message @@ -56,12 +56,12 @@ class TrainDeck extends BaseDeck implements ItemIsTradeable, ConstructableShipPa } // Setter-Methode fuer Anzahl Decks - public function setNumDecks ($numDecks) { + public final function setNumDecks ($numDecks) { parent::setNumDecks($numDecks); } // Getter-Methode fuer Anzahl Decks - public function getNumDecks() { + public final function getNumDecks() { return parent::getNumDecks(); } diff --git a/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php b/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php index 81d5d33..73207e5 100644 --- a/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php +++ b/application/ship-simu/main/structures/extended/decks/cargo/class_TruckDeck.php @@ -24,7 +24,7 @@ class TruckDeck extends BaseDeck implements ItemIsTradeable, ConstructableShipPa // LKW-Deck erstellen public static function createTruckDeck ($numDecks, $dim) { - // Instanz holen + // Get new instance $truckInstance = new TruckDeck(); // Debug message @@ -56,12 +56,12 @@ class TruckDeck extends BaseDeck implements ItemIsTradeable, ConstructableShipPa } // Setter-Methode fuer Anzahl Decks - public function setNumDecks ($numDecks) { + public final function setNumDecks ($numDecks) { parent::setNumDecks($numDecks); } // Getter-Methode fuer Anzahl Decks - public function getNumDecks() { + public final function getNumDecks() { return parent::getNumDecks(); } diff --git a/application/ship-simu/main/structures/extended/decks/class_BaseDeck.php b/application/ship-simu/main/structures/extended/decks/class_BaseDeck.php index 30b6978..e72f96f 100644 --- a/application/ship-simu/main/structures/extended/decks/class_BaseDeck.php +++ b/application/ship-simu/main/structures/extended/decks/class_BaseDeck.php @@ -1,9 +1,9 @@ setPartDescr("Deck"); - - // Maybe clean up? - if ($class == __CLASS__) { - $this->removeSystemArray(); - } + $this->setPartDescr("Allgemeines Deck"); } - // Ruft nur den privaten Konstruktor auf + /** + * Calls the private constructor + * + * @param $class The class' name + * @return void + */ public function constructor ($class) { $this->__construct($class); } - // Ein allgemeines Deck erstellen - public static function createBaseDeck () { - // Instanz holen - $deckInstance = new BaseDeck(__CLASS__); - - // Debug message - if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $deckInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein allgemeines Deck wird konstruiert.
\n", - __CLASS__, - __LINE__ - )); - - // Unique-ID setzen - $deckInstance->createUniqueID(); - - // Instanz zurueckgeben - return $deckInstance; - } - /** * Stub! */ diff --git a/application/ship-simu/main/structures/extended/upper/class_Bridge.php b/application/ship-simu/main/structures/extended/upper/class_Bridge.php index 9aefdcd..80c4370 100644 --- a/application/ship-simu/main/structures/extended/upper/class_Bridge.php +++ b/application/ship-simu/main/structures/extended/upper/class_Bridge.php @@ -25,7 +25,7 @@ class Bridge extends BaseUpperStructure implements ItemIsTradeable, Constructabl // Eine Kommandobruecke erstellen public static function createBridge ($width, $height, $length) { - // Instanz holen + // Get new instance $bridgeInstance = new Bridge(); // Debug message diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 1e536a2..c1147db 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -569,11 +569,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @return boolean The result of comparing both's unique ID */ public final function equals ($object) { - if ((defined('DEBUG_SYSTEM')) && (is_object($this->getDebugInstance()))) $this->getDebugInstance()->output(sprintf("[%s:] Ist %s=%s?
\n", - $this->__toString(), - $this->__toString(), - $object->__toString() - )); return ($this->getUniqueID() == $object->getUniqueID()); } @@ -586,8 +581,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ public function itemMatches ($itemInstance) { return ( - ($this->__toString() == $itemInstance->__toString()) - && ($this->getPartDescr() == $itemInstance->getPartDescr()) + ( + $this->__toString() == $itemInstance->__toString() + ) && ( + $this->getPartDescr() == $itemInstance->getPartDescr() + ) ); } @@ -725,7 +723,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @throws InvalidArrayCountException If the array contains less or * more than two elements */ - public function getPathFileNameFromObject () { + public final function getPathFileNameFromObject () { // Get the main object's unique ID. We use this as a path/filename combination $pathFile = $this->getUniqueID(); diff --git a/inc/classes/main/database/classes/class_LocalFileDatabase.php b/inc/classes/main/database/classes/class_LocalFileDatabase.php index 55875a6..231dfee 100644 --- a/inc/classes/main/database/classes/class_LocalFileDatabase.php +++ b/inc/classes/main/database/classes/class_LocalFileDatabase.php @@ -404,7 +404,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend * @throws MissingMethodException If the required method * toString() is missing */ - public function getObjectFromCachedData ($uniqueID) { + public final function getObjectFromCachedData ($uniqueID) { // Get instance for file handler $inputHandler = $this->getIOInstance(); diff --git a/tests/contract-test.php b/tests/contract-test.php index e202630..3798fa2 100644 --- a/tests/contract-test.php +++ b/tests/contract-test.php @@ -481,7 +481,7 @@ if (defined('DEBUG_COMPANY_OBJ')) { )); } -// Etwas aufraeumen +// Clean up a little unset($einbauten); unset($part); unset($eval); @@ -521,7 +521,7 @@ DebugMiddleware::getInstance()->output(sprintf("Der Bau der %s $contract->formatCurrency($totalValue) )); -// Etwas aufraeumen +// Clean up a little unset($totalValue); // Den Bauvertrag unterschreiben (damit wird er in den Bau-Queue aufgenommen) -- 2.30.2