From e2a85b839f43079c0f1efbe045131e269d2d054b Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Thu, 21 Jun 2012 23:44:20 -0500 Subject: [PATCH 1/2] Better capabilities surrounding sharing - Added flag "sharedByDefault" to ServiceManager implementation, set to true by default - Disabling the flag disables storing created instances for re-use - Used with a variety of components: Cache, Crypt, Paginator, and the static variants of Filter and Validator - Cannot re-set the flag if allowOverride is false --- src/Symmetric/PaddingPluginManager.php | 6 ++---- src/SymmetricPluginManager.php | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Symmetric/PaddingPluginManager.php b/src/Symmetric/PaddingPluginManager.php index b1b28c3..e439338 100644 --- a/src/Symmetric/PaddingPluginManager.php +++ b/src/Symmetric/PaddingPluginManager.php @@ -51,11 +51,9 @@ class PaddingPluginManager extends AbstractPluginManager /** * Do not share by default * - * @var array + * @var bool */ - protected $shared = array( - 'pkcs7' => false, - ); + protected $shareByDefault = false; /** * Validate the plugin diff --git a/src/SymmetricPluginManager.php b/src/SymmetricPluginManager.php index dabf881..ed9316c 100644 --- a/src/SymmetricPluginManager.php +++ b/src/SymmetricPluginManager.php @@ -49,11 +49,9 @@ class SymmetricPluginManager extends AbstractPluginManager /** * Do not share by default * - * @var array + * @var bool */ - protected $shared = array( - 'mcrypt' => false, - ); + protected $shareByDefault = false; /** * Validate the plugin From 78f9a51fb09823ae892c8be23634b65a2c440aab Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Fri, 22 Jun 2012 00:36:09 -0500 Subject: [PATCH 2/2] Cleanup - Ensured all file and class level docblocks are correct - Removed all extraneous import statements - Ensured @throws and property annotations are correct --- src/Symmetric/PaddingPluginManager.php | 6 ++---- src/SymmetricPluginManager.php | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Symmetric/PaddingPluginManager.php b/src/Symmetric/PaddingPluginManager.php index e439338..703077a 100644 --- a/src/Symmetric/PaddingPluginManager.php +++ b/src/Symmetric/PaddingPluginManager.php @@ -22,7 +22,6 @@ namespace Zend\Crypt\Symmetric; use Zend\ServiceManager\AbstractPluginManager; -use Zend\ServiceManager\ConfigurationInterface; /** * Plugin manager implementation for the padding adapter instances. @@ -58,12 +57,11 @@ class PaddingPluginManager extends AbstractPluginManager /** * Validate the plugin * - * Checks that the filter loaded is either a valid callback or an instance - * of FilterInterface. + * Checks that the padding adaper loaded is an instance of Padding\PaddingInterface. * * @param mixed $plugin * @return void - * @throws Exception\RuntimeException if invalid + * @throws Exception\InvalidArgumentException if invalid */ public function validatePlugin($plugin) { diff --git a/src/SymmetricPluginManager.php b/src/SymmetricPluginManager.php index ed9316c..13e18f7 100644 --- a/src/SymmetricPluginManager.php +++ b/src/SymmetricPluginManager.php @@ -21,7 +21,6 @@ namespace Zend\Crypt; use Zend\ServiceManager\AbstractPluginManager; -use Zend\ServiceManager\ConfigurationInterface; /** * Plugin manager implementation for the symmetric adapter instances.