From 98355573139973cb7c3cdabda075492917cecde8 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 10 Jun 2015 21:23:08 +0200 Subject: [PATCH] - Renamed InvalidStateException to UnexpectedStateException - Updated 'core' Signed-off-by: Roland Haeder --- ...on.php => class_UnexpectedStateException.php} | 2 +- .../hub/main/package/class_NetworkPackage.php | 2 +- .../class_MinerRealGenesisBlockProducer.php | 2 +- .../class_MinerTestGenesisBlockProducer.php | 2 +- .../communicator/class_BaseCommunicatorState.php | 4 ++-- .../states/crawler/class_BaseCrawlerState.php | 4 ++-- .../states/cruncher/class_BaseCruncherState.php | 4 ++-- .../hub/main/states/dht/class_BaseDhtState.php | 4 ++-- .../main/states/miner/class_BaseMinerState.php | 12 ++++++------ .../hub/main/states/node/class_BaseNodeState.php | 16 ++++++++-------- .../hub/main/states/peer/class_BasePeerState.php | 4 ++-- core | 2 +- 12 files changed, 29 insertions(+), 29 deletions(-) rename application/hub/exceptions/state/{class_InvalidStateException.php => class_UnexpectedStateException.php} (95%) diff --git a/application/hub/exceptions/state/class_InvalidStateException.php b/application/hub/exceptions/state/class_UnexpectedStateException.php similarity index 95% rename from application/hub/exceptions/state/class_InvalidStateException.php rename to application/hub/exceptions/state/class_UnexpectedStateException.php index 5d1d3472e..4613814f5 100644 --- a/application/hub/exceptions/state/class_InvalidStateException.php +++ b/application/hub/exceptions/state/class_UnexpectedStateException.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class InvalidStateException extends FrameworkException { +class UnexpectedStateException extends FrameworkException { /** * The super constructor for all exceptions * diff --git a/application/hub/main/package/class_NetworkPackage.php b/application/hub/main/package/class_NetworkPackage.php index 20af55662..a6328fab9 100644 --- a/application/hub/main/package/class_NetworkPackage.php +++ b/application/hub/main/package/class_NetworkPackage.php @@ -889,7 +889,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R // And remove it finally $this->getStackInstance()->popNamed(self::STACKER_NAME_DECLARED); - } catch (InvalidStateException $e) { + } catch (UnexpectedStateException $e) { // The state is not excepected (shall be 'connected') self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Caught ' . $e->__toString() . ',message=' . $e->getMessage()); diff --git a/application/hub/main/producer/miner/blocks/class_MinerRealGenesisBlockProducer.php b/application/hub/main/producer/miner/blocks/class_MinerRealGenesisBlockProducer.php index 18f399853..0abd16c37 100644 --- a/application/hub/main/producer/miner/blocks/class_MinerRealGenesisBlockProducer.php +++ b/application/hub/main/producer/miner/blocks/class_MinerRealGenesisBlockProducer.php @@ -56,7 +56,7 @@ class MinerRealGenesisBlockProducer extends BaseBlockProducer implements BlockPr * class. * * @return void - * @todo ~10% done + * @todo 0% done */ protected function initProducer () { $this->partialStub('Please implement this method.'); diff --git a/application/hub/main/producer/miner/blocks/class_MinerTestGenesisBlockProducer.php b/application/hub/main/producer/miner/blocks/class_MinerTestGenesisBlockProducer.php index b710328bf..fbf80a39f 100644 --- a/application/hub/main/producer/miner/blocks/class_MinerTestGenesisBlockProducer.php +++ b/application/hub/main/producer/miner/blocks/class_MinerTestGenesisBlockProducer.php @@ -56,7 +56,7 @@ class MinerTestGenesisBlockProducer extends BaseBlockProducer implements BlockPr * class. * * @return void - * @todo ~10% done + * @todo 0% done */ protected function initProducer () { $this->partialStub('Please implement this method.'); diff --git a/application/hub/main/states/communicator/class_BaseCommunicatorState.php b/application/hub/main/states/communicator/class_BaseCommunicatorState.php index 99688600e..32a055406 100644 --- a/application/hub/main/states/communicator/class_BaseCommunicatorState.php +++ b/application/hub/main/states/communicator/class_BaseCommunicatorState.php @@ -38,13 +38,13 @@ class BaseCommunicatorState extends BaseState { * it is every other state. * * @return void - * @throws InvalidStateException If the state is not 'active' + * @throws UnexpectedStateException If the state is not 'active' */ public function validateCommunicatorStateIsActive () { // Just compare it... if (!$this instanceof CommunicatorActiveState) { // Throw the exception - throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE); + throw new UnexpectedStateException($this, self::EXCEPTION_INVALID_STATE); } // END - if } } diff --git a/application/hub/main/states/crawler/class_BaseCrawlerState.php b/application/hub/main/states/crawler/class_BaseCrawlerState.php index 03dbf5ffa..fbb75fda4 100644 --- a/application/hub/main/states/crawler/class_BaseCrawlerState.php +++ b/application/hub/main/states/crawler/class_BaseCrawlerState.php @@ -38,13 +38,13 @@ class BaseCrawlerState extends BaseState { * it is every other state. * * @return void - * @throws InvalidStateException If the state is not 'active' + * @throws UnexpectedStateException If the state is not 'active' */ public function validateCrawlerStateIsActive () { // Just compare it... if (!$this instanceof CrawlerActiveState) { // Throw the exception - throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE); + throw new UnexpectedStateException($this, self::EXCEPTION_INVALID_STATE); } // END - if } } diff --git a/application/hub/main/states/cruncher/class_BaseCruncherState.php b/application/hub/main/states/cruncher/class_BaseCruncherState.php index 1c08782a2..246bd812e 100644 --- a/application/hub/main/states/cruncher/class_BaseCruncherState.php +++ b/application/hub/main/states/cruncher/class_BaseCruncherState.php @@ -38,13 +38,13 @@ class BaseCruncherState extends BaseState { * it is every other state. * * @return void - * @throws InvalidStateException If the state is not 'active' + * @throws UnexpectedStateException If the state is not 'active' */ public function validateCruncherStateIsActive () { // Just compare it... if (!$this instanceof CruncherActiveState) { // Throw the exception - throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE); + throw new UnexpectedStateException($this, self::EXCEPTION_INVALID_STATE); } // END - if } diff --git a/application/hub/main/states/dht/class_BaseDhtState.php b/application/hub/main/states/dht/class_BaseDhtState.php index efc3b51c0..44e0b5584 100644 --- a/application/hub/main/states/dht/class_BaseDhtState.php +++ b/application/hub/main/states/dht/class_BaseDhtState.php @@ -39,13 +39,13 @@ class BaseDhtState extends BaseState { * is every other state. * * @return void - * @throws InvalidStateException If the state is not 'virgin' + * @throws UnexpectedStateException If the state is not 'virgin' */ public function validateDhtStateIsVirginOrInit () { // Just compare it... if ((!$this instanceof DhtVirginState) && (!$this instanceof DhtInitState)) { // Throw the exception - throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE); + throw new UnexpectedStateException($this, self::EXCEPTION_INVALID_STATE); } // END - if } diff --git a/application/hub/main/states/miner/class_BaseMinerState.php b/application/hub/main/states/miner/class_BaseMinerState.php index 0208d7a2c..cf53991ee 100644 --- a/application/hub/main/states/miner/class_BaseMinerState.php +++ b/application/hub/main/states/miner/class_BaseMinerState.php @@ -38,13 +38,13 @@ class BaseMinerState extends BaseState { * it is every other state. * * @return void - * @throws InvalidStateException If the state is not 'active' + * @throws UnexpectedStateException If the state is not 'active' */ public function validateMinerStateIsActive () { // Just compare it... if (!$this instanceof MinerActiveState) { // Throw the exception - throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE); + throw new UnexpectedStateException($this, self::EXCEPTION_INVALID_STATE); } // END - if } @@ -53,13 +53,13 @@ class BaseMinerState extends BaseState { * it is every other state. * * @return void - * @throws InvalidStateException If the state is not 'init' + * @throws UnexpectedStateException If the state is not 'init' */ public function validateMinerStateIsInit () { // Just compare it... if (!$this instanceof MinerInitState) { // Throw the exception - throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE); + throw new UnexpectedStateException($this, self::EXCEPTION_INVALID_STATE); } // END - if } @@ -68,13 +68,13 @@ class BaseMinerState extends BaseState { * it is every other state. * * @return void - * @throws InvalidStateException If the state is not 'booting' + * @throws UnexpectedStateException If the state is not 'booting' */ public function validateMinerStateIsBooting () { // Just compare it... if (!$this instanceof MinerBootingState) { // Throw the exception - throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE); + throw new UnexpectedStateException($this, self::EXCEPTION_INVALID_STATE); } // END - if } diff --git a/application/hub/main/states/node/class_BaseNodeState.php b/application/hub/main/states/node/class_BaseNodeState.php index 3cb1c628e..171331df8 100644 --- a/application/hub/main/states/node/class_BaseNodeState.php +++ b/application/hub/main/states/node/class_BaseNodeState.php @@ -38,13 +38,13 @@ class BaseNodeState extends BaseState { * it is every other state. * * @return void - * @throws InvalidStateException If the state is not 'active' + * @throws UnexpectedStateException If the state is not 'active' */ public function validateNodeStateIsActive () { // Just compare it... if (!$this instanceof NodeActiveState) { // Throw the exception - throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE); + throw new UnexpectedStateException($this, self::EXCEPTION_INVALID_STATE); } // END - if } @@ -53,13 +53,13 @@ class BaseNodeState extends BaseState { * exception if it is every other state. * * @return void - * @throws InvalidStateException If the state is not 'active' and not 'announcing' + * @throws UnexpectedStateException If the state is not 'active' and not 'announcing' */ public function validateNodeStateIsActiveOrAnnouncing () { // Just compare it... if ((!$this instanceof NodeActiveState) && (!$this instanceof NodeAnnouncingState)) { // Throw the exception - throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE); + throw new UnexpectedStateException($this, self::EXCEPTION_INVALID_STATE); } // END - if } @@ -68,13 +68,13 @@ class BaseNodeState extends BaseState { * exception if it is every other state. * * @return void - * @throws InvalidStateException If the state is not 'active' and not 'reachable' + * @throws UnexpectedStateException If the state is not 'active' and not 'reachable' */ public function validateNodeStateIsActiveOrReachable () { // Just compare it... if ((!$this instanceof NodeActiveState) && (!$this instanceof NodeReachableState)) { // Throw the exception - throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE); + throw new UnexpectedStateException($this, self::EXCEPTION_INVALID_STATE); } // END - if } @@ -83,13 +83,13 @@ class BaseNodeState extends BaseState { * exception if it is every other state. * * @return void - * @throws InvalidStateException If the state is not 'active' and not 'announcing' + * @throws UnexpectedStateException If the state is not 'active' and not 'announcing' */ public function validateNodeStateIsAnnouncementCompleted () { // Just compare it... if (!$this instanceof NodeAnnouncementCompletedState) { // Throw the exception - throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE); + throw new UnexpectedStateException($this, self::EXCEPTION_INVALID_STATE); } // END - if } } diff --git a/application/hub/main/states/peer/class_BasePeerState.php b/application/hub/main/states/peer/class_BasePeerState.php index 7bc1513c8..cbbc183f2 100644 --- a/application/hub/main/states/peer/class_BasePeerState.php +++ b/application/hub/main/states/peer/class_BasePeerState.php @@ -38,13 +38,13 @@ class BasePeerState extends BaseState { * it is every other state. * * @return void - * @throws InvalidStateException If the state is not 'connected' + * @throws UnexpectedStateException If the state is not 'connected' */ public function validatePeerStateConnected () { // Just compare it... if (!$this->isPeerStateConnected()) { // Throw the exception - throw new InvalidStateException($this, self::EXCEPTION_INVALID_STATE); + throw new UnexpectedStateException($this, self::EXCEPTION_INVALID_STATE); } // END - if } diff --git a/core b/core index b2caf380b..cc0e0b439 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit b2caf380b85fbe804d7464ecc1bfe60aafcbc7d9 +Subproject commit cc0e0b439900fd1ffb882f9150f37dd3eb8d301d -- 2.39.2