JsonDictionary   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A toString() 0 6 1
1
<?php
2
3
namespace Gettext\Generators;
4
5
use Gettext\Translations;
6
use Gettext\Utils\DictionaryTrait;
7
8
class JsonDictionary extends Generator implements GeneratorInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    use DictionaryTrait;
11
12
    public static $options = [
13
        'json' => 0,
14
        'includeHeaders' => false,
15
    ];
16
17
    /**
18
     * {@parentDoc}.
19
     */
20
    public static function toString(Translations $translations, array $options = [])
21
    {
22
        $options += static::$options;
23
24
        return json_encode(static::toArray($translations, $options['includeHeaders']), $options['json']);
25
    }
26
}
27