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

Commit

Permalink
Merge remote-tracking branch 'zf2/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahar Evron committed Apr 19, 2011
2 parents 045137d + a62b890 commit 9ae12ce
Show file tree
Hide file tree
Showing 60 changed files with 148 additions and 136 deletions.
28 changes: 20 additions & 8 deletions src/Barcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
*
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

/**
* @namespace
*/
namespace Zend\Barcode;
use Zend\Loader\PluginLoader,
Zend\Loader\ShortNameLocater,
use Zend\Loader\PrefixPathLoader,
Zend\Loader\ShortNameLocator,
Zend\Config\Config,
Zend,
Zend\Barcode\Exception\RendererCreationException,
Expand All @@ -37,7 +37,7 @@
* @uses \Zend\Loader
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Barcode
Expand All @@ -64,12 +64,12 @@ class Barcode
/**
* Set plugin loader to use for validator or filter chain
*
* @param \Zend\Loader\ShortNameLocater $loader
* @param \Zend\Loader\ShortNameLocator $loader
* @param string $type 'object', or 'renderer'
* @return \Zend\Form\Element
* @throws \Zend\Form\Exception on invalid type
*/
public static function setPluginLoader(ShortNameLocater $loader, $type)
public static function setPluginLoader(ShortNameLocator $loader, $type)
{
$type = strtoupper($type);
switch ($type) {
Expand All @@ -89,7 +89,7 @@ public static function setPluginLoader(ShortNameLocater $loader, $type)
* 'decorator', 'filter', or 'validate' for $type.
*
* @param string $type
* @return \Zend\Loader\ShortNameLocater
* @return \Zend\Loader\ShortNameLocator
* @throws \Zend\Loader\Exception on invalid type.
*/
public static function getPluginLoader($type)
Expand All @@ -101,7 +101,7 @@ public static function getPluginLoader($type)
$prefixSegment = ucfirst(strtolower($type));
$pathSegment = $prefixSegment;
if (!isset(self::$_loaders[$type])) {
self::$_loaders[$type] = new PluginLoader(
self::$_loaders[$type] = new PrefixPathLoader(
array('Zend\\Barcode\\' . $prefixSegment . '\\' => 'Zend/Barcode/' . $pathSegment . '/')
);
}
Expand Down Expand Up @@ -230,6 +230,12 @@ public static function makeBarcode($barcode, $barcodeConfig = array())

$barcodeName = self::getPluginLoader(self::OBJECT)->load($barcode);

if (!class_exists($barcodeName)) {
throw new Exception\InvalidArgumentException(sprintf(
'Invalid Barcode "%s"; does not resolve to a valid class', $barcode
));
}

/*
* Create an instance of the barcode class.
* Pass the config to the barcode class constructor.
Expand Down Expand Up @@ -296,6 +302,12 @@ public static function makeRenderer($renderer = 'image', $rendererConfig = array

$rendererName = self::getPluginLoader(self::RENDERER)->load($renderer);

if (!class_exists($rendererName)) {
throw new Exception\InvalidArgumentException(sprintf(
'Invalid renderer "%s"; does not resolve to a valid class', $renderer
));
}

/*
* Create an instance of the barcode class.
* Pass the config to the barcode class constructor.
Expand Down
4 changes: 2 additions & 2 deletions src/BarcodeObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Barcode
* @subpackage Object
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -30,7 +30,7 @@
*
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface BarcodeObject
Expand Down
4 changes: 2 additions & 2 deletions src/BarcodeRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Barcode
* @subpackage Renderer
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -31,7 +31,7 @@
*
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface BarcodeRenderer
Expand Down
4 changes: 2 additions & 2 deletions src/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -29,7 +29,7 @@
* @uses Zend\Exception
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Exception
Expand Down
4 changes: 2 additions & 2 deletions src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id$
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
Expand All @@ -31,7 +31,7 @@
* @uses Zend\Exception
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class InvalidArgumentException
Expand Down
4 changes: 2 additions & 2 deletions src/Exception/RendererCreationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id$
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
Expand All @@ -31,7 +31,7 @@
* @uses Zend\Exception
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class RendererCreationException
Expand Down
4 changes: 2 additions & 2 deletions src/Object/AbstractObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @category Zend
* @package Zend_Barcode
* @subpackage Object
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -38,7 +38,7 @@
*
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class AbstractObject implements Barcode\BarcodeObject
Expand Down
4 changes: 2 additions & 2 deletions src/Object/Code25.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Barcode
* @subpackage Object
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -30,7 +30,7 @@
* @uses \Zend\Barcode\Object\AbstractObject
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Code25 extends AbstractObject
Expand Down
4 changes: 2 additions & 2 deletions src/Object/Code25interleaved.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Barcode
* @subpackage Object
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -30,7 +30,7 @@
* @uses \Zend\Barcode\Object\Code25
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Code25interleaved extends Code25
Expand Down
4 changes: 2 additions & 2 deletions src/Object/Code39.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Barcode
* @subpackage Object
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -30,7 +30,7 @@
* @uses \Zend\Barcode\Object\AbstractObject
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Code39 extends AbstractObject
Expand Down
4 changes: 2 additions & 2 deletions src/Object/Ean13.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Barcode
* @subpackage Object
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -30,7 +30,7 @@
* @uses \Zend\Barcode\Object\AbstractObject
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Ean13 extends AbstractObject
Expand Down
4 changes: 2 additions & 2 deletions src/Object/Ean2.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Barcode
* @subpackage Object
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -30,7 +30,7 @@
* @uses \Zend\Barcode\Object\Ean5
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Ean2 extends Ean5
Expand Down
4 changes: 2 additions & 2 deletions src/Object/Ean5.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Barcode
* @subpackage Object
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -30,7 +30,7 @@
* @uses \Zend\Barcode\Object\Ean13
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Ean5 extends Ean13
Expand Down
4 changes: 2 additions & 2 deletions src/Object/Ean8.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Barcode
* @subpackage Object
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -34,7 +34,7 @@
* @uses \Zend\Validator\Barcode\Barcode
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Ean8 extends Ean13
Expand Down
4 changes: 2 additions & 2 deletions src/Object/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @category Zend
* @package Zend_Barcode
* @subpackage Object
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -30,7 +30,7 @@
* @uses \Zend\Barcode\Object\AbstractObject
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Error extends AbstractObject
Expand Down
4 changes: 2 additions & 2 deletions src/Object/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

Expand All @@ -29,7 +29,7 @@
* @uses \Zend\Barcode\Exception
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Exception extends \Zend\Barcode\Exception
Expand Down
4 changes: 2 additions & 2 deletions src/Object/Exception/BarcodeValidationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id$
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
Expand All @@ -31,7 +31,7 @@
* @uses Zend\Exception
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class BarcodeValidationException
Expand Down
4 changes: 2 additions & 2 deletions src/Object/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id$
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
Expand All @@ -31,7 +31,7 @@
* @uses Zend\Exception
* @category Zend
* @package Zend_Barcode
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class InvalidArgumentException
Expand Down
Loading

0 comments on commit 9ae12ce

Please sign in to comment.