Skip to content

Commit d701757

Browse files
Tobionfabpot
authored andcommitted
Translator component has default domain for null implemented no need to have default translation domain logic in 3 different places
1 parent 7699f2a commit d701757

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

Extension/Core/Type/BaseType.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function buildView(FormView $view, FormInterface $form, array $options)
5656
$uniqueBlockPrefix = '_'.$blockName;
5757
}
5858

59-
if (!$translationDomain) {
59+
if (null === $translationDomain) {
6060
$translationDomain = $view->parent->vars['translation_domain'];
6161
}
6262
} else {
@@ -76,10 +76,6 @@ public function buildView(FormView $view, FormInterface $form, array $options)
7676
}
7777
$blockPrefixes[] = $uniqueBlockPrefix;
7878

79-
if (!$translationDomain) {
80-
$translationDomain = 'messages';
81-
}
82-
8379
$view->vars = array_replace($view->vars, array(
8480
'form' => $view,
8581
'id' => $id,

Tests/Extension/Core/Type/BaseTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function testDefaultTranslationDomain()
112112
->getForm()
113113
->createView();
114114

115-
$this->assertEquals('messages', $view['child']->vars['translation_domain']);
115+
$this->assertNull($view['child']->vars['translation_domain']);
116116
}
117117

118118
public function testPassLabelToView()

0 commit comments

Comments
 (0)