diff --git a/Plugin/DotpayDirectPlugin.php b/Plugin/DotpayDirectPlugin.php index b88f33c..c8ce9d2 100644 --- a/Plugin/DotpayDirectPlugin.php +++ b/Plugin/DotpayDirectPlugin.php @@ -19,7 +19,7 @@ use JMS\Payment\CoreBundle\Plugin\Exception\FunctionNotSupportedException; use ETS\Payment\DotpayBundle\Client\Token; -use ETS\Payment\DotpayBundle\Tools\String; +use ETS\Payment\DotpayBundle\Tools\StringNormalizer; /* * Copyright 2012 ETSGlobal @@ -71,7 +71,7 @@ class DotpayDirectPlugin extends AbstractPlugin protected $token; /** - * @var \ETS\Payment\DotpayBundle\Tools\String + * @var \ETS\Payment\DotpayBundle\Tools\StringNormalizer */ protected $stringTools; @@ -91,14 +91,14 @@ class DotpayDirectPlugin extends AbstractPlugin protected $type; /** - * @param Router $router The router - * @param Token $token The client token - * @param String $stringTools The String tool package - * @param string $url The urlc - * @param integer $type The type - * @param string $returnUrl The return url + * @param Router $router The router + * @param Token $token The client token + * @param StringNormalizer $stringTools The StringNormalizer tool package + * @param string $url The urlc + * @param int $type The type + * @param string $returnUrl The return url */ - public function __construct(Router $router, Token $token, String $stringTools, $url, $type, $returnUrl) + public function __construct(Router $router, Token $token, StringNormalizer $stringTools, $url, $type, $returnUrl) { $this->router = $router; $this->token = $token; diff --git a/Resources/config/services.xml b/Resources/config/services.xml index 1ad18c9..7f2b282 100644 --- a/Resources/config/services.xml +++ b/Resources/config/services.xml @@ -8,7 +8,7 @@ ETS\Payment\DotpayBundle\Plugin\DotpayDirectPlugin ETS\Payment\DotpayBundle\Form\DirectType ETS\Payment\DotpayBundle\Client\Token - ETS\Payment\DotpayBundle\Tools\String + ETS\Payment\DotpayBundle\Tools\StringNormalizer diff --git a/Tests/Tools/StringTest.php b/Tests/Tools/StringNormalizerTest.php similarity index 89% rename from Tests/Tools/StringTest.php rename to Tests/Tools/StringNormalizerTest.php index c6151cc..613a8c2 100644 --- a/Tests/Tools/StringTest.php +++ b/Tests/Tools/StringNormalizerTest.php @@ -2,7 +2,7 @@ namespace ETS\PurchaseBundle\Tests\Tools; -use ETS\Payment\DotpayBundle\Tools\String; +use ETS\Payment\DotpayBundle\Tools\StringNormalizer; /* * Copyright 2012 ETSGlobal @@ -25,7 +25,7 @@ * * @author ETSGlobal */ -class StringTest extends \PHPUnit_Framework_TestCase +class StringNormalizerTest extends \PHPUnit_Framework_TestCase { /** * @return array @@ -47,7 +47,7 @@ public function normalizeProvider() */ public function testNormaize($input, $expected) { - $tool = new String(); + $tool = new StringNormalizer(); $this->assertEquals($expected, $tool->normalize($input)); } diff --git a/Tools/String.php b/Tools/StringNormalizer.php similarity index 61% rename from Tools/String.php rename to Tools/StringNormalizer.php index b08043a..0600e15 100644 --- a/Tools/String.php +++ b/Tools/StringNormalizer.php @@ -3,9 +3,9 @@ namespace ETS\Payment\DotpayBundle\Tools; /** - * String tools + * StringNormalizer tools */ -class String +class StringNormalizer { /** * Remove all unwanted caracters @@ -16,6 +16,6 @@ class String */ public function normalize($text) { - return preg_replace('/\pM*/u', '', normalizer_normalize($text, \Normalizer::FORM_D)); + return preg_replace('/\pM*/u', '', \Normalizer::normalize($text, \Normalizer::FORM_D)); } }