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 / Crypt / Symmetric / PaddingPluginManager.php
blob736447ab2cebf09b52ede222c0385d0335bcd174
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\Crypt\Symmetric;
12 use Zend\ServiceManager\AbstractPluginManager;
14 /**
15 * Plugin manager implementation for the padding adapter instances.
17 * Enforces that padding adapters retrieved are instances of
18 * Padding\PaddingInterface. Additionally, it registers a number of default
19 * padding adapters available.
21 class PaddingPluginManager extends AbstractPluginManager
23 /**
24 * Default set of padding adapters
26 * @var array
28 protected $invokableClasses = array(
29 'pkcs7' => 'Zend\Crypt\Symmetric\Padding\Pkcs7'
32 /**
33 * Do not share by default
35 * @var bool
37 protected $shareByDefault = false;
39 /**
40 * Validate the plugin
42 * Checks that the padding adapter loaded is an instance of Padding\PaddingInterface.
44 * @param mixed $plugin
45 * @return void
46 * @throws Exception\InvalidArgumentException if invalid
48 public function validatePlugin($plugin)
50 if ($plugin instanceof Padding\PaddingInterface) {
51 // we're okay
52 return;
55 throw new Exception\InvalidArgumentException(sprintf(
56 'Plugin of type %s is invalid; must implement %s\Padding\PaddingInterface',
57 (is_object($plugin) ? get_class($plugin) : gettype($plugin)),
58 __NAMESPACE__
59 ));