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

Commit

Permalink
Merge branch 'develop' of git://github.com/zendframework/zf2 into fea…
Browse files Browse the repository at this point in the history
…ture/cache-session-storage

Conflicts:
	CHANGELOG.md
  • Loading branch information
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
34 changes: 16 additions & 18 deletions src/Barcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
*/
abstract class Barcode
{
const OBJECT = 'OBJECT';
const RENDERER = 'RENDERER';
/**
* Default barcode TTF font name
*
Expand Down Expand Up @@ -56,11 +54,11 @@ abstract class Barcode
*/
public static function getObjectPluginManager()
{
if (!self::$objectPlugins instanceof ObjectPluginManager) {
self::$objectPlugins = new ObjectPluginManager();
if (!static::$objectPlugins instanceof ObjectPluginManager) {
static::$objectPlugins = new ObjectPluginManager();
}

return self::$objectPlugins;
return static::$objectPlugins;
}

/**
Expand All @@ -70,11 +68,11 @@ public static function getObjectPluginManager()
*/
public static function getRendererPluginManager()
{
if (!self::$rendererPlugins instanceof RendererPluginManager) {
self::$rendererPlugins = new RendererPluginManager();
if (!static::$rendererPlugins instanceof RendererPluginManager) {
static::$rendererPlugins = new RendererPluginManager();
}

return self::$rendererPlugins;
return static::$rendererPlugins;
}

/**
Expand Down Expand Up @@ -131,12 +129,12 @@ public static function factory($barcode,
}

try {
$barcode = self::makeBarcode($barcode, $barcodeConfig);
$renderer = self::makeRenderer($renderer, $rendererConfig);
$barcode = static::makeBarcode($barcode, $barcodeConfig);
$renderer = static::makeRenderer($renderer, $rendererConfig);
} catch (Exception\ExceptionInterface $e) {
if ($automaticRenderError && !($e instanceof Exception\RendererCreationException)) {
$barcode = self::makeBarcode('error', array( 'text' => $e->getMessage() ));
$renderer = self::makeRenderer($renderer, array());
$barcode = static::makeBarcode('error', array( 'text' => $e->getMessage() ));
$renderer = static::makeRenderer($renderer, array());
} else {
throw $e;
}
Expand Down Expand Up @@ -197,7 +195,7 @@ public static function makeBarcode($barcode, $barcodeConfig = array())
);
}

return self::getObjectPluginManager()->get($barcode, $barcodeConfig);
return static::getObjectPluginManager()->get($barcode, $barcodeConfig);
}

/**
Expand Down Expand Up @@ -249,7 +247,7 @@ public static function makeRenderer($renderer = 'image', $rendererConfig = array
);
}

return self::getRendererPluginManager()->get($renderer, $rendererConfig);
return static::getRendererPluginManager()->get($renderer, $rendererConfig);
}

/**
Expand All @@ -265,7 +263,7 @@ public static function render($barcode,
$barcodeConfig = array(),
$rendererConfig = array())
{
self::factory($barcode, $renderer, $barcodeConfig, $rendererConfig)->render();
static::factory($barcode, $renderer, $barcodeConfig, $rendererConfig)->render();
}

/**
Expand All @@ -282,7 +280,7 @@ public static function draw($barcode,
$barcodeConfig = array(),
$rendererConfig = array())
{
return self::factory($barcode, $renderer, $barcodeConfig, $rendererConfig)->draw();
return static::factory($barcode, $renderer, $barcodeConfig, $rendererConfig)->draw();
}

/**
Expand All @@ -293,7 +291,7 @@ public static function draw($barcode,
*/
public static function setBarcodeFont($font)
{
self::$staticFont = $font;
static::$staticFont = $font;
}

/**
Expand All @@ -303,6 +301,6 @@ public static function setBarcodeFont($font)
*/
public static function getBarcodeFont()
{
return self::$staticFont;
return static::$staticFont;
}
}
4 changes: 2 additions & 2 deletions src/Object/Code128.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ protected function convertToBarcodeChars($string)
$char = $string[$pos];
$code = null;

if (self::_isDigit($string, $pos, 4) && $currentCharset != 'C'
|| self::_isDigit($string, $pos, 2) && $currentCharset == 'C') {
if (static::_isDigit($string, $pos, 4) && $currentCharset != 'C'
|| static::_isDigit($string, $pos, 2) && $currentCharset == 'C') {
/**
* Switch to C if the next 4 chars are numeric or stay C if the next 2
* chars are numeric
Expand Down
4 changes: 3 additions & 1 deletion test/Renderer/TestCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ public function setUp()
public function tearDown()
{
Barcode\Barcode::setBarcodeFont(null);
date_default_timezone_set($this->originaltimezone);
if (!empty($this->originaltimezone)) {
date_default_timezone_set($this->originaltimezone);
}
}

public function testSetBarcodeObject()
Expand Down

0 comments on commit 244cca2

Please sign in to comment.