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

Commit

Permalink
Removed old test files for Zend/Cloud/Infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 18 changed files with 273 additions and 34 deletions.
4 changes: 2 additions & 2 deletions src/ArrayStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -31,7 +31,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class ArrayStack extends ArrayObject
Expand Down
4 changes: 2 additions & 2 deletions src/CallbackHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -35,7 +35,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class CallbackHandler
Expand Down
119 changes: 119 additions & 0 deletions src/ErrorHandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?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-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Stdlib;

use ErrorException;

/**
* ErrorHandler that can be used to catch internal PHP errors
* and convert to a ErrorException instance.
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class ErrorHandler
{
/**
* Flag to mark started
*
* @var boolean
*/
protected static $started = false;

/**
* All errors as one instance of ErrorException
* using the previous exception support.
*
* @var null|ErrorException
*/
protected static $errorException = null;

/**
* If the error handler has been started.
*
* @return boolean
*/
public static function started()
{
return static::$started;
}

/**
* Starting the error handler
*
* @param int $errorLevel
* @throws Exception\LogicException If already started
*/
public static function start($errorLevel = \E_WARNING)
{
if (static::started() === true) {
throw new Exception\LogicException('ErrorHandler already started');
}

static::$started = true;
static::$errorException = null;

set_error_handler(array(get_called_class(), 'addError'), $errorLevel);
}

/**
* Stopping the error handler
*
* @param boolean $throw Throw the ErrorException if any
* @return null|ErrorException
* @throws Exception\LogicException If not started before
* @throws ErrorException If an error has been catched and $throw is true
*/
public static function stop($throw = false)
{
if (static::started() === false) {
throw new Exception\LogicException('ErrorHandler not started');
}

$errorException = static::$errorException;

static::$started = false;
static::$errorException = null;
restore_error_handler();

if ($errorException && $throw) {
throw $errorException;
}

return $errorException;
}

/**
* Add an error to the stack.
*
* @param int $errno
* @param string $errstr
* @param string $errfile
* @param int $errline
* @return void
*/
public static function addError($errno, $errstr = '', $errfile = '', $errline = 0)
{
static::$errorException = new ErrorException($errstr, 0, $errno, $errfile, $errline, static::$errorException);
}
}
4 changes: 2 additions & 2 deletions src/Exception/BadMethodCallException.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -30,7 +30,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class BadMethodCallException extends \BadMethodCallException
Expand Down
4 changes: 2 additions & 2 deletions src/Exception/InvalidCallbackException.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -32,7 +32,7 @@
* @uses Zend\Stdlib\Exception
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class InvalidCallbackException
Expand Down
38 changes: 38 additions & 0 deletions src/Exception/LogicException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?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-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

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

use Zend\Stdlib\Exception;

/**
* logic exception
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class LogicException extends \LogicException implements Exception
{
}
12 changes: 6 additions & 6 deletions src/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -28,22 +28,22 @@
/**
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Options implements ParameterObject
{
/**
* @param array|Traversable|null $config
* @param array|Traversable|null $options
* @return Options
* @throws Exception\InvalidArgumentException
*/
public function __construct($config = null)
public function __construct($options = null)
{
if (is_null($config)) {
if (is_null($options)) {
return;
}
$this->processArray($config);
$this->processArray($options);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/ParameterObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -26,7 +26,7 @@
/**
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface ParameterObject
Expand Down
4 changes: 2 additions & 2 deletions src/PriorityQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -41,7 +41,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class PriorityQueue implements Countable, IteratorAggregate, Serializable
Expand Down
4 changes: 2 additions & 2 deletions src/SplPriorityQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -33,7 +33,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class SplPriorityQueue extends \SplPriorityQueue implements Serializable
Expand Down
4 changes: 2 additions & 2 deletions src/SplQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -30,7 +30,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class SplQueue extends \SplQueue implements Serializable
Expand Down
4 changes: 2 additions & 2 deletions src/SplStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -30,7 +30,7 @@
*
* @category Zend
* @package Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class SplStack extends \SplStack implements Serializable
Expand Down
4 changes: 2 additions & 2 deletions test/CallbackHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Stdlib
* @subpackage UnitTests
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id:$
*/
Expand All @@ -29,7 +29,7 @@
* @package Zend_Stdlib
* @subpackage UnitTests
* @group Zend_Stdlib
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class CallbackHandlerTest extends \PHPUnit_Framework_TestCase
Expand Down
Loading

0 comments on commit 1d082e4

Please sign in to comment.