This repository has been archived by the owner on Jan 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
53 parents
21c6816
+
e63ad13
+
ebb65de
+
feaeb97
+
6d76c21
+
8080e99
+
3d8fc08
+
376eb68
+
846ff4b
+
a0b34c2
+
40bdf5a
+
e01831f
+
f22306a
+
8248197
+
740d2ca
+
3e4973e
+
1f71371
+
f945a68
+
6737231
+
7554e22
+
f43a14f
+
5680e05
+
8c71fbe
+
7640752
+
17fca5b
+
3e4bdb7
+
a1ec0e4
+
73e93c4
+
954b983
+
5a4d447
+
08d604f
+
a198091
+
3b2d396
+
ed13b76
+
8c1c902
+
66db3c0
+
88e5c45
+
4766aaf
+
af7efc8
+
2c6ae34
+
ea85a56
+
d1750df
+
665f6e2
+
3e28dac
+
edefcee
+
fed5933
+
55c0906
+
067d44c
+
694c574
+
1ea7f1a
+
e705000
+
5b6a369
+
caf89fe
commit bd1a8cd
Showing
5 changed files
with
152 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the new BSD license that is bundled | ||
* with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://framework.zend.com/license/new-bsd | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to license@zend.com so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Tag | ||
* @subpackage Cloud | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
namespace Zend\Tag\Cloud; | ||
|
||
use Zend\ServiceManager\AbstractPluginManager; | ||
use Zend\Tag\Exception; | ||
|
||
/** | ||
* Plugin manager implementation for decorators. | ||
* | ||
* Enforces that decorators retrieved are instances of | ||
* Decorator\DecoratorInterface. Additionally, it registers a number of default | ||
* decorators available. | ||
* | ||
* @category Zend | ||
* @package Zend_Tag | ||
* @subpackage Cloud | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
class DecoratorPluginManager extends AbstractPluginManager | ||
{ | ||
/** | ||
* Default set of decorators | ||
* | ||
* @var array | ||
*/ | ||
protected $invokableClasses = array( | ||
'htmlcloud' => 'Zend\Tag\Cloud\Decorator\HtmlCloud', | ||
'htmltag' => 'Zend\Tag\Cloud\Decorator\HtmlTag', | ||
'tag' => 'Zend\Tag\Cloud\Decorator\Tag', | ||
); | ||
|
||
/** | ||
* Validate the plugin | ||
* | ||
* Checks that the decorator loaded is an instance | ||
* of Decorator\DecoratorInterface. | ||
* | ||
* @param mixed $plugin | ||
* @return void | ||
* @throws Exception\InvalidArgumentException if invalid | ||
*/ | ||
public function validatePlugin($plugin) | ||
{ | ||
if ($plugin instanceof Decorator\DecoratorInterface) { | ||
// we're okay | ||
return; | ||
} | ||
|
||
throw new Exception\InvalidArgumentException(sprintf( | ||
'Plugin of type %s is invalid; must implement %s\Decorator\DecoratorInterface', | ||
(is_object($plugin) ? get_class($plugin) : gettype($plugin)), | ||
__NAMESPACE__ | ||
)); | ||
} | ||
} | ||
|
Oops, something went wrong.