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

Commit

Permalink
Merge branch 'master' of git://github.com/zendframework/zf2 into cach…
Browse files Browse the repository at this point in the history
…e_plugin_priority

Conflicts:
	library/Zend/Cache/Storage/Adapter/AbstractAdapter.php
	library/Zend/Cache/Storage/Plugin/ClearByFactor.php
	library/Zend/Cache/Storage/Plugin/ExceptionHandler.php
	library/Zend/Cache/Storage/Plugin/IgnoreUserAbort.php
	library/Zend/Cache/Storage/Plugin/OptimizeByFactor.php
	library/Zend/Cache/Storage/Plugin/Serializer.php
  • Loading branch information
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/Exception.php → src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\File;
namespace Zend\File\Exception;

/**
* Marker interface for exceptions found in this component
Expand All @@ -28,6 +28,6 @@
* @subpackage Exception
* @license New BSD {@link http://framework.zend.com/license/new-bsd}
*/
interface Exception
interface ExceptionInterface
{
}
4 changes: 1 addition & 3 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

namespace Zend\File\Exception;

use Zend\File\Exception;

/**
* Exception class raised when invalid arguments are discovered
*
Expand All @@ -31,6 +29,6 @@
*/
class InvalidArgumentException
extends \InvalidArgumentException
implements Exception
implements ExceptionInterface
{
}
8 changes: 4 additions & 4 deletions src/Transfer/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public function addPrefixPaths(array $spec)
/**
* Adds a new validator for this class
*
* @param string|Validator\Validator $validator Type of validator to add
* @param string|Validator\ValidatorInterface $validator Type of validator to add
* @param boolean $breakChainOnFailure If the validation chain should stop an failure
* @param string|array $options Options to set for the validator
* @param string|array $files Files to limit this validator to
Expand All @@ -380,7 +380,7 @@ public function addPrefixPaths(array $spec)
*/
public function addValidator($validator, $breakChainOnFailure = false, $options = null, $files = null)
{
if ($validator instanceof Validator\Validator) {
if ($validator instanceof Validator\ValidatorInterface) {
$name = get_class($validator);
} elseif (is_string($validator)) {
$name = $this->getPluginLoader(self::VALIDATOR)->load($validator);
Expand All @@ -395,7 +395,7 @@ public function addValidator($validator, $breakChainOnFailure = false, $options
unset($options['messages']);
}
} else {
throw new Exception\InvalidArgumentException('Invalid validator provided to addValidator; must be string or Zend\Validator\Validator');
throw new Exception\InvalidArgumentException('Invalid validator provided to addValidator; must be string or Zend\Validator\ValidatorInterface');
}

$this->validators[$name] = $validator;
Expand Down Expand Up @@ -427,7 +427,7 @@ public function addValidator($validator, $breakChainOnFailure = false, $options
public function addValidators(array $validators, $files = null)
{
foreach ($validators as $name => $validatorInfo) {
if ($validatorInfo instanceof Validator\Validator) {
if ($validatorInfo instanceof Validator\ValidatorInterface) {
$this->addValidator($validatorInfo, null, null, $files);
} else if (is_string($validatorInfo)) {
if (!is_int($name)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Transfer/Exception/BadMethodCallException.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
*/
class BadMethodCallException
extends \BadMethodCallException
implements \Zend\File\Transfer\Exception
implements ExceptionInterface
{}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\File\Transfer;
namespace Zend\File\Transfer\Exception;

use Zend\File\Exception\ExceptionInterface as FileException;

/**
* Exception class for Zend\File\Transfer
Expand All @@ -28,7 +30,8 @@
* @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
extends FileException
{

}
2 changes: 1 addition & 1 deletion src/Transfer/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
*/
class InvalidArgumentException
extends \InvalidArgumentException
implements \Zend\File\Transfer\Exception
implements ExceptionInterface
{}
2 changes: 1 addition & 1 deletion src/Transfer/Exception/PhpEnvironmentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
*/
class PhpEnvironmentException
extends \RuntimeException
implements \Zend\File\Transfer\Exception
implements ExceptionInterface
{}
2 changes: 1 addition & 1 deletion src/Transfer/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
*/
class RuntimeException
extends \RuntimeException
implements \Zend\File\Transfer\Exception
implements ExceptionInterface
{}
4 changes: 2 additions & 2 deletions test/Transfer/Adapter/HttpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
namespace ZendTest\File\Transfer\Adapter;

use Zend\File\Transfer\Adapter,
Zend\File\Transfer\Exception,
Zend\File\Transfer\Exception\RuntimeException,
Zend\ProgressBar,
Zend\ProgressBar\Adapter as AdapterProgressBar,
Zend\Validator\File as FileValidator;
Expand Down Expand Up @@ -124,7 +124,7 @@ public function testReceiveUnknownFile()
{
try {
$this->assertFalse($this->adapter->receive('unknownFile'));
} catch (Exception $e) {
} catch (RuntimeException $e) {
$this->assertContains('not find', $e->getMessage());
}
}
Expand Down

0 comments on commit 0de9a5c

Please sign in to comment.