eZ\Publish\Core\MVC\Symfony\Locale\LocaleConverter::convertToPOSIX PHP Метод

convertToPOSIX() публичный Метод

Returns null if conversion cannot be made.
public convertToPOSIX ( string $ezpLocale ) : string | null
$ezpLocale string
Результат string | null
    public function convertToPOSIX($ezpLocale)
    {
        if (!isset($this->conversionMap[$ezpLocale])) {
            $this->logger->warning("Could not convert locale '{$ezpLocale}' to POSIX format. Please check your locale configuration in ezpublish.yml");
            return;
        }
        return $this->conversionMap[$ezpLocale];
    }

Usage Example

Пример #1
0
 /**
  * @dataProvider convertToPOSIXProvider
  *
  * @covers eZ\Publish\Core\MVC\Symfony\Locale\LocaleConverter::convertToPOSIX
  *
  * @param $ezpLocale
  * @param $expected
  */
 public function testConvertToPOSIX($ezpLocale, $expected)
 {
     if ($expected === null) {
         $this->logger->expects($this->once())->method('warning');
     }
     $this->assertSame($expected, $this->localeConverter->convertToPOSIX($ezpLocale));
 }
All Usage Examples Of eZ\Publish\Core\MVC\Symfony\Locale\LocaleConverter::convertToPOSIX