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 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 41 changed files with 170 additions and 195 deletions.
10 changes: 5 additions & 5 deletions src/Barcode.php
Expand Up @@ -147,7 +147,7 @@ public static function factory($barcode,
try {
$barcode = self::makeBarcode($barcode, $barcodeConfig);
$renderer = self::makeRenderer($renderer, $rendererConfig);
} catch (Exception $e) {
} catch (Exception\ExceptionInterface $e) {
if ($automaticRenderError && !($e instanceof Exception\RendererCreationException)) {
$barcode = self::makeBarcode('error', array( 'text' => $e->getMessage() ));
$renderer = self::makeRenderer($renderer, array());
Expand All @@ -169,7 +169,7 @@ public static function factory($barcode,
*/
public static function makeBarcode($barcode, $barcodeConfig = array())
{
if ($barcode instanceof Object) {
if ($barcode instanceof Object\ObjectInterface) {
return $barcode;
}

Expand Down Expand Up @@ -222,7 +222,7 @@ public static function makeBarcode($barcode, $barcodeConfig = array())
*/
public static function makeRenderer($renderer = 'image', $rendererConfig = array())
{
if ($renderer instanceof Renderer) {
if ($renderer instanceof Renderer\RendererInterface) {
return $renderer;
}

Expand Down Expand Up @@ -267,7 +267,7 @@ public static function makeRenderer($renderer = 'image', $rendererConfig = array
/**
* Proxy to renderer render() method
*
* @param string | Object | array | Traversable $barcode
* @param string | Object\ObjectInterface | array | Traversable $barcode
* @param string | Renderer $renderer
* @param array | Traversable $barcodeConfig
* @param array | Traversable $rendererConfig
Expand All @@ -283,7 +283,7 @@ public static function render($barcode,
/**
* Proxy to renderer draw() method
*
* @param string | Object | array | Traversable $barcode
* @param string | Object\ObjectInterface | array | Traversable $barcode
* @param string | Renderer $renderer
* @param array | Traversable $barcodeConfig
* @param array | Traversable $rendererConfig
Expand Down
5 changes: 3 additions & 2 deletions src/Exception.php → src/Exception/ExceptionInterface.php
Expand Up @@ -18,17 +18,18 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Barcode;
namespace Zend\Barcode\Exception;

/**
* Exception for Zend_Barcode component.
*
* @uses Zend\Exception
* @category Zend
* @package Zend_Barcode
* @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/InvalidArgumentException.php
Expand Up @@ -21,8 +21,6 @@

namespace Zend\Barcode\Exception;

use Zend\Barcode\Exception;

/**
* Exception for Zend_Barcode component.
*
Expand All @@ -33,6 +31,6 @@
*/
class InvalidArgumentException
extends \InvalidArgumentException
implements Exception
implements ExceptionInterface
{
}
4 changes: 1 addition & 3 deletions src/Exception/RendererCreationException.php
Expand Up @@ -21,8 +21,6 @@

namespace Zend\Barcode\Exception;

use Zend\Barcode\Exception;

/**
* Exception for Zend_Barcode component.
*
Expand All @@ -33,6 +31,6 @@
*/
class RendererCreationException
extends \InvalidArgumentException
implements Exception
implements ExceptionInterface
{
}
67 changes: 33 additions & 34 deletions src/Object/AbstractObject.php
Expand Up @@ -23,7 +23,6 @@

use Traversable,
Zend\Barcode,
Zend\Barcode\Object\Exception,
Zend\Validator\Barcode as BarcodeValidator,
Zend\Stdlib\ArrayUtils;

Expand All @@ -35,7 +34,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 AbstractObject implements Barcode\Object
abstract class AbstractObject implements ObjectInterface
{
/**
* Namespace of the barcode for autoloading
Expand Down Expand Up @@ -245,7 +244,7 @@ protected function getDefaultOptions()
/**
* Set barcode state from options array
* @param array $options
* @return \Zend\Barcode\Object
* @return \Zend\Barcode\Object\ObjectInterface
*/
public function setOptions($options)
{
Expand All @@ -262,7 +261,7 @@ public function setOptions($options)
* Set barcode namespace for autoloading
*
* @param string $namespace
* @return \Zend\Barcode\Object
* @return \Zend\Barcode\Object\ObjectInterface
*/
public function setBarcodeNamespace($namespace)
{
Expand Down Expand Up @@ -292,8 +291,8 @@ public function getType()
/**
* Set height of the barcode bar
* @param integer $value
* @return \Zend\Barcode\Object
* @throw \Zend\Barcode\Object\Exception
* @return \Zend\Barcode\Object\ObjectInterface
* @throw \Zend\Barcode\Object\Exception\ExceptionInterface
*/
public function setBarHeight($value)
{
Expand All @@ -318,8 +317,8 @@ public function getBarHeight()
/**
* Set thickness of thin bar
* @param integer $value
* @return \Zend\Barcode\Object
* @throw \Zend\Barcode\Object\Exception
* @return \Zend\Barcode\Object\ObjectInterface
* @throw \Zend\Barcode\Object\Exception\ExceptionInterface
*/
public function setBarThinWidth($value)
{
Expand All @@ -344,8 +343,8 @@ public function getBarThinWidth()
/**
* Set thickness of thick bar
* @param integer $value
* @return \Zend\Barcode\Object
* @throw \Zend\Barcode\Object\Exception
* @return \Zend\Barcode\Object\ObjectInterface
* @throw \Zend\Barcode\Object\Exception\ExceptionInterface
*/
public function setBarThickWidth($value)
{
Expand All @@ -371,8 +370,8 @@ public function getBarThickWidth()
* Set factor applying to
* thinBarWidth - thickBarWidth - barHeight - fontSize
* @param float $value
* @return \Zend\Barcode\Object
* @throw \Zend\Barcode\Object\Exception
* @return \Zend\Barcode\Object\ObjectInterface
* @throw \Zend\Barcode\Object\Exception\ExceptionInterface
*/
public function setFactor($value)
{
Expand All @@ -398,8 +397,8 @@ public function getFactor()
/**
* Set color of the barcode and text
* @param string $value
* @return \Zend\Barcode\Object
* @throw \Zend\Barcode\Object\Exception
* @return \Zend\Barcode\Object\ObjectInterface
* @throw \Zend\Barcode\Object\Exception\ExceptionInterface
*/
public function setForeColor($value)
{
Expand Down Expand Up @@ -427,8 +426,8 @@ public function getForeColor()
/**
* Set the color of the background
* @param integer $value
* @return \Zend\Barcode\Object
* @throw \Zend\Barcode\Object\Exception
* @return \Zend\Barcode\Object\ObjectInterface
* @throw \Zend\Barcode\Object\Exception\ExceptionInterface
*/
public function setBackgroundColor($value)
{
Expand Down Expand Up @@ -456,7 +455,7 @@ public function getBackgroundColor()
/**
* Activate/deactivate drawing of the bar
* @param boolean $value
* @return \Zend\Barcode\Object
* @return \Zend\Barcode\Object\ObjectInterface
*/
public function setWithBorder($value)
{
Expand Down Expand Up @@ -495,7 +494,7 @@ public function getWithQuietZones()

/**
* Allow fast inversion of font/bars color and background color
* @return \Zend\Barcode\Object
* @return \Zend\Barcode\Object\ObjectInterface
*/
public function setReverseColor()
{
Expand All @@ -508,8 +507,8 @@ public function setReverseColor()
/**
* Set orientation of barcode and text
* @param float $value
* @return \Zend\Barcode\Object
* @throw \Zend\Barcode\Object\Exception
* @return \Zend\Barcode\Object\ObjectInterface
* @throw \Zend\Barcode\Object\Exception\ExceptionInterface
*/
public function setOrientation($value)
{
Expand All @@ -529,7 +528,7 @@ public function getOrientation()
/**
* Set text to encode
* @param string $value
* @return \Zend\Barcode\Object
* @return \Zend\Barcode\Object\ObjectInterface
*/
public function setText($value)
{
Expand Down Expand Up @@ -598,7 +597,7 @@ public function getTextToDisplay()
/**
* Activate/deactivate drawing of text to encode
* @param boolean $value
* @return \Zend\Barcode\Object
* @return \Zend\Barcode\Object\ObjectInterface
*/
public function setDrawText($value)
{
Expand All @@ -619,8 +618,8 @@ public function getDrawText()
* Activate/deactivate the adjustment of the position
* of the characters to the position of the bars
* @param boolean $value
* @return \Zend\Barcode\Object
* @throw \Zend\Barcode\Object\Exception
* @return \Zend\Barcode\Object\ObjectInterface
* @throw \Zend\Barcode\Object\Exception\ExceptionInterface
*/
public function setStretchText($value)
{
Expand All @@ -643,7 +642,7 @@ public function getStretchText()
* of the checksum character
* added to the barcode text
* @param boolean $value
* @return \Zend\Barcode\Object
* @return \Zend\Barcode\Object\ObjectInterface
*/
public function setWithChecksum($value)
{
Expand All @@ -668,8 +667,8 @@ public function getWithChecksum()
* of the checksum character
* added to the barcode text
* @param boolean $value
* @return \Zend\Barcode\Object
* @throw \Zend\Barcode\Object\Exception
* @return \Zend\Barcode\Object\ObjectInterface
* @throw \Zend\Barcode\Object\Exception\ExceptionInterface
*/
public function setWithChecksumInText($value)
{
Expand All @@ -694,8 +693,8 @@ public function getWithChecksumInText()
* - if integer between 1 and 5, use gd built-in fonts
* - if string, $value is assumed to be the path to a TTF font
* @param integer|string $value
* @return \Zend\Barcode\Object
* @throw \Zend\Barcode\Object\Exception
* @return \Zend\Barcode\Object\ObjectInterface
* @throw \Zend\Barcode\Object\Exception\ExceptionInterface
*/
public function setFont($value)
{
Expand Down Expand Up @@ -734,8 +733,8 @@ public function getFont()
/**
* Set the size of the font in case of TTF
* @param float $value
* @return \Zend\Barcode\Object
* @throw \Zend\Barcode\Object\Exception
* @return \Zend\Barcode\Object\ObjectInterface
* @throw \Zend\Barcode\Object\Exception\ExceptionInterface
*/
public function setFontSize($value)
{
Expand Down Expand Up @@ -863,7 +862,7 @@ public function checkParams()
/**
* Check if a text is really provided to barcode
* @return void
* @throw \Zend\Barcode\Object\Exception
* @throw \Zend\Barcode\Object\Exception\ExceptionInterface
*/
protected function checkText($value = null)
{
Expand All @@ -883,7 +882,7 @@ protected function checkText($value = null)
* @param integer $min
* @param integer $max
* @return void
* @throw \Zend\Barcode\Object\Exception
* @throw \Zend\Barcode\Object\Exception\ExceptionInterface
*/
protected function checkRatio($min = 2, $max = 3)
{
Expand All @@ -901,7 +900,7 @@ protected function checkRatio($min = 2, $max = 3)
/**
* Drawing with an angle is just allow TTF font
* @return void
* @throw \Zend\Barcode\Object\Exception
* @throw \Zend\Barcode\Object\Exception\ExceptionInterface
*/
protected function checkFontAndOrientation()
{
Expand Down
3 changes: 1 addition & 2 deletions src/Object/Ean8.php
Expand Up @@ -21,8 +21,7 @@

namespace Zend\Barcode\Object;

use Zend\Barcode\Object\Exception,
Zend\Validator\Barcode as BarcodeValidator;
use Zend\Validator\Barcode as BarcodeValidator;

/**
* Class for generate Ean8 barcode
Expand Down
4 changes: 1 addition & 3 deletions src/Object/Exception/BarcodeValidationException.php
Expand Up @@ -21,8 +21,6 @@

namespace Zend\Barcode\Object\Exception;

use Zend\Barcode\Object\Exception;

/**
* Exception for Zend_Barcode component.
*
Expand All @@ -33,6 +31,6 @@
*/
class BarcodeValidationException
extends \Exception
implements Exception
implements ExceptionInterface
{
}
Expand Up @@ -14,22 +14,24 @@
*
* @category Zend
* @package Zend_Barcode
* @subpackage Object_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\Barcode\Object;
namespace Zend\Barcode\Object\Exception;

use Zend\Barcode\Exception as BarcodeException;
use Zend\Barcode\Exception\ExceptionInterface as BarcodeException;

/**
* Base exception interface for barcode objects
*
* @category Zend
* @package Zend_Barcode
* @subpackage Object_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 extends BarcodeException
interface ExceptionInterface extends BarcodeException
{
}
2 changes: 1 addition & 1 deletion src/Object/Exception/ExtensionNotLoadedException.php
Expand Up @@ -31,6 +31,6 @@
*/
class ExtensionNotLoadedException
extends \RuntimeException
implements \Zend\Barcode\Object\Exception
implements ExceptionInterface
{
}

0 comments on commit caa3725

Please sign in to comment.