Skip to content

Commit

Permalink
Merge pull request #134 from gsteel/remove-i18n-dependency
Browse files Browse the repository at this point in the history
Remove dev dependency on `laminas-i18n`
  • Loading branch information
gsteel authored Apr 1, 2024
2 parents 6ede072 + 2b1dd1d commit e929b17
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 e929b17

Please sign in to comment.