diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2015-01-22 09:14:12 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2015-01-22 09:14:12 +0100 |
commit | 5230f8f8a86fc1ae5d90f8c74ae65c93e197502b (patch) | |
tree | e870d29e21c14d5b1683d638dff978afe0a104fa /framework/Collections | |
parent | 53e4cd65205ac33d7dbc61a767f467c1b896dfc6 (diff) |
Apply namespaces to class inheritances (pt1)
Diffstat (limited to 'framework/Collections')
20 files changed, 96 insertions, 81 deletions
diff --git a/framework/Collections/TAttributeCollection.php b/framework/Collections/TAttributeCollection.php index 818d98d8..4e439bfd 100644 --- a/framework/Collections/TAttributeCollection.php +++ b/framework/Collections/TAttributeCollection.php @@ -10,11 +10,7 @@ */ namespace Prado\Collections; - -/** - * Includes TMap class - */ -Prado::using('System.Collections.TMap'); +use Prado\TPropertyValue; /** * TAttributeCollection class diff --git a/framework/Collections/TDummyDataSource.php b/framework/Collections/TDummyDataSource.php index 479a0e8f..e4aebc4c 100644 --- a/framework/Collections/TDummyDataSource.php +++ b/framework/Collections/TDummyDataSource.php @@ -26,7 +26,7 @@ namespace Prado\Collections; * @package Prado\Collections * @since 3.0 */ -class TDummyDataSource extends TComponent implements IteratorAggregate, Countable +class TDummyDataSource extends \Prado\TComponent implements \IteratorAggregate, \Countable { private $_count; @@ -57,7 +57,7 @@ class TDummyDataSource extends TComponent implements IteratorAggregate, Countabl /** * Returns the number of (virtual) items in the data source. - * This method is required by Countable interface. + * This method is required by \Countable interface. * @return integer number of (virtual) items in the data source. */ public function count() diff --git a/framework/Collections/TDummyDataSourceIterator.php b/framework/Collections/TDummyDataSourceIterator.php index 4934fa7f..d03ec3d7 100644 --- a/framework/Collections/TDummyDataSourceIterator.php +++ b/framework/Collections/TDummyDataSourceIterator.php @@ -14,7 +14,7 @@ namespace Prado\Collections; /** * TDummyDataSourceIterator class * - * TDummyDataSourceIterator implements Iterator interface. + * TDummyDataSourceIterator implements \Iterator interface. * * TDummyDataSourceIterator is used by {@link TDummyDataSource}. * It allows TDummyDataSource to return a new iterator @@ -24,7 +24,7 @@ namespace Prado\Collections; * @package Prado\Collections * @since 3.0 */ -class TDummyDataSourceIterator implements Iterator +class TDummyDataSourceIterator implements \Iterator { private $_index; private $_count; diff --git a/framework/Collections/TList.php b/framework/Collections/TList.php index 04cbd772..c0bf8d3a 100644 --- a/framework/Collections/TList.php +++ b/framework/Collections/TList.php @@ -10,6 +10,10 @@ */ namespace Prado\Collections; +use Prado\Exceptions\TInvalidOperationException; +use Prado\Exceptions\TInvalidDataTypeException; +use Prado\Exceptions\TInvalidDataValueException; +use Prado\TPropertyValue; /** * TList class @@ -36,7 +40,7 @@ namespace Prado\Collections; * @package Prado\Collections * @since 3.0 */ -class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countable +class TList extends \Prado\TComponent implements \IteratorAggregate, \ArrayAccess, \Countable { /** * internal data storage @@ -85,17 +89,17 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl /** * Returns an iterator for traversing the items in the list. - * This method is required by the interface IteratorAggregate. + * This method is required by the interface \IteratorAggregate. * @return Iterator an iterator for traversing the items in the list. */ public function getIterator() { - return new ArrayIterator( $this->_d ); + return new \ArrayIterator( $this->_d ); } /** * Returns the number of items in the list. - * This method is required by Countable interface. + * This method is required by \Countable interface. * @return integer number of items in the list. */ public function count() @@ -315,7 +319,7 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl */ public function copyFrom($data) { - if(is_array($data) || ($data instanceof Traversable)) + if(is_array($data) || ($data instanceof \Traversable)) { if($this->_c>0) $this->clear(); @@ -334,7 +338,7 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl */ public function mergeWith($data) { - if(is_array($data) || ($data instanceof Traversable)) + if(is_array($data) || ($data instanceof \Traversable)) { foreach($data as $item) $this->add($item); @@ -345,7 +349,7 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl /** * Returns whether there is an item at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param integer the offset to check on * @return boolean */ @@ -356,7 +360,7 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl /** * Returns the item at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param integer the offset to retrieve item. * @return mixed the item at the offset * @throws TInvalidDataValueException if the offset is invalid @@ -368,7 +372,7 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl /** * Sets the item at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param integer the offset to set item * @param mixed the item value */ @@ -385,7 +389,7 @@ class TList extends TComponent implements IteratorAggregate,ArrayAccess,Countabl /** * Unsets the item at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param integer the offset to unset item */ public function offsetUnset($offset) diff --git a/framework/Collections/TListItemCollection.php b/framework/Collections/TListItemCollection.php index bb71c85d..e6637e2a 100644 --- a/framework/Collections/TListItemCollection.php +++ b/framework/Collections/TListItemCollection.php @@ -12,12 +12,9 @@ */ namespace Prado\Collections; - -/** - * Includes the supporting classes - */ -Prado::using('System.Collections.TList'); -Prado::using('System.Web.UI.WebControls.TListItem'); +use Prado\Exceptions\TInvalidDataTypeException; +use Prado\TPropertyValue; +use Prado\Web\TListItem; /** * TListItemCollection class. diff --git a/framework/Collections/TListIterator.php b/framework/Collections/TListIterator.php index b810d5dd..268215a9 100644 --- a/framework/Collections/TListIterator.php +++ b/framework/Collections/TListIterator.php @@ -14,7 +14,7 @@ namespace Prado\Collections; /** * TListIterator class * - * TListIterator implements Iterator interface. + * TListIterator implements \Iterator interface. * * TListIterator is used by TList. It allows TList to return a new iterator * for traversing the items in the list. @@ -24,7 +24,7 @@ namespace Prado\Collections; * @package Prado\Collections * @since 3.0 */ -class TListIterator implements Iterator +class TListIterator implements \Iterator { /** * @var array the data to be iterated through diff --git a/framework/Collections/TMap.php b/framework/Collections/TMap.php index d06028e0..3a83fa4c 100644 --- a/framework/Collections/TMap.php +++ b/framework/Collections/TMap.php @@ -10,6 +10,9 @@ */ namespace Prado\Collections; +use Prado\Exceptions\TInvalidDataTypeException; +use Prado\Exceptions\TInvalidOperationException; +use Prado\TPropertyValue; /** * TMap class @@ -32,7 +35,7 @@ namespace Prado\Collections; * @package Prado\Collections * @since 3.0 */ -class TMap extends TComponent implements IteratorAggregate,ArrayAccess,Countable +class TMap extends \Prado\TComponent implements \IteratorAggregate, \ArrayAccess, \Countable { /** * @var array internal data storage @@ -75,17 +78,17 @@ class TMap extends TComponent implements IteratorAggregate,ArrayAccess,Countable /** * Returns an iterator for traversing the items in the list. - * This method is required by the interface IteratorAggregate. + * This method is required by the interface \IteratorAggregate. * @return Iterator an iterator for traversing the items in the list. */ public function getIterator() { - return new ArrayIterator( $this->_d ); + return new \ArrayIterator( $this->_d ); } /** * Returns the number of items in the map. - * This method is required by Countable interface. + * This method is required by \Countable interface. * @return integer number of items in the map. */ public function count() @@ -222,7 +225,7 @@ class TMap extends TComponent implements IteratorAggregate,ArrayAccess,Countable /** * Returns whether there is an element at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param mixed the offset to check on * @return boolean */ @@ -233,7 +236,7 @@ class TMap extends TComponent implements IteratorAggregate,ArrayAccess,Countable /** * Returns the element at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param integer the offset to retrieve element. * @return mixed the element at the offset, null if no element is found at the offset */ @@ -244,7 +247,7 @@ class TMap extends TComponent implements IteratorAggregate,ArrayAccess,Countable /** * Sets the element at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param integer the offset to set element * @param mixed the element value */ @@ -255,7 +258,7 @@ class TMap extends TComponent implements IteratorAggregate,ArrayAccess,Countable /** * Unsets the element at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param mixed the offset to unset element */ public function offsetUnset($offset) diff --git a/framework/Collections/TMapIterator.php b/framework/Collections/TMapIterator.php index a2b813d7..303700d2 100644 --- a/framework/Collections/TMapIterator.php +++ b/framework/Collections/TMapIterator.php @@ -14,7 +14,7 @@ namespace Prado\Collections; /** * TMapIterator class * - * TMapIterator implements Iterator interface. + * TMapIterator implements \Iterator interface. * * TMapIterator is used by TMap. It allows TMap to return a new iterator * for traversing the items in the map. @@ -24,7 +24,7 @@ namespace Prado\Collections; * @package Prado\Collections * @since 3.0 */ -class TMapIterator implements Iterator +class TMapIterator implements \Iterator { /** * @var array the data to be iterated through diff --git a/framework/Collections/TPagedDataSource.php b/framework/Collections/TPagedDataSource.php index db929048..92a9898e 100644 --- a/framework/Collections/TPagedDataSource.php +++ b/framework/Collections/TPagedDataSource.php @@ -10,6 +10,9 @@ */ namespace Prado\Collections; +use Prado\Exceptions\TInvalidDataTypeException; +use Prado\Exceptions\TInvalidDataValueException; +use Prado\TPropertyValue; /** * TPagedDataSource class @@ -28,7 +31,7 @@ namespace Prado\Collections; * @package Prado\Collections * @since 3.0 */ -class TPagedDataSource extends TComponent implements IteratorAggregate,Countable +class TPagedDataSource extends \Prado\TComponent implements \IteratorAggregate, \Countable { /** * @var mixed original data source @@ -72,7 +75,7 @@ class TPagedDataSource extends TComponent implements IteratorAggregate,Countable { if(is_array($value)) $value=new TMap($value); - else if($value instanceof Traversable) + else if($value instanceof \Traversable) $value=new TList($value); else if($value!==null) throw new TInvalidDataTypeException('pageddatasource_datasource_invalid'); @@ -184,7 +187,7 @@ class TPagedDataSource extends TComponent implements IteratorAggregate,Countable /** * Returns the number of items in the current page. - * This method is required by Countable interface. + * This method is required by \Countable interface. * @return integer number of items in the current page. */ public function count() diff --git a/framework/Collections/TPagedList.php b/framework/Collections/TPagedList.php index f62942c8..f324e472 100644 --- a/framework/Collections/TPagedList.php +++ b/framework/Collections/TPagedList.php @@ -10,6 +10,8 @@ */ namespace Prado\Collections; +use Prado\Exceptions\TInvalidDataValueException; +use Prado\TPropertyValue; /** * TPagedList class @@ -331,7 +333,7 @@ class TPagedList extends TList /** * Returns whether there is an item at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param integer the offset to check on * @return boolean */ @@ -342,7 +344,7 @@ class TPagedList extends TList /** * Returns the item at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param integer the offset to retrieve item. * @return mixed the item at the offset * @throws TInvalidDataValueException if the offset is invalid diff --git a/framework/Collections/TPagedListFetchDataEventParameter.php b/framework/Collections/TPagedListFetchDataEventParameter.php index a805ab87..6c0b2cee 100644 --- a/framework/Collections/TPagedListFetchDataEventParameter.php +++ b/framework/Collections/TPagedListFetchDataEventParameter.php @@ -26,7 +26,7 @@ namespace Prado\Collections; * @package Prado\Collections * @since 3.0 */ -class TPagedListFetchDataEventParameter extends TEventParameter +class TPagedListFetchDataEventParameter extends \Prado\TEventParameter { private $_pageIndex; private $_offset; diff --git a/framework/Collections/TPagedListIterator.php b/framework/Collections/TPagedListIterator.php index e63f9a22..0e23df83 100644 --- a/framework/Collections/TPagedListIterator.php +++ b/framework/Collections/TPagedListIterator.php @@ -14,7 +14,7 @@ namespace Prado\Collections; /** * TPagedListIterator class * - * TPagedListIterator implements Iterator interface. + * TPagedListIterator implements \Iterator interface. * * TPagedListIterator is used by {@link TPagedDataSource}. It allows TPagedDataSource * to return a new iterator for traversing the items in a {@link TList} object. @@ -23,7 +23,7 @@ namespace Prado\Collections; * @package Prado\Collections * @since 3.0 */ -class TPagedListIterator implements Iterator +class TPagedListIterator implements \Iterator { private $_list; private $_startIndex; diff --git a/framework/Collections/TPagedListPageChangedEventParameter.php b/framework/Collections/TPagedListPageChangedEventParameter.php index 476f2b05..7cf07669 100644 --- a/framework/Collections/TPagedListPageChangedEventParameter.php +++ b/framework/Collections/TPagedListPageChangedEventParameter.php @@ -21,7 +21,7 @@ namespace Prado\Collections; * @package Prado\Collections * @since 3.0 */ -class TPagedListPageChangedEventParameter extends TEventParameter +class TPagedListPageChangedEventParameter extends \Prado\TEventParameter { private $_oldPage; diff --git a/framework/Collections/TPagedMapIterator.php b/framework/Collections/TPagedMapIterator.php index be223f50..87bc0a8a 100644 --- a/framework/Collections/TPagedMapIterator.php +++ b/framework/Collections/TPagedMapIterator.php @@ -14,7 +14,7 @@ namespace Prado\Collections; /** * TPagedMapIterator class * - * TPagedMapIterator implements Iterator interface. + * TPagedMapIterator implements \Iterator interface. * * TPagedMapIterator is used by {@link TPagedDataSource}. It allows TPagedDataSource * to return a new iterator for traversing the items in a {@link TMap} object. @@ -23,7 +23,7 @@ namespace Prado\Collections; * @package Prado\Collections * @since 3.0 */ -class TPagedMapIterator implements Iterator +class TPagedMapIterator implements \Iterator { private $_map; private $_startIndex; diff --git a/framework/Collections/TPriorityList.php b/framework/Collections/TPriorityList.php index 53486f45..27dd4017 100644 --- a/framework/Collections/TPriorityList.php +++ b/framework/Collections/TPriorityList.php @@ -10,6 +10,10 @@ */ namespace Prado\Collections; +use Prado\Exceptions\TInvalidDataTypeException; +use Prado\Exceptions\TInvalidDataValueException; +use Prado\Exceptions\TInvalidOperationException; +use Prado\TPropertyValue; /** * TPriorityList class @@ -95,7 +99,7 @@ class TPriorityList extends TList /** * Returns the number of items in the list. - * This method is required by Countable interface. + * This method is required by \Countable interface. * @return integer number of items in the list. */ public function count() @@ -164,12 +168,12 @@ class TPriorityList extends TList /** * Returns an iterator for traversing the items in the list. - * This method is required by the interface IteratorAggregate. + * This method is required by the interface \IteratorAggregate. * @return Iterator an iterator for traversing the items in the list. */ public function getIterator() { - return new ArrayIterator($this->flattenPriorities()); + return new \ArrayIterator($this->flattenPriorities()); } /** @@ -646,7 +650,7 @@ class TPriorityList extends TList foreach($data->itemsAtPriority($priority) as $index=>$item) $this->insertAtIndexInPriority($item,$index,$priority); } - } else if(is_array($data)||$data instanceof Traversable) { + } else if(is_array($data)||$data instanceof \Traversable) { if($this->getCount()>0) $this->clear(); foreach($data as $key=>$item) @@ -673,7 +677,7 @@ class TPriorityList extends TList $this->insertAtIndexInPriority($item,false,$priority); } } - else if(is_array($data)||$data instanceof Traversable) + else if(is_array($data)||$data instanceof \Traversable) { foreach($data as $priority=>$item) $this->add($item); @@ -685,7 +689,7 @@ class TPriorityList extends TList /** * Returns whether there is an element at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param mixed the offset to check on * @return boolean */ @@ -696,7 +700,7 @@ class TPriorityList extends TList /** * Returns the element at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param integer the offset to retrieve element. * @return mixed the element at the offset, null if no element is found at the offset */ @@ -706,7 +710,7 @@ class TPriorityList extends TList } /** - * Sets the element at the specified offset. This method is required by the interface ArrayAccess. + * Sets the element at the specified offset. This method is required by the interface \ArrayAccess. * Setting elements in a priority list is not straight forword when appending and setting at the * end boundary. When appending without an offset (a null offset), the item will be added at * the default priority. The item may not be the last item in the list. When appending with an @@ -733,7 +737,7 @@ class TPriorityList extends TList /** * Unsets the element at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param mixed the offset to unset element */ public function offsetUnset($offset) diff --git a/framework/Collections/TPriorityMap.php b/framework/Collections/TPriorityMap.php index 7cdde7f0..6f1bbba9 100644 --- a/framework/Collections/TPriorityMap.php +++ b/framework/Collections/TPriorityMap.php @@ -10,6 +10,9 @@ */ namespace Prado\Collections; +use Prado\TPropertyValue; +use Prado\Exceptions\TInvalidOperationException; +use Prado\Exceptions\TInvalidDataTypeException; /** * TPriorityMap class @@ -55,7 +58,6 @@ namespace Prado\Collections; * @package Prado\Collections * @since 3.2a */ -Prado::using('System.Collections.TMap'); class TPriorityMap extends TMap { @@ -158,12 +160,12 @@ class TPriorityMap extends TMap /** * Returns an iterator for traversing the items in the map. - * This method is required by the interface IteratorAggregate. + * This method is required by the interface \IteratorAggregate. * @return Iterator an iterator for traversing the items in the map. */ public function getIterator() { - return new ArrayIterator($this->flattenPriorities()); + return new \ArrayIterator($this->flattenPriorities()); } @@ -194,7 +196,7 @@ class TPriorityMap extends TMap /** * Returns the number of items in the map. - * This method is required by Countable interface. + * This method is required by \Countable interface. * @return integer number of items in the map. */ public function count() @@ -524,7 +526,7 @@ class TPriorityMap extends TMap } } } - else if(is_array($data)||$data instanceof Traversable) + else if(is_array($data)||$data instanceof \Traversable) { if($this->getCount()>0) $this->clear(); @@ -552,7 +554,7 @@ class TPriorityMap extends TMap $this->add($key,$value,$priority); } } - else if(is_array($data)||$data instanceof Traversable) + else if(is_array($data)||$data instanceof \Traversable) { foreach($data as $key=>$value) $this->add($key,$value); @@ -563,7 +565,7 @@ class TPriorityMap extends TMap /** * Returns whether there is an element at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param mixed the offset to check on * @return boolean */ @@ -574,7 +576,7 @@ class TPriorityMap extends TMap /** * Returns the element at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param integer the offset to retrieve element. * @return mixed the element at the offset, null if no element is found at the offset */ @@ -585,7 +587,7 @@ class TPriorityMap extends TMap /** * Sets the element at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param integer the offset to set element * @param mixed the element value */ @@ -596,7 +598,7 @@ class TPriorityMap extends TMap /** * Unsets the element at the specified offset. - * This method is required by the interface ArrayAccess. + * This method is required by the interface \ArrayAccess. * @param mixed the offset to unset element */ public function offsetUnset($offset) diff --git a/framework/Collections/TQueue.php b/framework/Collections/TQueue.php index 5126e5d9..6bb38377 100644 --- a/framework/Collections/TQueue.php +++ b/framework/Collections/TQueue.php @@ -10,6 +10,8 @@ */ namespace Prado\Collections; +use Prado\Exceptions\TInvalidDataTypeException; +use Prado\Exceptions\TInvalidOperationException; /** * TQueue class @@ -32,7 +34,7 @@ namespace Prado\Collections; * @package Prado\Collections * @since 3.1 */ -class TQueue extends TComponent implements IteratorAggregate,Countable +class TQueue extends \Prado\TComponent implements \IteratorAggregate, \Countable { /** * internal data storage @@ -73,7 +75,7 @@ class TQueue extends TComponent implements IteratorAggregate,Countable */ public function copyFrom($data) { - if(is_array($data) || ($data instanceof Traversable)) + if(is_array($data) || ($data instanceof \Traversable)) { $this->clear(); foreach($data as $item) @@ -146,12 +148,12 @@ class TQueue extends TComponent implements IteratorAggregate,Countable /** * Returns an iterator for traversing the items in the queue. - * This method is required by the interface IteratorAggregate. + * This method is required by the interface \IteratorAggregate. * @return Iterator an iterator for traversing the items in the queue. */ public function getIterator() { - return new ArrayIterator( $this->_d ); + return new \ArrayIterator( $this->_d ); } /** @@ -164,7 +166,7 @@ class TQueue extends TComponent implements IteratorAggregate,Countable /** * Returns the number of items in the queue. - * This method is required by Countable interface. + * This method is required by \Countable interface. * @return integer number of items in the queue. */ public function count() diff --git a/framework/Collections/TQueueIterator.php b/framework/Collections/TQueueIterator.php index 40919686..2e454af2 100644 --- a/framework/Collections/TQueueIterator.php +++ b/framework/Collections/TQueueIterator.php @@ -14,7 +14,7 @@ namespace Prado\Collections; /** * TQueueIterator class * - * TQueueIterator implements Iterator interface. + * TQueueIterator implements \Iterator interface. * * TQueueIterator is used by TQueue. It allows TQueue to return a new iterator * for traversing the items in the queue. @@ -23,7 +23,7 @@ namespace Prado\Collections; * @package Prado\Collections * @since 3.1 */ -class TQueueIterator implements Iterator +class TQueueIterator implements \Iterator { /** * @var array the data to be iterated through diff --git a/framework/Collections/TStack.php b/framework/Collections/TStack.php index 3c903e7e..540c213b 100644 --- a/framework/Collections/TStack.php +++ b/framework/Collections/TStack.php @@ -10,6 +10,8 @@ */ namespace Prado\Collections; +use Prado\Exceptions\TInvalidDataTypeException; +use Prado\Exceptions\TInvalidOperationException; /** * TStack class @@ -31,7 +33,7 @@ namespace Prado\Collections; * @package Prado\Collections * @since 3.0 */ -class TStack extends TComponent implements IteratorAggregate,Countable +class TStack extends \Prado\TComponent implements \IteratorAggregate, \Countable { /** * internal data storage @@ -72,7 +74,7 @@ class TStack extends TComponent implements IteratorAggregate,Countable */ public function copyFrom($data) { - if(is_array($data) || ($data instanceof Traversable)) + if(is_array($data) || ($data instanceof \Traversable)) { $this->clear(); foreach($data as $item) @@ -145,12 +147,12 @@ class TStack extends TComponent implements IteratorAggregate,Countable /** * Returns an iterator for traversing the items in the stack. - * This method is required by the interface IteratorAggregate. + * This method is required by the interface \IteratorAggregate. * @return Iterator an iterator for traversing the items in the stack. */ public function getIterator() { - return new ArrayIterator( $this->_d ); + return new \ArrayIterator( $this->_d ); } /** @@ -163,7 +165,7 @@ class TStack extends TComponent implements IteratorAggregate,Countable /** * Returns the number of items in the stack. - * This method is required by Countable interface. + * This method is required by \Countable interface. * @return integer number of items in the stack. */ public function count() diff --git a/framework/Collections/TStackIterator.php b/framework/Collections/TStackIterator.php index 1ebc2ccd..43b1a8bd 100644 --- a/framework/Collections/TStackIterator.php +++ b/framework/Collections/TStackIterator.php @@ -14,7 +14,7 @@ namespace Prado\Collections; /** * TStackIterator class * - * TStackIterator implements Iterator interface. + * TStackIterator implements \Iterator interface. * * TStackIterator is used by TStack. It allows TStack to return a new iterator * for traversing the items in the list. @@ -24,7 +24,7 @@ namespace Prado\Collections; * @package Prado\Collections * @since 3.0 */ -class TStackIterator implements Iterator +class TStackIterator implements \Iterator { /** * @var array the data to be iterated through |