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 feat…
Browse files Browse the repository at this point in the history
…ure/console
  • Loading branch information
Thinkscape committed Jul 15, 2012
7 parents 52b2345 + 6551ff4 + e5066db + 30065eb + cd23bdb + f518ed9 + 54153cf commit 9ddc5d3
Show file tree
Hide file tree
Showing 99 changed files with 21,984 additions and 21,980 deletions.
2 changes: 1 addition & 1 deletion src/Exception/UnexpectedValueException.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @category Zend
* @package Zend_Barcode
*/
class UnexpectedValueException extends \UnexpectedValueException implements
class UnexpectedValueException extends \UnexpectedValueException implements
ExceptionInterface
{
}
4 changes: 2 additions & 2 deletions src/Object/Code128.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ protected function convertToBarcodeChars($string)
$result[] = $code;
$currentCharset = 'C';
}
} else if (in_array($char, $this->charSets['B']) && $currentCharset != 'B'
} elseif (in_array($char, $this->charSets['B']) && $currentCharset != 'B'
&& !(in_array($char, $this->charSets['A']) && $currentCharset == 'A')) {
/**
* Switch to B as B contains the char and B is not the current charset.
Expand All @@ -244,7 +244,7 @@ protected function convertToBarcodeChars($string)
}
$result[] = $code;
$currentCharset = 'B';
} else if (array_key_exists($char, $this->charSets['A']) && $currentCharset != 'A'
} elseif (array_key_exists($char, $this->charSets['A']) && $currentCharset != 'A'
&& !(array_key_exists($char, $this->charSets['B']) && $currentCharset == 'B')) {
/**
* Switch to C as C contains the char and C is not the current charset.
Expand Down
22 changes: 11 additions & 11 deletions src/Object/Ean13.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ class Ean13 extends AbstractObject
));

protected $parities = array(
0 => array('A','A','A','A','A','A'),
1 => array('A','A','B','A','B','B'),
2 => array('A','A','B','B','A','B'),
3 => array('A','A','B','B','B','A'),
4 => array('A','B','A','A','B','B'),
5 => array('A','B','B','A','A','B'),
6 => array('A','B','B','B','A','A'),
7 => array('A','B','A','B','A','B'),
8 => array('A','B','A','B','B','A'),
9 => array('A','B','B','A','B','A')
);
0 => array('A','A','A','A','A','A'),
1 => array('A','A','B','A','B','B'),
2 => array('A','A','B','B','A','B'),
3 => array('A','A','B','B','B','A'),
4 => array('A','B','A','A','B','B'),
5 => array('A','B','B','A','A','B'),
6 => array('A','B','B','B','A','A'),
7 => array('A','B','A','B','A','B'),
8 => array('A','B','A','B','B','A'),
9 => array('A','B','B','A','B','A')
);

/**
* Default options for Postnet barcode
Expand Down
2 changes: 1 addition & 1 deletion src/Object/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @category Zend
* @package Zend_Barcode
*/
class InvalidArgumentException extends Exception\InvalidArgumentException implements
class InvalidArgumentException extends Exception\InvalidArgumentException implements
ExceptionInterface
{
}
2 changes: 1 addition & 1 deletion src/Object/Exception/OutOfRangeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @category Zend
* @package Zend_Barcode
*/
class OutOfRangeException extends Exception\OutOfRangeException implements
class OutOfRangeException extends Exception\OutOfRangeException implements
ExceptionInterface
{
}
2 changes: 1 addition & 1 deletion src/Object/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @category Zend
* @package Zend_Barcode
*/
class RuntimeException extends Exception\RuntimeException implements
class RuntimeException extends Exception\RuntimeException implements
ExceptionInterface
{
}
8 changes: 4 additions & 4 deletions src/ObjectPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Plugin manager implementation for barcode parsers.
*
* Enforces that barcode parsers retrieved are instances of
* Object\AbstractObject. Additionally, it registers a number of default
* Object\AbstractObject. Additionally, it registers a number of default
* barcode parsers.
*
* @category Zend
Expand All @@ -26,7 +26,7 @@ class ObjectPluginManager extends AbstractPluginManager
{
/**
* Default set of barcode parsers
*
*
* @var array
*/
protected $invokableClasses = array(
Expand Down Expand Up @@ -55,8 +55,8 @@ class ObjectPluginManager extends AbstractPluginManager
*
* Checks that the barcode parser loaded is an instance
* of Object\AbstractObject.
*
* @param mixed $plugin
*
* @param mixed $plugin
* @return void
* @throws Exception\InvalidArgumentException if invalid
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Renderer/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @category Zend
* @package Zend_Barcode
*/
class InvalidArgumentException extends Exception\InvalidArgumentException implements
class InvalidArgumentException extends Exception\InvalidArgumentException implements
ExceptionInterface
{
}
2 changes: 1 addition & 1 deletion src/Renderer/Exception/OutOfRangeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @category Zend
* @package Zend_Barcode
*/
class OutOfRangeException extends Exception\OutOfRangeException implements
class OutOfRangeException extends Exception\OutOfRangeException implements
ExceptionInterface
{
}
2 changes: 1 addition & 1 deletion src/Renderer/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @category Zend
* @package Zend_Barcode
*/
class RuntimeException extends Exception\RuntimeException implements
class RuntimeException extends Exception\RuntimeException implements
ExceptionInterface
{
}
2 changes: 1 addition & 1 deletion src/Renderer/Exception/UnexpectedValueException.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @category Zend
* @package Zend_Barcode
*/
class UnexpectedValueException extends Exception\UnexpectedValueException implements
class UnexpectedValueException extends Exception\UnexpectedValueException implements
ExceptionInterface
{
}
6 changes: 5 additions & 1 deletion src/Renderer/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace Zend\Barcode\Renderer;

use Zend\Barcode\Exception\RendererCreationException;
use Zend\Stdlib\ErrorHandler;

/**
* Class for rendering the barcode as image
Expand Down Expand Up @@ -312,7 +313,10 @@ public function render()
header("Content-Type: image/" . $this->imageType);
$functionName = 'image' . $this->imageType;
$functionName($this->resource);
@imagedestroy($this->resource);

ErrorHandler::start(E_WARNING);
imagedestroy($this->resource);
ErrorHandler::stop();
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/RendererPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Plugin manager implementation for barcode renderers.
*
* Enforces that barcode parsers retrieved are instances of
* Renderer\AbstractRenderer. Additionally, it registers a number of default
* Renderer\AbstractRenderer. Additionally, it registers a number of default
* barcode renderers.
*
* @category Zend
Expand All @@ -26,7 +26,7 @@ class RendererPluginManager extends AbstractPluginManager
{
/**
* Default set of barcode renderers
*
*
* @var array
*/
protected $invokableClasses = array(
Expand All @@ -40,8 +40,8 @@ class RendererPluginManager extends AbstractPluginManager
*
* Checks that the barcode parser loaded is an instance
* of Renderer\AbstractRenderer.
*
* @param mixed $plugin
*
* @param mixed $plugin
* @return void
* @throws Exception\InvalidArgumentException if invalid
*/
Expand Down
8 changes: 4 additions & 4 deletions test/Object/Code128Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ public function testType()
public function testChecksum()
{
$this->assertSame(33, $this->object->getChecksum('BarCode 1'));
$this->assertSame(47, $this->object->getChecksum('CODE-128'));
$this->assertSame(47, $this->object->getChecksum('CODE-128'));
$this->assertSame(32, $this->object->getChecksum('FRAMEWORK-ZEND-COM'));
}

public function testKnownBarcodeConversion()
{
$barcode = new TestAsset\Code128Test();
$this->assertSame(array(104, 13, 17, 18, 19), $barcode->convertToBarcodeChars(-123));
$this->assertSame(array(104, 40, 41, 99, 34, 56, 78), $barcode->convertToBarcodeChars('HI345678'));
$barcode = new TestAsset\Code128Test();
$this->assertSame(array(104, 13, 17, 18, 19), $barcode->convertToBarcodeChars(-123));
$this->assertSame(array(104, 40, 41, 99, 34, 56, 78), $barcode->convertToBarcodeChars('HI345678'));
}

public function testSetText()
Expand Down
Loading

0 comments on commit 9ddc5d3

Please sign in to comment.