MwTranslator   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMessages() 0 11 3
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2014-2018
6
 * @package MW
7
 * @subpackage Translation
8
 */
9
10
11
namespace Zend\I18n\Translator;
12
use Zend\I18n\Translator\Translator;
13
14
15
/**
16
 * Zend\I18n\Translator\Translator with ability to return all messages
17
 *
18
 * @package Zend
19
 * @subpackage I18n
20
 */
21
class MwTranslator extends Translator
22
{
23
	/**
24
	 * Returns all message strings and translations.
25
	 *
26
	 * @param string $domain Translation domain
27
	 * @param string $locale $locale ISO language name, like "en" or "en_US"
28
	 * @return Zend\I18n\Translator\TextDomain Array like TextDomain object
0 ignored issues
show
Bug introduced by
The type Zend\I18n\Translator\Zen...n\Translator\TextDomain was not found. Did you mean Zend\I18n\Translator\TextDomain? If so, make sure to prefix the type with \.
Loading history...
29
	 */
30
	public function getMessages( $domain = 'default', $locale = null )
31
	{
32
		if( $locale === null ) {
33
			$locale = $this->getLocale();
34
		}
35
36
		if( !isset( $this->messages[$domain][$locale] ) ) {
37
			$this->loadMessages( $domain, $locale );
38
		}
39
40
		return $this->messages[$domain][$locale];
41
	}
42
}