diff --git a/src/Symfony/Component/Locale/Exception/MethodArgumentValueNotImplementedException.php b/src/Symfony/Component/Locale/Exception/MethodArgumentValueNotImplementedException.php index 770f4181f6..2fdb6feaed 100644 --- a/src/Symfony/Component/Locale/Exception/MethodArgumentValueNotImplementedException.php +++ b/src/Symfony/Component/Locale/Exception/MethodArgumentValueNotImplementedException.php @@ -33,7 +33,7 @@ class MethodArgumentValueNotImplementedException extends NotImplementedException $methodName, $argName, var_export($argValue, true), - $additionalMessage != '' ? ' '.$additionalMessage.'. ' : '' + $additionalMessage !== '' ? ' '.$additionalMessage.'. ' : '' ); parent::__construct($message); diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/TimeZoneTransformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/TimeZoneTransformer.php index d48e0a84b4..f817ba0d21 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/TimeZoneTransformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/TimeZoneTransformer.php @@ -88,7 +88,7 @@ class TimeZoneTransformer extends Transformer )); } - return 'Etc/GMT'.($hours != 0 ? $signal.$hours : ''); + return 'Etc/GMT'.($hours !== 0 ? $signal.$hours : ''); } throw new \InvalidArgumentException('The GMT time zone \'%s\' does not match with the supported formats GMT[+-]HH:MM or GMT[+-]HHMM.'); diff --git a/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php b/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php index ec339043a1..ca21c9e82c 100644 --- a/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php +++ b/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php @@ -124,11 +124,11 @@ class StubIntlDateFormatter */ public function __construct($locale, $datetype, $timetype, $timezone = null, $calendar = self::GREGORIAN, $pattern = null) { - if ('en' != $locale) { + if ('en' !== $locale) { throw new MethodArgumentValueNotImplementedException(__METHOD__, 'locale', $locale, 'Only the \'en\' locale is supported'); } - if (self::GREGORIAN != $calendar) { + if (self::GREGORIAN !== $calendar) { throw new MethodArgumentValueNotImplementedException(__METHOD__, 'calendar', $calendar, 'Only the GREGORIAN calendar is supported'); } diff --git a/src/Symfony/Component/Locale/Stub/StubLocale.php b/src/Symfony/Component/Locale/Stub/StubLocale.php index f4c3852e6d..831960f21b 100644 --- a/src/Symfony/Component/Locale/Stub/StubLocale.php +++ b/src/Symfony/Component/Locale/Stub/StubLocale.php @@ -480,7 +480,7 @@ class StubLocale */ static private function getStubData($locale, $cacheVariable, $stubDataDir) { - if ('en' != $locale) { + if ('en' !== $locale) { throw new \InvalidArgumentException(sprintf('Only the \'en\' locale is supported. %s', NotImplementedException::INTL_INSTALL_MESSAGE)); } diff --git a/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php b/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php index 2beb388e93..79bcd5299c 100644 --- a/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php +++ b/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php @@ -94,10 +94,10 @@ class StubIntlDateFormatterTest extends LocaleTestCase $this->assertSame($expected, $formatter->format($timestamp)); $this->assertSame($errorMessage, StubIntl::getErrorMessage()); $this->assertSame($errorCode, StubIntl::getErrorCode()); - $this->assertSame($errorCode != 0, StubIntl::isFailure(StubIntl::getErrorCode())); + $this->assertFalse(StubIntl::isFailure(StubIntl::getErrorCode())); $this->assertSame($errorMessage, $formatter->getErrorMessage()); $this->assertSame($errorCode, $formatter->getErrorCode()); - $this->assertSame($errorCode != 0, StubIntl::isFailure($formatter->getErrorCode())); + $this->assertFalse(StubIntl::isFailure($formatter->getErrorCode())); } /** @@ -115,7 +115,7 @@ class StubIntlDateFormatterTest extends LocaleTestCase $this->assertSame($expected, $formatter->format($timestamp)); $this->assertSame($errorMessage, intl_get_error_message()); $this->assertSame($errorCode, intl_get_error_code()); - $this->assertSame($errorCode != 0, intl_is_failure(intl_get_error_code())); + $this->assertFalse(intl_is_failure(intl_get_error_code())); } public function formatProvider() @@ -323,10 +323,10 @@ class StubIntlDateFormatterTest extends LocaleTestCase $this->assertFalse($formatter->format($timestamp)); $this->assertSame($errorMessage, StubIntl::getErrorMessage()); $this->assertSame($errorCode, StubIntl::getErrorCode()); - $this->assertSame($errorCode != 0, StubIntl::isFailure(StubIntl::getErrorCode())); + $this->assertTrue(StubIntl::isFailure(StubIntl::getErrorCode())); $this->assertSame($errorMessage, $formatter->getErrorMessage()); $this->assertSame($errorCode, $formatter->getErrorCode()); - $this->assertSame($errorCode != 0, StubIntl::isFailure($formatter->getErrorCode())); + $this->assertTrue(StubIntl::isFailure($formatter->getErrorCode())); } /** @@ -343,7 +343,7 @@ class StubIntlDateFormatterTest extends LocaleTestCase $this->assertFalse($formatter->format($timestamp)); $this->assertSame($errorMessage, intl_get_error_message()); $this->assertSame($errorCode, intl_get_error_code()); - $this->assertSame($errorCode != 0, intl_is_failure(intl_get_error_code())); + $this->assertTrue(intl_is_failure(intl_get_error_code())); } public function formatErrorProvider() @@ -598,7 +598,7 @@ class StubIntlDateFormatterTest extends LocaleTestCase $this->assertSame($expected, $formatter->parse($value)); $this->assertSame($errorMessage, intl_get_error_message()); $this->assertSame($errorCode, intl_get_error_code()); - $this->assertSame($errorCode != 0, intl_is_failure(intl_get_error_code())); + $this->assertFalse(intl_is_failure(intl_get_error_code())); } /** @@ -613,10 +613,10 @@ class StubIntlDateFormatterTest extends LocaleTestCase $this->assertSame($expected, $formatter->parse($value)); $this->assertSame($errorMessage, StubIntl::getErrorMessage()); $this->assertSame($errorCode, StubIntl::getErrorCode()); - $this->assertSame($errorCode != 0, StubIntl::isFailure(StubIntl::getErrorCode())); + $this->assertFalse(StubIntl::isFailure(StubIntl::getErrorCode())); $this->assertSame($errorMessage, $formatter->getErrorMessage()); $this->assertSame($errorCode, $formatter->getErrorCode()); - $this->assertSame($errorCode != 0, StubIntl::isFailure($formatter->getErrorCode())); + $this->assertFalse(StubIntl::isFailure($formatter->getErrorCode())); } public function parseProvider() @@ -775,7 +775,7 @@ class StubIntlDateFormatterTest extends LocaleTestCase $this->assertFalse($formatter->parse($value)); $this->assertSame($errorMessage, intl_get_error_message()); $this->assertSame($errorCode, intl_get_error_code()); - $this->assertSame($errorCode != 0, intl_is_failure(intl_get_error_code())); + $this->assertTrue(intl_is_failure(intl_get_error_code())); } /** @@ -790,10 +790,10 @@ class StubIntlDateFormatterTest extends LocaleTestCase $this->assertFalse($formatter->parse($value)); $this->assertSame($errorMessage, StubIntl::getErrorMessage()); $this->assertSame($errorCode, StubIntl::getErrorCode()); - $this->assertSame($errorCode != 0, StubIntl::isFailure(StubIntl::getErrorCode())); + $this->assertTrue(StubIntl::isFailure(StubIntl::getErrorCode())); $this->assertSame($errorMessage, $formatter->getErrorMessage()); $this->assertSame($errorCode, $formatter->getErrorCode()); - $this->assertSame($errorCode != 0, StubIntl::isFailure($formatter->getErrorCode())); + $this->assertTrue(StubIntl::isFailure($formatter->getErrorCode())); } public function parseErrorProvider() diff --git a/tests/Symfony/Tests/Component/Locale/Stub/StubNumberFormatterTest.php b/tests/Symfony/Tests/Component/Locale/Stub/StubNumberFormatterTest.php index 1236598ab7..e775763aee 100644 --- a/tests/Symfony/Tests/Component/Locale/Stub/StubNumberFormatterTest.php +++ b/tests/Symfony/Tests/Component/Locale/Stub/StubNumberFormatterTest.php @@ -233,10 +233,10 @@ class StubNumberFormatterTest extends LocaleTestCase $this->assertSame($errorMessage, StubIntl::getErrorMessage()); $this->assertSame($errorCode, StubIntl::getErrorCode()); - $this->assertSame($errorCode != 0, StubIntl::isFailure(StubIntl::getErrorCode())); + $this->assertFalse(StubIntl::isFailure(StubIntl::getErrorCode())); $this->assertSame($errorMessage, $formatter->getErrorMessage()); $this->assertSame($errorCode, $formatter->getErrorCode()); - $this->assertSame($errorCode != 0, StubIntl::isFailure($formatter->getErrorCode())); + $this->assertFalse(StubIntl::isFailure($formatter->getErrorCode())); } public function testFormatIntl() @@ -251,10 +251,10 @@ class StubNumberFormatterTest extends LocaleTestCase $this->assertSame($errorMessage, intl_get_error_message()); $this->assertSame($errorCode, intl_get_error_code()); - $this->assertSame($errorCode != 0, intl_is_failure(intl_get_error_code())); + $this->assertFalse(intl_is_failure(intl_get_error_code())); $this->assertSame($errorMessage, $formatter->getErrorMessage()); $this->assertSame($errorCode, $formatter->getErrorCode()); - $this->assertSame($errorCode != 0, intl_is_failure($formatter->getErrorCode())); + $this->assertFalse(intl_is_failure($formatter->getErrorCode())); } /** @@ -699,10 +699,10 @@ class StubNumberFormatterTest extends LocaleTestCase $this->assertSame($errorMessage, StubIntl::getErrorMessage()); $this->assertSame($errorCode, StubIntl::getErrorCode()); - $this->assertSame($errorCode != 0, StubIntl::isFailure(StubIntl::getErrorCode())); + $this->assertSame($errorCode !== 0, StubIntl::isFailure(StubIntl::getErrorCode())); $this->assertSame($errorMessage, $formatter->getErrorMessage()); $this->assertSame($errorCode, $formatter->getErrorCode()); - $this->assertSame($errorCode != 0, StubIntl::isFailure($formatter->getErrorCode())); + $this->assertSame($errorCode !== 0, StubIntl::isFailure($formatter->getErrorCode())); } /** @@ -727,10 +727,10 @@ class StubNumberFormatterTest extends LocaleTestCase $this->assertSame($errorMessage, intl_get_error_message()); $this->assertSame($errorCode, intl_get_error_code()); - $this->assertSame($errorCode != 0, intl_is_failure(intl_get_error_code())); + $this->assertSame($errorCode > 0, intl_is_failure(intl_get_error_code())); $this->assertSame($errorMessage, $formatter->getErrorMessage()); $this->assertSame($errorCode, $formatter->getErrorCode()); - $this->assertSame($errorCode != 0, intl_is_failure($formatter->getErrorCode())); + $this->assertSame($errorCode > 0, intl_is_failure($formatter->getErrorCode())); } public function parseProvider()