Skip to content

Commit 6162ad2

Browse files
committed
php-cs-fixer
1 parent b8811ec commit 6162ad2

38 files changed

Lines changed: 266 additions & 228 deletions

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
.* export-ignore
44

55
# Set the line ending configuration
6-
* text=lf
6+
* text=lf

src/BaseTranslator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
2+
23
namespace Gettext;
34

45
abstract class BaseTranslator
56
{
67
public static $current;
78

89
/**
9-
* Set a translation instance as global, to use it with the gettext functions
10+
* Set a translation instance as global, to use it with the gettext functions.
1011
*
1112
* @param Translator $translator
1213
*/

src/Extractors/Blade.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
<?php
2+
23
namespace Gettext\Extractors;
34

45
use Gettext\Translations;
56
use Illuminate\Filesystem\Filesystem;
67
use Illuminate\View\Compilers\BladeCompiler;
78

89
/**
9-
* Class to get gettext strings from blade.php files returning arrays
10+
* Class to get gettext strings from blade.php files returning arrays.
1011
*/
1112
class Blade extends Extractor implements ExtractorInterface
1213
{
1314
/**
14-
* {@inheritDoc}
15+
* {@inheritdoc}
1516
*/
1617
public static function fromString($string, Translations $translations = null, $file = '')
1718
{

src/Extractors/Extractor.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace Gettext\Extractors;
34

45
use Exception;
@@ -8,7 +9,7 @@
89
abstract class Extractor
910
{
1011
/**
11-
* Extract the translations from a file
12+
* Extract the translations from a file.
1213
*
1314
* @param array|string $file A path of a file or files
1415
* @param null|Translations $translations The translations instance to append the new translations.
@@ -29,7 +30,7 @@ public static function fromFile($file, Translations $translations = null)
2930
}
3031

3132
/**
32-
* Checks and returns all files
33+
* Checks and returns all files.
3334
*
3435
* @param string|array $file The file/s
3536
*
@@ -67,7 +68,7 @@ protected static function getFiles($file)
6768
}
6869

6970
/**
70-
* Reads and returns the content of a file
71+
* Reads and returns the content of a file.
7172
*
7273
* @param string $file
7374
*

src/Extractors/ExtractorInterface.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?php
2+
23
namespace Gettext\Extractors;
34

45
use Gettext\Translations;
56

67
interface ExtractorInterface
78
{
89
/**
9-
* Extract the translations from a file
10+
* Extract the translations from a file.
1011
*
1112
* @param array|string $file A path of a file or files
1213
* @param null|Translations $translations The translations instance to append the new translations.
@@ -16,7 +17,7 @@ interface ExtractorInterface
1617
public static function fromFile($file, Translations $translations = null);
1718

1819
/**
19-
* Parses a string and append the translations found in the Translations instance
20+
* Parses a string and append the translations found in the Translations instance.
2021
*
2122
* @param string $string
2223
* @param Translations|null $translations

src/Extractors/Jed.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<?php
2+
23
namespace Gettext\Extractors;
34

45
use Gettext\Translations;
56

67
/**
7-
* Class to get gettext strings from json files
8+
* Class to get gettext strings from json files.
89
*/
910
class Jed extends PhpArray implements ExtractorInterface
1011
{
1112
/**
12-
* {@inheritDoc}
13+
* {@inheritdoc}
1314
*/
1415
public static function fromString($string, Translations $translations = null, $file = '')
1516
{

src/Extractors/JsCode.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?php
2+
23
namespace Gettext\Extractors;
34

45
use Gettext\Translations;
56
use Gettext\Utils\JsFunctionsScanner;
67

78
/**
8-
* Class to get gettext strings from javascript files
9+
* Class to get gettext strings from javascript files.
910
*/
1011
class JsCode extends Extractor implements ExtractorInterface
1112
{
@@ -16,7 +17,7 @@ class JsCode extends Extractor implements ExtractorInterface
1617
);
1718

1819
/**
19-
* {@inheritDoc}
20+
* {@inheritdoc}
2021
*/
2122
public static function fromString($string, Translations $translations = null, $file = '')
2223
{

src/Extractors/JsonDictionary.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<?php
2+
23
namespace Gettext\Extractors;
34

45
use Gettext\Translations;
56

67
/**
7-
* Class to get gettext strings from plain json
8+
* Class to get gettext strings from plain json.
89
*/
910
class JsonDictionary extends Extractor implements ExtractorInterface
1011
{
1112
/**
12-
* {@inheritDoc}
13+
* {@inheritdoc}
1314
*/
1415
public static function fromString($string, Translations $translations = null, $file = '')
1516
{

src/Extractors/Mo.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?php
2+
23
namespace Gettext\Extractors;
34

45
use Gettext\Translations;
56
use Gettext\Utils\StringReader;
67

78
/**
8-
* Class to get gettext strings from .mo files
9+
* Class to get gettext strings from .mo files.
910
*/
1011
class Mo extends Extractor implements ExtractorInterface
1112
{
@@ -14,7 +15,7 @@ class Mo extends Extractor implements ExtractorInterface
1415
const MAGIC3 = 2500072158;
1516

1617
/**
17-
* {@inheritDoc}
18+
* {@inheritdoc}
1819
*/
1920
public static function fromString($string, Translations $translations = null, $file = '')
2021
{
@@ -44,7 +45,7 @@ public static function fromString($string, Translations $translations = null, $f
4445
$stream->seekto($tran);
4546
$table_translations = self::readIntArray($stream, $byteOrder, $total * 2);
4647

47-
for ($i = 0; $i < $total; $i++) {
48+
for ($i = 0; $i < $total; ++$i) {
4849
$stream->seekto($table_originals[$i * 2 + 2]);
4950
$original = $stream->read($table_originals[$i * 2 + 1]);
5051
$stream->seekto($table_translations[$i * 2 + 2]);

src/Extractors/PhpArray.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<?php
2+
23
namespace Gettext\Extractors;
34

45
use Exception;
56
use Gettext\Translations;
67

78
/**
8-
* Class to get gettext strings from php files returning arrays
9+
* Class to get gettext strings from php files returning arrays.
910
*/
1011
class PhpArray extends Extractor implements ExtractorInterface
1112
{
1213
/**
13-
* Extract the translations from a file
14+
* Extract the translations from a file.
1415
*
1516
* @param array|string $file A path of a file or files
1617
* @param null|Translations $translations The translations instance to append the new translations.
@@ -31,15 +32,15 @@ public static function fromFile($file, Translations $translations = null)
3132
}
3233

3334
/**
34-
* {@inheritDoc}
35+
* {@inheritdoc}
3536
*/
3637
public static function fromString($string, Translations $translations = null, $file = '')
3738
{
38-
throw new Exception("PhpArray::fromString() cannot be called. Use PhpArray::fromFile()");
39+
throw new Exception('PhpArray::fromString() cannot be called. Use PhpArray::fromFile()');
3940
}
4041

4142
/**
42-
* Handle an array of translations and append to the Translations instance
43+
* Handle an array of translations and append to the Translations instance.
4344
*
4445
* @param array $content
4546
* @param Translations $translations

0 commit comments

Comments
 (0)