From 035c6a74773ddbe755de589383e90c64ba171be8 Mon Sep 17 00:00:00 2001 From: Gabriel Baker Date: Sat, 21 Apr 2012 22:43:30 +0100 Subject: [PATCH 1/3] Fxed un-needed use statements --- src/Exception/InvalidArgumentException.php | 2 -- src/Exception/RendererCreationException.php | 2 -- src/Object/AbstractObject.php | 3 +-- src/Object/Ean8.php | 3 +-- src/Object/Exception/BarcodeValidationException.php | 2 -- src/Object/Exception/ExtensionNotLoadedException.php | 2 -- src/Object/Exception/InvalidArgumentException.php | 2 -- src/Object/Exception/OutOfRangeException.php | 2 -- src/Object/Exception/RuntimeException.php | 2 -- src/Object/Upce.php | 3 +-- src/Renderer/AbstractRenderer.php | 1 - src/Renderer/Exception/InvalidArgumentException.php | 2 -- src/Renderer/Exception/OutOfRangeException.php | 2 -- src/Renderer/Exception/RuntimeException.php | 2 -- src/Renderer/Exception/UnexpectedValueException.php | 2 -- src/Renderer/Pdf.php | 3 +-- 16 files changed, 4 insertions(+), 31 deletions(-) diff --git a/src/Exception/InvalidArgumentException.php b/src/Exception/InvalidArgumentException.php index d682a32..07a22e0 100644 --- a/src/Exception/InvalidArgumentException.php +++ b/src/Exception/InvalidArgumentException.php @@ -21,8 +21,6 @@ namespace Zend\Barcode\Exception; -use Zend\Barcode\Exception\ExceptionInterface; - /** * Exception for Zend_Barcode component. * diff --git a/src/Exception/RendererCreationException.php b/src/Exception/RendererCreationException.php index 0165d5e..9bcb0d1 100644 --- a/src/Exception/RendererCreationException.php +++ b/src/Exception/RendererCreationException.php @@ -21,8 +21,6 @@ namespace Zend\Barcode\Exception; -use Zend\Barcode\Exception\ExceptionInterface; - /** * Exception for Zend_Barcode component. * diff --git a/src/Object/AbstractObject.php b/src/Object/AbstractObject.php index a93c7e0..ecba756 100644 --- a/src/Object/AbstractObject.php +++ b/src/Object/AbstractObject.php @@ -23,7 +23,6 @@ use Traversable, Zend\Barcode, - Zend\Barcode\Object\Exception\ExceptionInterface, Zend\Validator\Barcode as BarcodeValidator, Zend\Stdlib\ArrayUtils; @@ -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\ObjectInterface +abstract class AbstractObject implements ObjectInterface { /** * Namespace of the barcode for autoloading diff --git a/src/Object/Ean8.php b/src/Object/Ean8.php index a670ffb..4f2d9af 100644 --- a/src/Object/Ean8.php +++ b/src/Object/Ean8.php @@ -21,8 +21,7 @@ namespace Zend\Barcode\Object; -use Zend\Barcode\Object\Exception\ExceptionInterface, - Zend\Validator\Barcode as BarcodeValidator; +use Zend\Validator\Barcode as BarcodeValidator; /** * Class for generate Ean8 barcode diff --git a/src/Object/Exception/BarcodeValidationException.php b/src/Object/Exception/BarcodeValidationException.php index 46943cb..f89e858 100644 --- a/src/Object/Exception/BarcodeValidationException.php +++ b/src/Object/Exception/BarcodeValidationException.php @@ -21,8 +21,6 @@ namespace Zend\Barcode\Object\Exception; -use Zend\Barcode\Object\Exception\ExceptionInterface; - /** * Exception for Zend_Barcode component. * diff --git a/src/Object/Exception/ExtensionNotLoadedException.php b/src/Object/Exception/ExtensionNotLoadedException.php index 0fdfec6..09a2112 100644 --- a/src/Object/Exception/ExtensionNotLoadedException.php +++ b/src/Object/Exception/ExtensionNotLoadedException.php @@ -21,8 +21,6 @@ namespace Zend\Barcode\Object\Exception; -use Zend\Barcode\Object\Exception\ExceptionInterface; - /** * Exception for Zend_Barcode component. * diff --git a/src/Object/Exception/InvalidArgumentException.php b/src/Object/Exception/InvalidArgumentException.php index 30d4d18..9c550b2 100644 --- a/src/Object/Exception/InvalidArgumentException.php +++ b/src/Object/Exception/InvalidArgumentException.php @@ -21,8 +21,6 @@ namespace Zend\Barcode\Object\Exception; -use Zend\Barcode\Object\Exception\ExceptionInterface; - /** * Exception for Zend_Barcode component. * diff --git a/src/Object/Exception/OutOfRangeException.php b/src/Object/Exception/OutOfRangeException.php index fe6bae4..4be2aba 100644 --- a/src/Object/Exception/OutOfRangeException.php +++ b/src/Object/Exception/OutOfRangeException.php @@ -21,8 +21,6 @@ namespace Zend\Barcode\Object\Exception; -use Zend\Barcode\Object\Exception\ExceptionInterface; - /** * Exception for Zend_Barcode component. * diff --git a/src/Object/Exception/RuntimeException.php b/src/Object/Exception/RuntimeException.php index 6d2f85a..f1128dc 100644 --- a/src/Object/Exception/RuntimeException.php +++ b/src/Object/Exception/RuntimeException.php @@ -21,8 +21,6 @@ namespace Zend\Barcode\Object\Exception; -use Zend\Barcode\Object\Exception\ExceptionInterface; - /** * Exception for Zend_Barcode component. * diff --git a/src/Object/Upce.php b/src/Object/Upce.php index 6c66f2a..6e4e72c 100644 --- a/src/Object/Upce.php +++ b/src/Object/Upce.php @@ -21,8 +21,7 @@ namespace Zend\Barcode\Object; -use Zend\Validator\Barcode as BarcodeValidator, - Zend\Barcode\Object\Exception\ExceptionInterface; +use Zend\Validator\Barcode as BarcodeValidator; /** * Class for generate UpcA barcode diff --git a/src/Renderer/AbstractRenderer.php b/src/Renderer/AbstractRenderer.php index d27884a..301ccf7 100644 --- a/src/Renderer/AbstractRenderer.php +++ b/src/Renderer/AbstractRenderer.php @@ -25,7 +25,6 @@ Zend\Barcode\Barcode, Zend\Barcode\Exception\ExceptionInterface as BarcodeException, Zend\Barcode\Object\ObjectInterface, - Zend\Barcode\Renderer\RendererInterface, Zend\Stdlib\ArrayUtils; /** diff --git a/src/Renderer/Exception/InvalidArgumentException.php b/src/Renderer/Exception/InvalidArgumentException.php index 6c7f8c9..4555cfb 100644 --- a/src/Renderer/Exception/InvalidArgumentException.php +++ b/src/Renderer/Exception/InvalidArgumentException.php @@ -21,8 +21,6 @@ namespace Zend\Barcode\Renderer\Exception; -use Zend\Barcode\Renderer\Exception; - /** * Exception for Zend_Barcode component. * diff --git a/src/Renderer/Exception/OutOfRangeException.php b/src/Renderer/Exception/OutOfRangeException.php index 4d48c88..90ed532 100644 --- a/src/Renderer/Exception/OutOfRangeException.php +++ b/src/Renderer/Exception/OutOfRangeException.php @@ -21,8 +21,6 @@ namespace Zend\Barcode\Renderer\Exception; -use Zend\Barcode\Renderer\Exception; - /** * Exception for Zend_Barcode component. * diff --git a/src/Renderer/Exception/RuntimeException.php b/src/Renderer/Exception/RuntimeException.php index 90dcc15..d58c2f6 100644 --- a/src/Renderer/Exception/RuntimeException.php +++ b/src/Renderer/Exception/RuntimeException.php @@ -21,8 +21,6 @@ namespace Zend\Barcode\Renderer\Exception; -use Zend\Barcode\Renderer\Exception; - /** * Exception for Zend_Barcode component. * diff --git a/src/Renderer/Exception/UnexpectedValueException.php b/src/Renderer/Exception/UnexpectedValueException.php index 903066c..05500be 100644 --- a/src/Renderer/Exception/UnexpectedValueException.php +++ b/src/Renderer/Exception/UnexpectedValueException.php @@ -21,8 +21,6 @@ namespace Zend\Barcode\Renderer\Exception; -use Zend\Barcode\Renderer\Exception; - /** * Exception for Zend_Barcode component. * diff --git a/src/Renderer/Pdf.php b/src/Renderer/Pdf.php index 93f0993..51ae208 100644 --- a/src/Renderer/Pdf.php +++ b/src/Renderer/Pdf.php @@ -21,8 +21,7 @@ namespace Zend\Barcode\Renderer; -use Zend\Barcode\Renderer\Exception\ExceptionInterface, - Zend\Pdf\Color, +use Zend\Pdf\Color, Zend\Pdf\Font, Zend\Pdf\Page, Zend\Pdf\PdfDocument; From fbe6ce0c2f2ce3105100e0456696872950072138 Mon Sep 17 00:00:00 2001 From: Maks Date: Mon, 23 Apr 2012 19:33:18 +0300 Subject: [PATCH 2/3] Typo --- src/Renderer/Pdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Renderer/Pdf.php b/src/Renderer/Pdf.php index fa8c962..a61bb33 100644 --- a/src/Renderer/Pdf.php +++ b/src/Renderer/Pdf.php @@ -56,7 +56,7 @@ class Pdf extends AbstractRenderer protected $moduleSize = 0.5; /** - * Set an PDF resource to draw the barcode inside + * Set a PDF resource to draw the barcode inside * * @param PdfDocument $pdf * @param integer $page From f79298cb4946a76746ff11ce7041e38fbdc99a59 Mon Sep 17 00:00:00 2001 From: Maks Date: Wed, 25 Apr 2012 09:06:17 +0300 Subject: [PATCH 3/3] [Zend\Barcode] Fix imports breaking the code and the docblocks --- src/Renderer/AbstractRenderer.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Renderer/AbstractRenderer.php b/src/Renderer/AbstractRenderer.php index 301ccf7..11aacd2 100644 --- a/src/Renderer/AbstractRenderer.php +++ b/src/Renderer/AbstractRenderer.php @@ -23,8 +23,8 @@ use Traversable, Zend\Barcode\Barcode, - Zend\Barcode\Exception\ExceptionInterface as BarcodeException, - Zend\Barcode\Object\ObjectInterface, + Zend\Barcode\Exception as BarcodeException, + Zend\Barcode\Object, Zend\Stdlib\ArrayUtils; /** @@ -314,12 +314,12 @@ public function getAutomaticRenderError() /** * Set the barcode object - * @param Object $barcode + * @param Object\ObjectInterface $barcode * @return AbstractRenderer */ public function setBarcode($barcode) { - if (!$barcode instanceof ObjectInterface) { + if (!$barcode instanceof Object\ObjectInterface) { throw new Exception\InvalidArgumentException( 'Invalid barcode object provided to setBarcode()' ); @@ -416,7 +416,7 @@ public function draw() $this->checkParams(); $this->initRenderer(); $this->drawInstructionList(); - } catch (BarcodeException $e) { + } catch (BarcodeException\ExceptionInterface $e) { if ($this->automaticRenderError && !($e instanceof BarcodeException\RendererCreationException)) { $barcode = Barcode::makeBarcode( 'error',