From fd8382b03df7243195b38562c8dac7eb45796657 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 20 Nov 2005 16:04:33 +0000 Subject: --- framework/Collections/TList.php | 14 +++++++------- framework/Collections/TMap.php | 2 +- framework/Exceptions/messages.txt | 10 ++++++++++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/framework/Collections/TList.php b/framework/Collections/TList.php index 09d9516b..d57e0f62 100644 --- a/framework/Collections/TList.php +++ b/framework/Collections/TList.php @@ -88,14 +88,14 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess * This method is exactly the same as {@link offsetGet}. * @param integer the index of the item * @return mixed the item at the index - * @throws TIndexOutOfRangeException if the index is out of the range + * @throws TInvalidDataValueException if the index is out of the range */ public function itemAt($index) { if(isset($this->_d[$index])) return $this->_d[$index]; else - throw new TIndexOutOfRangeException('list_index_invalid',$index); + throw new TInvalidDataValueException('list_index_invalid',$index); } /** @@ -120,7 +120,7 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess * will be moved one step towards the end. * @param integer the speicified position. * @param mixed new item - * @throws TIndexOutOfRangeException If the index specified exceeds the bound + * @throws TInvalidDataValueException If the index specified exceeds the bound * @throws TInvalidOperationException If the item is not allowed to be added */ public function addAt($index,$item) @@ -136,7 +136,7 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess $this->addedItem($item); } else - throw new TIndexOutOfRangeException('list_index_invalid',$index); + throw new TInvalidDataValueException('list_index_invalid',$index); } else throw new TInvalidOperationException('list_addition_disallowed'); @@ -190,7 +190,7 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess throw new TInvalidOperationException('list_item_unremovable'); } else - throw new TIndexOutOfRangeException('list_index_invalid',$index); + throw new TInvalidDataValueException('list_index_invalid',$index); } /** @@ -283,14 +283,14 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess * This method is required by the interface ArrayAccess. * @param integer the offset to retrieve item. * @return mixed the item at the offset - * @throws TIndexOutOfRangeException if the offset is invalid + * @throws TInvalidDataValueException if the offset is invalid */ public function offsetGet($offset) { if(isset($this->_d[$offset])) return $this->_d[$offset]; else - throw new TIndexOutOfRangeException('list_index_invalid',$offset); + throw new TInvalidDataValueException('list_index_invalid',$offset); } /** diff --git a/framework/Collections/TMap.php b/framework/Collections/TMap.php index 7c2333d9..73665136 100644 --- a/framework/Collections/TMap.php +++ b/framework/Collections/TMap.php @@ -112,7 +112,7 @@ class TMap extends TComponent implements IteratorAggregate,ArrayAccess $this->addedItem($key,$value); } else - throw new TInvalidOperationException('map_item_invalid'); + throw new TInvalidOperationException('map_addition_disallowed'); } /** diff --git a/framework/Exceptions/messages.txt b/framework/Exceptions/messages.txt index 209c0124..0d3d7a1d 100644 --- a/framework/Exceptions/messages.txt +++ b/framework/Exceptions/messages.txt @@ -7,6 +7,16 @@ component_statements_invalid = Component '%s' is evaluating invalid PHP statem propertyvalue_enumvalue_invalid = Value '%s' is a not valid enumeration value (%s). +list_index_invalid = Index '%d' is out of range. +list_addition_disallowed = The new item cannot be added to the list. +list_item_unremovable = The item cannot be removed from the list. +list_item_inexistent = The item cannot be found in the list. +list_data_not_iterable = Data must be either an array or an object implementing Traversable interface. + +map_addition_disallowed = The new item cannot be added to the map. +map_item_unremovable = The item cannot be removed from the map. +map_data_not_iterable = Data must be either an array or an object implementing Traversable interface. + application_configfile_inexistent = Application configuration file '%s' does not exist. application_module_existing = Application module '%s' cannot be registered twice. application_service_invalid = Service '%s' must implement IService interface. -- cgit v1.2.3