None   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 8
c 1
b 0
f 0
dl 0
loc 49
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A dn() 0 7 2
A dt() 0 3 1
A all() 0 3 1
1
<?php
2
3
/**
4
 * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015-2025
6
 * @package Base
7
 * @subpackage Translation
8
 */
9
10
11
namespace Aimeos\Base\Translation;
12
13
14
/**
15
 * Translation without an implementation; dummy class
16
 *
17
 * @package Base
18
 * @subpackage Translation
19
 */
20
class None
21
	extends \Aimeos\Base\Translation\Base
22
	implements \Aimeos\Base\Translation\Iface
23
{
24
	/**
25
	 * Returns the given string for the given domain.
26
	 *
27
	 * @param string $domain Translation domain
28
	 * @param string $string String to be translated
29
	 * @return string The translated string
30
	 * @throws \Aimeos\Base\Translation\Exception Throws exception on initialization of the translation
31
	 */
32
	public function dt( string $domain, string $string ) : string
33
	{
34
		return (string) $string;
35
	}
36
37
38
	/**
39
	 * Returns the plural string by given number.
40
	 *
41
	 * @param string $domain Translation domain
42
	 * @param string $singular String in singular form
43
	 * @param string $plural String in plural form
44
	 * @param int $number Quantity to choose the correct plural form for languages with plural forms
45
	 * @return string Returns the translated singular or plural form of the string depending on the given number
46
	 * @throws \Aimeos\Base\Translation\Exception If the initialization of the translation
47
	 */
48
	public function dn( string $domain, string $singular, string $plural, int $number ) : string
49
	{
50
		if( $this->getPluralIndex( $number, $this->getLocale() ) > 0 ) {
51
			return (string) $plural;
52
		}
53
54
		return (string) $singular;
55
	}
56
57
58
	/**
59
	 * Returns all locale string of the given domain.
60
	 *
61
	 * @param string $domain Translation domain
62
	 * @return array Associative list with original string as key and translation
63
	 * 	as value or an associative list with index => translation as value if
64
	 * 	plural forms are available
65
	 */
66
	public function all( string $domain ) : array
67
	{
68
		return [];
69
	}
70
71
}
72