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

Commit

Permalink
Initial PrefixPathLoader tests
Browse files Browse the repository at this point in the history
- Modified most functionality to use SPL (or SPL-derivative) classes
- Removed all statics (preparing for another solution)
  • Loading branch information
weierophinney committed Sep 27, 2010
2 parents edaa760 + c4c0c95 commit 9f4ca1b
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions src/ArrayStack.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* @namespace
*/
namespace Zend\Stdlib;

use ArrayIterator,
ArrayObject;

/**
* ArrayObject that acts as a stack with regards to iteration
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class ArrayStack extends ArrayObject
{
/**
* Retrieve iterator
*
* Retrieve an array copy of the object, reverse its order, and return an
* ArrayIterator with that reversed array.
*
* @return ArrayIterator
*/
public function getIterator()
{
$array = $this->getArrayCopy();
return new ArrayIterator(array_reverse($array));
}
}

0 comments on commit 9f4ca1b

Please sign in to comment.