Completed
Push — master ( 0400e8...01951f )
by Filip
03:12
created

NeonFileDumper::formatCatalogue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 3
1
<?php
2
3
/**
4
 * This file is part of the Kdyby (http://www.kdyby.org)
5
 *
6
 * Copyright (c) 2008 Filip Procházka ([email protected])
7
 *
8
 * For the full copyright and license information, please view the file license.txt that was distributed with this source code.
9
 */
10
11
namespace Kdyby\Translation\Dumper;
12
13
use Nette\Neon\Neon;
14
use Symfony\Component\Translation\Dumper\FileDumper;
15
use Symfony\Component\Translation\MessageCatalogue;
16
17
18
19
/**
20
 * Generates Neon files from a message catalogue.
21
 *
22
 * @author Filip Procházka <[email protected]>
23
 */
24
class NeonFileDumper extends FileDumper
25
{
26
27
	/**
28
	 * {@inheritDoc}
29
	 */
30
	public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = [])
31
	{
32
		return Neon::encode($messages->all($domain), Neon::BLOCK);
33
	}
34
35
36
37
	/**
38
	 * {@inheritDoc}
39
	 */
40
	protected function format(MessageCatalogue $messages, $domain)
41
	{
42
		return Neon::encode($messages->all($domain), Neon::BLOCK);
43
	}
44
45
46
47
	/**
48
	 * {@inheritDoc}
49
	 */
50
	protected function getExtension()
51
	{
52
		return 'neon';
53
	}
54
55
}
56