Skip to content

Commit

Permalink
Reference with use statement
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
  • Loading branch information
MauricioFauth committed Feb 27, 2020
1 parent 336e181 commit 0323b74
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@

namespace PhpMyAdmin\MoTranslator;

use function array_push;
use function file_exists;
use function getenv;
use function in_array;
use function preg_match;

class Loader
{
/**
Expand Down
4 changes: 3 additions & 1 deletion src/ReaderException.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@

namespace PhpMyAdmin\MoTranslator;

use Exception;

/**
* Exception thrown when file can not be read.
*/
class ReaderException extends \Exception
class ReaderException extends Exception
{
}
6 changes: 6 additions & 0 deletions src/StringReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@

namespace PhpMyAdmin\MoTranslator;

use function file_get_contents;
use function strlen;
use function substr;
use function unpack;
use const PHP_INT_MAX;

/**
* Simple wrapper around string buffer for
* random access and values parsing.
Expand Down
20 changes: 19 additions & 1 deletion src/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@
namespace PhpMyAdmin\MoTranslator;

use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
use Throwable;
use function array_key_exists;
use function chr;
use function count;
use function explode;
use function implode;
use function intval;
use function is_null;
use function is_readable;
use function ltrim;
use function preg_replace;
use function rtrim;
use function strcmp;
use function stripos;
use function strpos;
use function strtolower;
use function substr;
use function trim;

/**
* Provides a simple gettext replacement that works independently from
Expand Down Expand Up @@ -280,7 +298,7 @@ private function selectString($n)
$this->getPluralForms(),
['n' => $n]
);
} catch (\Throwable $e) {
} catch (Throwable $e) {
$plural = 0;
}

Expand Down
2 changes: 2 additions & 0 deletions tests/LoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

use PhpMyAdmin\MoTranslator\Loader;
use PHPUnit\Framework\TestCase;
use function getenv;
use function putenv;

/**
* Test for mo loading.
Expand Down
3 changes: 3 additions & 0 deletions tests/MoFilesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use PhpMyAdmin\MoTranslator\Translator;
use PHPUnit\Framework\TestCase;
use function basename;
use function glob;
use function strpos;

/**
* Test for MO files parsing.
Expand Down

0 comments on commit 0323b74

Please sign in to comment.