Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Exceptions/LanguagesRequestException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Stichoza\GoogleTranslate\Exceptions;

use ErrorException;
Expand Down
2 changes: 2 additions & 0 deletions src/Exceptions/LargeTextException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Stichoza\GoogleTranslate\Exceptions;

use ErrorException;
Expand Down
2 changes: 2 additions & 0 deletions src/Exceptions/RateLimitException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Stichoza\GoogleTranslate\Exceptions;

use ErrorException;
Expand Down
2 changes: 2 additions & 0 deletions src/Exceptions/TranslationDecodingException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Stichoza\GoogleTranslate\Exceptions;

use UnexpectedValueException;
Expand Down
2 changes: 2 additions & 0 deletions src/Exceptions/TranslationRequestException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Stichoza\GoogleTranslate\Exceptions;

use ErrorException;
Expand Down
4 changes: 3 additions & 1 deletion src/GoogleTranslate.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Stichoza\GoogleTranslate;

use DOMDocument;
Expand All @@ -26,7 +28,7 @@
class GoogleTranslate
{
/**
* @var \GuzzleHttp\Client HTTP Client
* @var Client HTTP Client
*/
protected Client $client;

Expand Down
4 changes: 3 additions & 1 deletion src/Tokens/GoogleTokenGenerator.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Stichoza\GoogleTranslate\Tokens;

/**
Expand All @@ -22,7 +24,7 @@ public function generateToken(string $source, string $target, string $text): str
{
$tkk = ['406398', 2087938574];

for ($d = [], $e = 0, $f = 0; $f < $this->length($text); $f++) {
for ($d = [], $e = 0, $f = 0; $f < $this->length($text); ++$f) {
$g = $this->charCodeAt($text, $f);
if ($g < 128) {
$d[$e++] = $g;
Expand Down
2 changes: 2 additions & 0 deletions src/Tokens/SampleTokenGenerator.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Stichoza\GoogleTranslate\Tokens;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Tokens/TokenProviderInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Stichoza\GoogleTranslate\Tokens;

/**
Expand Down
4 changes: 3 additions & 1 deletion tests/ExceptionTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Stichoza\GoogleTranslate\Tests;

use ErrorException;
Expand All @@ -12,7 +14,7 @@
use Stichoza\GoogleTranslate\GoogleTranslate;
use UnexpectedValueException;

class ExceptionTest extends TestCase
final class ExceptionTest extends TestCase
{
public GoogleTranslate $tr;

Expand Down
4 changes: 3 additions & 1 deletion tests/LanguageDetectionTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php

declare(strict_types=1);

namespace Stichoza\GoogleTranslate\Tests;

use PHPUnit\Framework\TestCase;
use Stichoza\GoogleTranslate\GoogleTranslate;

class LanguageDetectionTest extends TestCase
final class LanguageDetectionTest extends TestCase
{
public GoogleTranslate $tr;

Expand Down
4 changes: 3 additions & 1 deletion tests/SupportedLanguagesTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php

declare(strict_types=1);

namespace Stichoza\GoogleTranslate\Tests;

use PHPUnit\Framework\TestCase;
use Stichoza\GoogleTranslate\GoogleTranslate;

class SupportedLanguagesTest extends TestCase
final class SupportedLanguagesTest extends TestCase
{
public GoogleTranslate $tr;

Expand Down
4 changes: 3 additions & 1 deletion tests/TranslationTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php

declare(strict_types=1);

namespace Stichoza\GoogleTranslate\Tests;

use PHPUnit\Framework\TestCase;
use Stichoza\GoogleTranslate\GoogleTranslate;

class TranslationTest extends TestCase
final class TranslationTest extends TestCase
{
public GoogleTranslate $tr;

Expand Down
4 changes: 3 additions & 1 deletion tests/UtilityTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Stichoza\GoogleTranslate\Tests;

use Exception;
Expand All @@ -8,7 +10,7 @@
use ReflectionMethod;
use Stichoza\GoogleTranslate\GoogleTranslate;

class UtilityTest extends TestCase
final class UtilityTest extends TestCase
{
public GoogleTranslate $tr;

Expand Down