X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fconfig%2Fclass_FrameworkConfiguration.php;h=1a809e070c7a871a1ee70912220c086b09a1a606;hb=cfdb4dd9f2ef3f8ef1db550fb81b7fc6e1eb7842;hp=70f0585895cc6e3ff6ae6ee89299e7e6485a56c5;hpb=976d57fe7ac564060778d10b1742d62cea5accfc;p=core.git diff --git a/inc/config/class_FrameworkConfiguration.php b/inc/config/class_FrameworkConfiguration.php index 70f05858..1a809e07 100644 --- a/inc/config/class_FrameworkConfiguration.php +++ b/inc/config/class_FrameworkConfiguration.php @@ -8,7 +8,7 @@ * @see ClassLoader * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -65,7 +65,7 @@ class FrameworkConfiguration implements Registerable { * * @return $configInstance An instance of this class */ - public final static function getInstance () { + public static final function getInstance () { // is the instance there? if (is_null(self::$configInstance)) { // Create a config instance @@ -119,7 +119,7 @@ class FrameworkConfiguration implements Registerable { * @param $cfgEntry The configuration element * @return $cfgValue The fetched configuration value * @throws ConfigEntryIsEmptyException If $cfgEntry is empty - * @throws ConfigEntryNotFoundException If a configuration element + * @throws NoConfigEntryException If a configuration element * was not found */ public function getConfigEntry ($cfgEntry) { @@ -132,7 +132,7 @@ class FrameworkConfiguration implements Registerable { throw new ConfigEntryIsEmptyException($this, self::EXCEPTION_CONFIG_ENTRY_IS_EMPTY); } elseif (!$this->isConfigurationEntrySet($cfgEntry)) { // Entry was not found! - throw new ConfigEntryNotFoundException(array(__CLASS__, $cfgEntry), self::EXCEPTION_CONFIG_ENTRY_WAS_NOT_FOUND); + throw new NoConfigEntryException(array(__CLASS__, $cfgEntry), self::EXCEPTION_CONFIG_ENTRY_WAS_NOT_FOUND); } // Return the requested value @@ -318,7 +318,26 @@ class FrameworkConfiguration implements Registerable { public function hashCode () { return crc32($this->__toString()); } + + /** + * Checks wether an object equals this object. You should overwrite this + * method to implement own equality checks + * + * @param $objectInstance An instance of a FrameworkInterface object + * @return $equals Wether both objects equals + */ + public function equals (FrameworkInterface $objectInstance) { + // Now test it + $equals = (( + $this->__toString() == $objectInstance->__toString() + ) && ( + $this->hashCode() == $objectInstance->hashCode() + )); + + // Return the result + return $equals; + } } -// +// [EOF] ?>