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

Commit

Permalink
Merge branch 'master' of git://github.com/zendframework/zf2 into hotf…
Browse files Browse the repository at this point in the history
…ix/ZF2-270
  • Loading branch information
cmple committed May 3, 2012
Show file tree
Hide file tree
Showing 49 changed files with 645 additions and 350 deletions.
4 changes: 1 addition & 3 deletions src/Exception/BadMethodCallException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@

namespace Zend\Cache\Exception;

use Zend\Cache\Exception;

/**
* @category Zend
* @package Zend_Cache
* @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 implements Exception
class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface
{
}
6 changes: 4 additions & 2 deletions src/Exception.php → src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@
*
* @category Zend
* @package Zend_Cache
* @subpackage Exception
* @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\Cache;
namespace Zend\Cache\Exception;

/**
* @category Zend
* @package Zend_Cache
* @subpackage Exception
* @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 Exception
interface ExceptionInterface
{
}
4 changes: 1 addition & 3 deletions src/Exception/ExtensionNotLoadedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@

namespace Zend\Cache\Exception;

use Zend\Cache\Exception;

/**
* @category Zend
* @package Zend_Cache
* @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 ExtensionNotLoadedException extends RuntimeException implements Exception
class ExtensionNotLoadedException extends RuntimeException implements ExceptionInterface
{
}
4 changes: 1 addition & 3 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@

namespace Zend\Cache\Exception;

use Zend\Cache\Exception;

/**
* @category Zend
* @package Zend_Cache
* @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 InvalidArgumentException extends \InvalidArgumentException implements Exception
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
{
}
4 changes: 1 addition & 3 deletions src/Exception/LogicException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@

namespace Zend\Cache\Exception;

use Zend\Cache\Exception;

/**
* @category Zend
* @package Zend_Cache
* @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
class LogicException extends \LogicException implements ExceptionInterface
{
}
4 changes: 1 addition & 3 deletions src/Exception/OutOfCapacityException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@

namespace Zend\Cache\Exception;

use Zend\Cache\Exception;

/**
* @category Zend
* @package Zend_Cache
* @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 OutOfCapacityException extends \OverflowException implements Exception
class OutOfCapacityException extends \OverflowException implements ExceptionInterface
{
}
4 changes: 1 addition & 3 deletions src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@

namespace Zend\Cache\Exception;

use Zend\Cache\Exception;

/**
* @category Zend
* @package Zend_Cache
* @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 RuntimeException extends \RuntimeException implements Exception
class RuntimeException extends \RuntimeException implements ExceptionInterface
{
}
4 changes: 1 addition & 3 deletions src/Exception/UnexpectedValueException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@

namespace Zend\Cache\Exception;

use Zend\Cache\Exception;

/**
* @category Zend
* @package Zend_Cache
* @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 UnexpectedValueException extends \UnexpectedValueException implements Exception
class UnexpectedValueException extends \UnexpectedValueException implements ExceptionInterface
{
}
4 changes: 1 addition & 3 deletions src/Exception/UnsupportedMethodCallException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@

namespace Zend\Cache\Exception;

use Zend\Cache\Exception;

/**
* @category Zend
* @package Zend_Cache
* @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 UnsupportedMethodCallException extends \BadMethodCallException implements Exception
class UnsupportedMethodCallException extends \BadMethodCallException implements ExceptionInterface
{
}
3 changes: 1 addition & 2 deletions src/Pattern/AbstractPattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
namespace Zend\Cache\Pattern;

use Zend\Cache\Exception,
Zend\Cache\Pattern,
Traversable;

/**
Expand All @@ -32,7 +31,7 @@
* @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 AbstractPattern implements Pattern
abstract class AbstractPattern implements PatternInterface
{
/**
* @var PatternOptions
Expand Down
2 changes: 1 addition & 1 deletion src/Pattern/CallbackCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

use Zend\Cache\Exception,
Zend\Cache\StorageFactory,
Zend\Cache\Storage\Adapter as StorageAdapter;
Zend\Cache\Storage\Adapter\AdapterInterface as StorageAdapter;

/**
* @category Zend
Expand Down
2 changes: 1 addition & 1 deletion src/Pattern/CaptureCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace Zend\Cache\Pattern;

use Zend\Cache\Exception,
Zend\Cache\Storage\Adapter as StorageAdapter;
Zend\Cache\Storage\Adapter\AdapterInterface as StorageAdapter;

/**
* @category Zend
Expand Down
6 changes: 3 additions & 3 deletions src/Pattern/OutputCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

use Zend\Cache\Exception,
Zend\Cache\StorageFactory,
Zend\Cache\Storage\Adapter as StorageAdapter;
Zend\Cache\Storage\Adapter\AdapterInterface as StorageAdapter;

/**
* @category Zend
Expand Down Expand Up @@ -62,7 +62,7 @@ public function setOptions(PatternOptions $options)
* else start buffering output until end() is called or the script ends.
*
* @param string $key Key
* @param array $storageOptions Options passing to Zend\Cache\Storage\Adapter::getItem
* @param array $storageOptions Options passing to Zend\Cache\Storage\Adapter\AdapterInterface::getItem
* @return boolean
* @throws Exception
*/
Expand All @@ -88,7 +88,7 @@ public function start($key, array $storageOptions = array())
* Stops bufferung output, write buffered data to cache using the given key on start()
* and displays the buffer.
*
* @param array $storageOptions Options passed to Zend\Cache\Storage\Adapter::setItem
* @param array $storageOptions Options passed to Zend\Cache\Storage\Adapter\AdapterInterface::setItem
* @return boolean TRUE on success, FALSE on failure writing to cache
* @throws Exception
*/
Expand Down
10 changes: 6 additions & 4 deletions src/Pattern.php → src/Pattern/PatternInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,29 @@
*
* @category Zend
* @package Zend_Cache
* @subpackage Pattern
* @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\Cache;
namespace Zend\Cache\Pattern;

