Skip to content

Commit 8f5e917

Browse files
[HttpKernel] Fix "Locale class not found" in ConfigDataCollector
1 parent 0ab6628 commit 8f5e917

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function collect(Request $request, Response $response, \Exception $except
6868
'debug' => isset($this->kernel) ? $this->kernel->isDebug() : 'n/a',
6969
'php_version' => PHP_VERSION,
7070
'php_architecture' => PHP_INT_SIZE * 8,
71-
'php_intl_locale' => \Locale::getDefault() ?: 'n/a',
71+
'php_intl_locale' => class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a',
7272
'php_timezone' => date_default_timezone_get(),
7373
'xdebug_enabled' => extension_loaded('xdebug'),
7474
'apcu_enabled' => extension_loaded('apcu') && ini_get('apc.enabled'),

src/Symfony/Component/HttpKernel/Tests/DataCollector/ConfigDataCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testCollect()
3232
$this->assertSame('testkernel', $c->getAppName());
3333
$this->assertSame(PHP_VERSION, $c->getPhpVersion());
3434
$this->assertSame(PHP_INT_SIZE * 8, $c->getPhpArchitecture());
35-
$this->assertSame(\Locale::getDefault() ?: 'n/a', $c->getPhpIntlLocale());
35+
$this->assertSame(class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a', $c->getPhpIntlLocale());
3636
$this->assertSame(date_default_timezone_get(), $c->getPhpTimezone());
3737
$this->assertSame(Kernel::VERSION, $c->getSymfonyVersion());
3838
$this->assertNull($c->getToken());

0 commit comments

Comments
 (0)