Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 4cc2cd6

Browse files
committed
Bring milestones/exceptions up-to-date with zf2/master
Merge branch 'zf2/master' into milestones/exceptions Conflicts: library/Zend/Amf/Parser/TypeLoader.php library/Zend/Amf/Server.php library/Zend/Application/AbstractBootstrap.php library/Zend/File/Transfer/Adapter/AbstractAdapter.php library/Zend/Filter/Inflector.php library/Zend/Filter/InputFilter.php library/Zend/Filter/StaticFilter.php library/Zend/Form/Element.php library/Zend/Form/Element/File.php library/Zend/InfoCard/XML/Security/Transform/Exception.php library/Zend/Navigation/Page/Mvc.php library/Zend/Paginator/Paginator.php library/Zend/Search/Lucene/Document/Exception.php library/Zend/Serializer/Adapter/Amf0.php library/Zend/Serializer/Adapter/Amf3.php library/Zend/Serializer/Exception.php library/Zend/Serializer/Serializer.php library/Zend/Service/Amazon/Ec2/AbstractService.php library/Zend/Tag/Cloud.php library/Zend/Tag/Cloud/Decorator/Exception.php library/Zend/Tag/Cloud/Decorator/HtmlTag.php library/Zend/Test/PHPUnit/ControllerTestCase.php library/Zend/Validator/StaticValidator.php library/Zend/Wildfire/Protocol/Exception.php library/Zend/Wildfire/Protocol/Exception/InvalidArgumentException.php tests/Zend/Application/AbstractBootstrapTest.php tests/Zend/Filter/InputTest.php tests/Zend/Filter/StaticFilterTest.php tests/Zend/Form/ElementTest.php tests/Zend/Form/FormTest.php tests/Zend/Paginator/PaginatorTest.php tests/Zend/Serializer/SerializerTest.php tests/Zend/Tag/Cloud/CloudTest.php tests/Zend/Tag/Cloud/Decorator/HtmlTagTest.php tests/Zend/Translate/Adapter/XmlTmTest.php
3 parents edaa760 + c4c0c95 + 9f4ca1b commit 4cc2cd6

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

src/ArrayStack.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
/**
3+
* Zend Framework
4+
*
5+
* LICENSE
6+
*
7+
* This source file is subject to the new BSD license that is bundled
8+
* with this package in the file LICENSE.txt.
9+
* It is also available through the world-wide-web at this URL:
10+
* http://framework.zend.com/license/new-bsd
11+
* If you did not receive a copy of the license and are unable to
12+
* obtain it through the world-wide-web, please send an email
13+
* to license@zend.com so we can send you a copy immediately.
14+
*
15+
* @category Zend
16+
* @package Zend_Stdlib
17+
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
18+
* @license http://framework.zend.com/license/new-bsd New BSD License
19+
*/
20+
21+
/**
22+
* @namespace
23+
*/
24+
namespace Zend\Stdlib;
25+
26+
use ArrayIterator,
27+
ArrayObject;
28+
29+
/**
30+
* ArrayObject that acts as a stack with regards to iteration
31+
*
32+
* @category Zend
33+
* @package Zend_Stdlib
34+
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
35+
* @license http://framework.zend.com/license/new-bsd New BSD License
36+
*/
37+
class ArrayStack extends ArrayObject
38+
{
39+
/**
40+
* Retrieve iterator
41+
*
42+
* Retrieve an array copy of the object, reverse its order, and return an
43+
* ArrayIterator with that reversed array.
44+
*
45+
* @return ArrayIterator
46+
*/
47+
public function getIterator()
48+
{
49+
$array = $this->getArrayCopy();
50+
return new ArrayIterator(array_reverse($array));
51+
}
52+
}

0 commit comments

Comments
 (0)