Skip to content
Permalink
Browse files

fix codesniffer formatting errors

  • Loading branch information...
Schlaefer committed Jun 15, 2015
1 parent 2676242 commit 8b493558a9eab200a9dbc4b066457516f3035496
Showing with 16 additions and 22 deletions.
  1. +1 −1 src/I18n/I18n.php
  2. +5 −2 src/I18n/TranslatorRegistry.php
  3. +10 −19 tests/TestCase/I18n/I18nTest.php
@@ -113,7 +113,7 @@ public static function translators()
* @param string|null $locale The locale for the translator.
* @param callable|null $loader A callback function or callable class responsible for
* constructing a translations package instance.
* @return \Aura\Intl\Translator The configured translator.
* @return \Aura\Intl\Translator|void The configured translator.
*/
public static function translator($name = 'default', $locale = null, callable $loader = null)
{
@@ -174,10 +174,12 @@ public function defaultFormatter($name = null)
* @param string|null $name fallback domain
* @return string
*/
public function defaultFallbackDomain($name = null) {
public function defaultFallbackDomain($name = null)
{
if ($name === null) {
return $this->_defaultFallbackDomain;
}
return $this->_defaultFallbackDomain = $name;
}
@@ -252,7 +254,8 @@ protected function _getFromLoader($name, $locale)
* @param callable $loader invokable loader
* @return callable loader
*/
public function setLoaderFallback($name, callable $loader) {
public function setLoaderFallback($name, callable $loader)
{
if ($name !== $this->_defaultFallbackDomain) {
$loader = function () use ($loader) {
$package = $loader();
@@ -524,17 +524,13 @@ public function testFallbackTranslatorFallbackDisabled()
I18n::translator('default', 'en_US', function () {
$package = new Package('default');
$package->setMessages(['Dog' => 'bark']);
return $package;
});
I18n::translator('custom', 'en_US',
function () {
$package = new Package('default');
$package->setMessages([]);
return $package;
}
);
I18n::translator('custom', 'en_US', function () {
$package = new Package('default');
$package->setMessages([]);
return $package;
});
$result = __d('custom', 'Dog');
$this->assertEquals('Dog', $result);
}
@@ -551,22 +547,17 @@ public function testFallbackTranslatorCustomDomain()
I18n::translator($customDomain, 'en_US', function () {
$package = new Package('default');
$package->setMessages(['Dog' => 'bark']);
return $package;
});
I18n::translator('custom', 'en_US',
function () {
$package = new Package('default');
$package->setMessages([]);
return $package;
}
);
I18n::translator('custom', 'en_US', function () {
$package = new Package('default');
$package->setMessages([]);
return $package;
});
$result = __d('custom', 'Dog');
$this->assertEquals('bark', $result);
}
/**
* Tests that it is possible to register a generic translators factory for a domain
* instead of having to create them manually

0 comments on commit 8b49355

Please sign in to comment.
You can’t perform that action at this time.