From fbacb8d2138e9a784db823d82b001f22d8b83840 Mon Sep 17 00:00:00 2001 From: blanchonvincent Date: Sat, 15 Sep 2012 14:13:18 +0200 Subject: [PATCH 1/6] Convert abstract classes that are only offering static methods To respect recommanation : "For classes that are only offering static methods, we typically recommend making them abstract." --- src/Barcode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Barcode.php b/src/Barcode.php index 35911e8..31f4646 100644 --- a/src/Barcode.php +++ b/src/Barcode.php @@ -20,7 +20,7 @@ * @category Zend * @package Zend_Barcode */ -class Barcode +abstract class Barcode { const OBJECT = 'OBJECT'; const RENDERER = 'RENDERER'; From 8c17266bc385e0e7f78f1c58b8e5e471e0a0b5bb Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Wed, 2 Jan 2013 21:51:39 +0700 Subject: [PATCH 2/6] set assignment in the first place --- src/Object/Code25interleaved.php | 2 +- src/Renderer/Pdf.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Object/Code25interleaved.php b/src/Object/Code25interleaved.php index be25714..2d11d74 100644 --- a/src/Object/Code25interleaved.php +++ b/src/Object/Code25interleaved.php @@ -85,7 +85,7 @@ protected function prepareBarcode() // Encoded $text $text = $this->getText(); - for ($i = 0; $len = strlen($text), $i < $len; $i += 2) { // Draw 2 chars at a time + for ($i = 0, $len = strlen($text); $i < $len; $i += 2) { // Draw 2 chars at a time $char1 = substr($text, $i, 1); $char2 = substr($text, $i + 1, 1); diff --git a/src/Renderer/Pdf.php b/src/Renderer/Pdf.php index 5bd8db6..6c8acc8 100644 --- a/src/Renderer/Pdf.php +++ b/src/Renderer/Pdf.php @@ -206,7 +206,7 @@ public function widthForStringUsingFontSize($text, $font, $fontSize) { $drawingString = iconv('UTF-8', 'UTF-16BE//IGNORE', $text); $characters = array(); - for ($i = 0; $len = strlen($drawingString), $i < $len; $i++) { + for ($i = 0, $len = strlen($drawingString); $i < $len; $i++) { $characters[] = (ord($drawingString[$i ++]) << 8) | ord($drawingString[$i]); } $glyphs = $font->glyphNumbersForCharacters($characters); From dc34a2c49233e89d43f7ae7ad2a53e9b3ce92b3b Mon Sep 17 00:00:00 2001 From: Ralph Schindler Date: Fri, 8 Feb 2013 10:24:43 -0600 Subject: [PATCH 3/6] Zend\Barcode: * Moved share flag into actual plugin manager --- src/Barcode.php | 2 -- src/ObjectPluginManager.php | 5 +++++ src/RendererPluginManager.php | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Barcode.php b/src/Barcode.php index 7b95064..39cc9bb 100644 --- a/src/Barcode.php +++ b/src/Barcode.php @@ -51,7 +51,6 @@ public static function getObjectPluginManager() { if (!static::$objectPlugins instanceof ObjectPluginManager) { static::$objectPlugins = new ObjectPluginManager(); - static::$objectPlugins->setShareByDefault(false); } return static::$objectPlugins; @@ -66,7 +65,6 @@ public static function getRendererPluginManager() { if (!static::$rendererPlugins instanceof RendererPluginManager) { static::$rendererPlugins = new RendererPluginManager(); - static::$rendererPlugins->setShareByDefault(false); } return static::$rendererPlugins; diff --git a/src/ObjectPluginManager.php b/src/ObjectPluginManager.php index d06da4d..991c4b5 100644 --- a/src/ObjectPluginManager.php +++ b/src/ObjectPluginManager.php @@ -20,6 +20,11 @@ */ class ObjectPluginManager extends AbstractPluginManager { + /** + * @var bool Ensure services are not shared + */ + protected $shareByDefault = false; + /** * Default set of barcode parsers * diff --git a/src/RendererPluginManager.php b/src/RendererPluginManager.php index d34dd00..93258e4 100644 --- a/src/RendererPluginManager.php +++ b/src/RendererPluginManager.php @@ -20,6 +20,11 @@ */ class RendererPluginManager extends AbstractPluginManager { + /** + * @var bool Ensure services are not shared + */ + protected $shareByDefault = false; + /** * Default set of barcode renderers * From e031998a4764a44a64426a2abaec89090608ccf3 Mon Sep 17 00:00:00 2001 From: Nicolas Eeckeloo Date: Mon, 29 Apr 2013 09:38:13 +0200 Subject: [PATCH 4/6] Fix coding standards PSR-2 --- src/Barcode.php | 2 +- src/Renderer/Svg.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Barcode.php b/src/Barcode.php index 39cc9bb..5fe07f6 100644 --- a/src/Barcode.php +++ b/src/Barcode.php @@ -128,7 +128,7 @@ public static function factory($barcode, $renderer = static::makeRenderer($renderer, $rendererConfig); } catch (Exception\ExceptionInterface $e) { if ($automaticRenderError && !($e instanceof Exception\RendererCreationException)) { - $barcode = static::makeBarcode('error', array( 'text' => $e->getMessage() )); + $barcode = static::makeBarcode('error', array('text' => $e->getMessage())); $renderer = static::makeRenderer($renderer, array()); } else { throw $e; diff --git a/src/Renderer/Svg.php b/src/Renderer/Svg.php index dda8a64..53ecbbb 100644 --- a/src/Renderer/Svg.php +++ b/src/Renderer/Svg.php @@ -191,7 +191,7 @@ protected function appendRootElement($tagName, $attributes = array(), $textConte protected function createElement($tagName, $attributes = array(), $textContent = null) { $element = $this->resource->createElement($tagName); - foreach ($attributes as $k =>$v) { + foreach ($attributes as $k => $v) { $element->setAttribute($k, $v); } if ($textContent !== null) { From de16e92d7b2ccde49550a7d1c47d079bf9c0d650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 29 Apr 2013 18:43:14 +0200 Subject: [PATCH 5/6] Remove more spaces before comma in array initializations --- src/Object/AbstractObject.php | 2 +- src/Object/Error.php | 4 ++-- src/Renderer/AbstractRenderer.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Object/AbstractObject.php b/src/Object/AbstractObject.php index ffc4774..73b0c48 100644 --- a/src/Object/AbstractObject.php +++ b/src/Object/AbstractObject.php @@ -1036,7 +1036,7 @@ protected function rotate($x1, $y1) $y2 = $y1 * cos($this->orientation / 180 * pi()) + $x1 * sin($this->orientation / 180 * pi()) + $this->getOffsetTop(); - return array(intval($x2) , intval($y2)); + return array(intval($x2), intval($y2)); } /** diff --git a/src/Object/Error.php b/src/Object/Error.php index 3c81f16..a1197fc 100644 --- a/src/Object/Error.php +++ b/src/Object/Error.php @@ -52,8 +52,8 @@ public function getWidth($recalculate = false) public function draw() { $this->instructions = array(); - $this->addText('ERROR:', 10, array(5 , 18), $this->font, 0, 'left'); - $this->addText($this->text, 10, array(5 , 32), $this->font, 0, 'left'); + $this->addText('ERROR:', 10, array(5, 18), $this->font, 0, 'left'); + $this->addText($this->text, 10, array(5, 32), $this->font, 0, 'left'); return $this->instructions; } diff --git a/src/Renderer/AbstractRenderer.php b/src/Renderer/AbstractRenderer.php index f27d7d1..e9b6799 100644 --- a/src/Renderer/AbstractRenderer.php +++ b/src/Renderer/AbstractRenderer.php @@ -215,7 +215,7 @@ public function setAutomaticRenderError($value) */ public function setHorizontalPosition($value) { - if (!in_array($value, array('left' , 'center' , 'right'))) { + if (!in_array($value, array('left', 'center', 'right'))) { throw new Exception\UnexpectedValueException( "Invalid barcode position provided must be 'left', 'center' or 'right'" ); @@ -241,7 +241,7 @@ public function getHorizontalPosition() */ public function setVerticalPosition($value) { - if (!in_array($value, array('top' , 'middle' , 'bottom'))) { + if (!in_array($value, array('top', 'middle', 'bottom'))) { throw new Exception\UnexpectedValueException( "Invalid barcode position provided must be 'top', 'middle' or 'bottom'" ); From ff66ceb44803a2257dafbddddd5310d009d05a59 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Wed, 1 May 2013 16:42:36 -0500 Subject: [PATCH 6/6] [2.2.0rc1] Release preparation - Updated all component composer.json files to reflect new branch aliases - Updated changelog - Updated readme --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index ccda441..d0de475 100644 --- a/composer.json +++ b/composer.json @@ -31,8 +31,8 @@ }, "extra": { "branch-alias": { - "dev-master": "2.1-dev", - "dev-develop": "2.2-dev" + "dev-master": "2.2-dev", + "dev-develop": "2.3-dev" } }, "autoload-dev": {