Skip to content

Commit 8d6e864

Browse files
committed
added/changed some default options
1 parent 100035a commit 8d6e864

6 files changed

Lines changed: 19 additions & 5 deletions

File tree

src/Extractors/PhpCode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class PhpCode extends Extractor implements ExtractorInterface
1414
// - false: to not extract comments
1515
// - empty string: to extract all comments
1616
// - non-empty string: to extract comments that start with that string
17-
'extractComments' => '',
17+
'extractComments' => false,
1818

1919
'functions' => [
2020
'gettext' => 'gettext',

src/Generators/Csv.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Csv extends Generator implements GeneratorInterface
1313
use HeadersGeneratorTrait;
1414

1515
public static $options = [
16-
'includeHeaders' => true,
16+
'includeHeaders' => false,
1717
];
1818

1919
/**

src/Generators/Json.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Json extends Generator implements GeneratorInterface
1111

1212
public static $options = [
1313
'json' => 0,
14-
'includeHeaders' => true,
14+
'includeHeaders' => false,
1515
];
1616

1717
/**

src/Generators/Yaml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Yaml extends Generator implements GeneratorInterface
1111
use MultidimensionalArrayTrait;
1212

1313
public static $options = [
14-
'includeHeaders' => true,
14+
'includeHeaders' => false,
1515
'indent' => 2,
1616
'inline' => 4,
1717
];

src/Translations.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class Translations extends \ArrayObject
7070
'Content-Type' => 'text/plain; charset=UTF-8',
7171
'Content-Transfer-Encoding' => '8bit',
7272
],
73+
'headersSorting' => false,
7374
'defaultDateHeaders' => [
7475
'POT-Creation-Date',
7576
'PO-Revision-Date',
@@ -246,7 +247,9 @@ public function getHeader($name)
246247
*/
247248
public function getHeaders()
248249
{
249-
ksort($this->headers);
250+
if (static::$options['headersSorting']) {
251+
ksort($this->headers);
252+
}
250253

251254
return $this->headers;
252255
}

tests/bootstrap.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@
88

99
//Config
1010
Gettext\Translations::$options['defaultDateHeaders'] = [];
11+
Gettext\Translations::$options['headersSorting'] = true;
12+
13+
Gettext\Extractors\PhpCode::$options['extractComments'] = '';
14+
15+
Gettext\Generators\Csv::$options['includeHeaders'] = true;
16+
1117
Gettext\Generators\Jed::$options['json'] = JSON_PRETTY_PRINT;
18+
1219
Gettext\Generators\Json::$options['json'] = JSON_PRETTY_PRINT;
20+
Gettext\Generators\Json::$options['includeHeaders'] = true;
21+
1322
Gettext\Generators\JsonDictionary::$options['json'] = JSON_PRETTY_PRINT;
23+
24+
Gettext\Generators\Yaml::$options['includeHeaders'] = true;

0 commit comments

Comments
 (0)