/**
* @category Zend
* @package Zend_Cache
* @subpackage Pattern
* @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 Pattern
interface PatternInterface
{
/**
* Set pattern options
*
* @param Pattern\PatternOptions $options
* @param PatternOptions $options
* @return Pattern
*/
public function setOptions(Pattern\PatternOptions $options);
public function setOptions(PatternOptions $options);

/**
* Get all pattern options
Expand Down
4 changes: 2 additions & 2 deletions src/Pattern/PatternOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

use Zend\Cache\Exception,
Zend\Cache\StorageFactory,
Zend\Cache\Storage\Adapter as StorageAdapter,
Zend\Cache\Storage\Adapter\AdapterInterface as StorageAdapter,
Zend\Stdlib\Options;

/**
Expand Down Expand Up @@ -869,7 +869,7 @@ protected function storageFactory($storage)
$storage = StorageFactory::adapterFactory($storage);
} elseif ( !($storage instanceof StorageAdapter) ) {
throw new Exception\InvalidArgumentException(
'The storage must be an instanceof Zend\Cache\Storage\Adapter '
'The storage must be an instanceof Zend\Cache\Storage\Adapter\AdapterInterface '
. 'or an array passed to Zend\Cache\Storage::factory '
. 'or simply the name of the storage adapter'
);
Expand Down
6 changes: 4 additions & 2 deletions src/PatternBroker.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ class PatternBroker extends PluginBroker
*/
protected function validatePlugin($plugin)
{
if (!$plugin instanceof Pattern) {
throw new Exception\RuntimeException('Cache pattern must implement Zend\Cache\Pattern');
if (!$plugin instanceof Pattern\PatternInterface) {
throw new Exception\RuntimeException(
'Cache pattern must implement Zend\Cache\Pattern\PatternInterface'
);
}
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions src/PatternFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class PatternFactory
/**
* Instantiate a cache pattern
*
* @param string|Pattern $patternName
* @param string|Pattern\PatternInterface $patternName
* @param array|Traversable|Pattern\PatternOptions $options
* @return Pattern
* @return Pattern\PatternInterface
* @throws Exception\RuntimeException
*/
public static function factory($patternName, $options = array())
Expand All @@ -64,7 +64,7 @@ public static function factory($patternName, $options = array())
));
}

if ($patternName instanceof Pattern) {
if ($patternName instanceof Pattern\PatternInterface) {
$patternName->setOptions($options);
return $patternName;
}
Expand Down
Loading

0 comments on commit f40a98a

Please sign in to comment.