From f9ad559c1680663e88123f603f4de883014e259c 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/AdapterPluginManager.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/AdapterPluginManager.php b/src/AdapterPluginManager.php index dfe82a2..b9e2fa0 100644 --- a/src/AdapterPluginManager.php +++ b/src/AdapterPluginManager.php @@ -51,15 +51,9 @@ class AdapterPluginManager extends AbstractPluginManager ); /** - * @var array Do not share by default + * @var bool Do not share by default */ - protected $shared = array( - 'array' => false, - 'dbselect' => false, - 'dbtableselect' => false, - 'iterator' => false, - 'null' => false, - ); + protected $shareByDefault = false; /** * Validate the plugin From 27af4749f1d321d2bbbea4818c8ada7bfcf1c390 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/AdapterPluginManager.php | 3 +-- src/ScrollingStylePluginManager.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/AdapterPluginManager.php b/src/AdapterPluginManager.php index b9e2fa0..7d63919 100644 --- a/src/AdapterPluginManager.php +++ b/src/AdapterPluginManager.php @@ -21,12 +21,11 @@ namespace Zend\Paginator; use Zend\ServiceManager\AbstractPluginManager; -use Zend\ServiceManager\ConfigurationInterface; /** * Plugin manager implementation for pagination adapters * - * Enforces that adapters retrieved are either callbacks or instances of + * Enforces that adapters retrieved are instances of * Adapter\AdapterInterface. Additionally, it registers a number * of default adapters available. * diff --git a/src/ScrollingStylePluginManager.php b/src/ScrollingStylePluginManager.php index ed497a9..73ca0ca 100644 --- a/src/ScrollingStylePluginManager.php +++ b/src/ScrollingStylePluginManager.php @@ -21,12 +21,11 @@ namespace Zend\Paginator; use Zend\ServiceManager\AbstractPluginManager; -use Zend\ServiceManager\ConfigurationInterface; /** * Plugin manager implementation for scrolling style adapters * - * Enforces that adapters retrieved are either callbacks or instances of + * Enforces that adapters retrieved are instances of * ScrollingStyle\ScrollingStyleInterface. Additionally, it registers a number * of default adapters available. *