Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Barcode / ObjectPluginManager.php
blob991c4b5f60a98650596fd2a1efdb2aa10a04293c
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Barcode;
12 use Zend\ServiceManager\AbstractPluginManager;
14 /**
15 * Plugin manager implementation for barcode parsers.
17 * Enforces that barcode parsers retrieved are instances of
18 * Object\AbstractObject. Additionally, it registers a number of default
19 * barcode parsers.
21 class ObjectPluginManager extends AbstractPluginManager
23 /**
24 * @var bool Ensure services are not shared
26 protected $shareByDefault = false;
28 /**
29 * Default set of barcode parsers
31 * @var array
33 protected $invokableClasses = array(
34 'codabar' => 'Zend\Barcode\Object\Codabar',
35 'code128' => 'Zend\Barcode\Object\Code128',
36 'code25' => 'Zend\Barcode\Object\Code25',
37 'code25interleaved' => 'Zend\Barcode\Object\Code25interleaved',
38 'code39' => 'Zend\Barcode\Object\Code39',
39 'ean13' => 'Zend\Barcode\Object\Ean13',
40 'ean2' => 'Zend\Barcode\Object\Ean2',
41 'ean5' => 'Zend\Barcode\Object\Ean5',
42 'ean8' => 'Zend\Barcode\Object\Ean8',
43 'error' => 'Zend\Barcode\Object\Error',
44 'identcode' => 'Zend\Barcode\Object\Identcode',
45 'itf14' => 'Zend\Barcode\Object\Itf14',
46 'leitcode' => 'Zend\Barcode\Object\Leitcode',
47 'planet' => 'Zend\Barcode\Object\Planet',
48 'postnet' => 'Zend\Barcode\Object\Postnet',
49 'royalmail' => 'Zend\Barcode\Object\Royalmail',
50 'upca' => 'Zend\Barcode\Object\Upca',
51 'upce' => 'Zend\Barcode\Object\Upce',
54 /**
55 * Validate the plugin
57 * Checks that the barcode parser loaded is an instance
58 * of Object\AbstractObject.
60 * @param mixed $plugin
61 * @return void
62 * @throws Exception\InvalidArgumentException if invalid
64 public function validatePlugin($plugin)
66 if ($plugin instanceof Object\AbstractObject) {
67 // we're okay
68 return;
71 throw new Exception\InvalidArgumentException(sprintf(
72 'Plugin of type %s is invalid; must extend %s\Object\AbstractObject',
73 (is_object($plugin) ? get_class($plugin) : gettype($plugin)),
74 __NAMESPACE__
75 ));