From fe2e02546a0d7de7247a69c911ee0c12d9a22247 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 3 Jul 2012 08:57:10 -0500 Subject: [PATCH] [zendframework/zf2#1713] Minor CS/flow fixes - use sprintf() for exception messages - use get_class($this) instead of get_called_class() when in non-static context - make conditionals positive when possible for readability - remove Zend\I18n\Filter\FilterPluginManager and put configuration in Zend\Filter\FilterPluginManager --- src/Filter/FilterPluginManager.php | 77 ------------------------------ 1 file changed, 77 deletions(-) delete mode 100644 src/Filter/FilterPluginManager.php diff --git a/src/Filter/FilterPluginManager.php b/src/Filter/FilterPluginManager.php deleted file mode 100644 index 80b24c32..00000000 --- a/src/Filter/FilterPluginManager.php +++ /dev/null @@ -1,77 +0,0 @@ - 'Zend\I18n\Filter\NumberFormat', - ); - - /** - * Validate the plugin - * - * Checks that the filter loaded is either a valid callback or an instance - * of FilterInterface. - * - * @param mixed $plugin - * @return void - * @throws Exception\RuntimeException if invalid - */ - public function validatePlugin($plugin) - { - if ($plugin instanceof FilterInterface) { - // we're okay - return; - } - if (is_callable($plugin)) { - // also okay - return; - } - - throw new Exception\RuntimeException(sprintf( - 'Plugin of type %s is invalid; must implement %s\FilterInterface or be callable', - (is_object($plugin) ? get_class($plugin) : gettype($plugin)), - __NAMESPACE__ - )); - } -}