Skip to content

Commit

Permalink
Remove dev dependency on laminas-i18n
Browse files Browse the repository at this point in the history
Removes the dependency from composer.json and also the plugin manager configuration from the plugin manager.

The filters are setup during inclusion of `i18n` in user projects as outlined in #130

Closes #130

Signed-off-by: George Steel <[email protected]>
  • Loading branch information
gsteel committed Apr 1, 2024
1 parent 6ede072 commit 2b1dd1d
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 125 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
},
"require-dev": {
"laminas/laminas-coding-standard": "~2.5.0",
"laminas/laminas-i18n": "^2.26.0",
"pear/archive_tar": "^1.4.14",
"phpunit/phpunit": "^10.5.11",
"psalm/plugin-phpunit": "^0.19.0",
Expand Down
87 changes: 1 addition & 86 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 0 additions & 34 deletions src/FilterPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
namespace Laminas\Filter;

use Laminas\Filter\Exception\RuntimeException;
use Laminas\I18n\Filter\Alnum;
use Laminas\I18n\Filter\Alpha;
use Laminas\I18n\Filter\NumberFormat;
use Laminas\I18n\Filter\NumberParse;
use Laminas\ServiceManager\AbstractPluginManager;
use Laminas\ServiceManager\Exception\InvalidServiceException;
use Laminas\ServiceManager\Factory\InvokableFactory;
Expand Down Expand Up @@ -36,18 +32,6 @@ final class FilterPluginManager extends AbstractPluginManager
'null' => ToNull::class,
'Null' => ToNull::class,

// I18n filters
'alnum' => Alnum::class,
'Alnum' => Alnum::class,
'alpha' => Alpha::class,
'Alpha' => Alpha::class,
'numberformat' => NumberFormat::class,
'numberFormat' => NumberFormat::class,
'NumberFormat' => NumberFormat::class,
'numberparse' => NumberParse::class,
'numberParse' => NumberParse::class,
'NumberParse' => NumberParse::class,

// Standard filters
'allowlist' => AllowList::class,
'allowList' => AllowList::class,
Expand Down Expand Up @@ -189,10 +173,6 @@ final class FilterPluginManager extends AbstractPluginManager
'WordUnderscoreToSeparator' => Word\UnderscoreToSeparator::class,

// Legacy Zend Framework aliases
'Zend\I18n\Filter\Alnum' => Alnum::class,
'Zend\I18n\Filter\Alpha' => Alpha::class,
'Zend\I18n\Filter\NumberFormat' => NumberFormat::class,
'Zend\I18n\Filter\NumberParse' => NumberParse::class,
'Zend\Filter\BaseName' => BaseName::class,
'Zend\Filter\Boolean' => Boolean::class,
'Zend\Filter\Callback' => Callback::class,
Expand Down Expand Up @@ -242,10 +222,6 @@ final class FilterPluginManager extends AbstractPluginManager
'zendfiltertoint' => ToInt::class,
'zendfiltertofloat' => ToFloat::class,
'zendfiltertonull' => ToNull::class,
'zendi18nfilteralnum' => Alnum::class,
'zendi18nfilteralpha' => Alpha::class,
'zendi18nfilternumberformat' => NumberFormat::class,
'zendi18nfilternumberparse' => NumberParse::class,
'zendfilterbasename' => BaseName::class,
'zendfilterboolean' => Boolean::class,
'zendfiltercallback' => Callback::class,
Expand Down Expand Up @@ -296,12 +272,6 @@ final class FilterPluginManager extends AbstractPluginManager
* @var array
*/
protected $factories = [
// I18n filters
Alnum::class => InvokableFactory::class,
Alpha::class => InvokableFactory::class,
NumberFormat::class => InvokableFactory::class,
NumberParse::class => InvokableFactory::class,

// Standard filters
AllowList::class => InvokableFactory::class,
BaseName::class => InvokableFactory::class,
Expand Down Expand Up @@ -356,10 +326,6 @@ final class FilterPluginManager extends AbstractPluginManager
'laminasfiltertoint' => InvokableFactory::class,
'laminasfiltertofloat' => InvokableFactory::class,
'laminasfiltertonull' => InvokableFactory::class,
'laminasi18nfilteralnum' => InvokableFactory::class,
'laminasi18nfilteralpha' => InvokableFactory::class,
'laminasi18nfilternumberformat' => InvokableFactory::class,
'laminasi18nfilternumberparse' => InvokableFactory::class,
'laminasfilterbasename' => InvokableFactory::class,
'laminasfilterboolean' => InvokableFactory::class,
'laminasfiltercallback' => InvokableFactory::class,
Expand Down
4 changes: 0 additions & 4 deletions test/FilterPluginManagerCompatibilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ public static function aliasProvider(): Generator
foreach ($aliases as $alias => $target) {
self::assertIsString($alias);
self::assertIsString($target);
// Skipping as laminas-i18n is not required by this package
if (strpos($target, '\\I18n\\') !== false) {
continue;
}

// Skipping as it has required options
if (strpos($target, 'DataUnitFormatter') !== false) {
Expand Down

0 comments on commit 2b1dd1d

Please sign in to comment.