Skip to content

Commit

Permalink
refactor(core)!: LastDragon_ru\LaraASP\Core\Translator and `LastDra…
Browse files Browse the repository at this point in the history
…gon_ru\LaraASP\Core\Helpers\Translator`.
  • Loading branch information
LastDragon-ru committed Aug 28, 2023
1 parent b4486e8 commit a5d98e4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types = 1);

namespace LastDragon_ru\LaraASP\Core;
namespace LastDragon_ru\LaraASP\Core\Helpers;

use Closure;
use Countable;
Expand All @@ -12,7 +12,7 @@
use function end;

/**
* Special wrapper around Translator to help translate package's messages.
* Special wrapper around {@see TranslatorContract} to help translate package's messages.
*/
abstract class Translator {
public function __construct(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php declare(strict_types = 1);

namespace LastDragon_ru\LaraASP\Core;
namespace LastDragon_ru\LaraASP\Core\Helpers;

use Illuminate\Contracts\Translation\Translator;
use LastDragon_ru\LaraASP\Core\Helpers\Translator as PackageTranslator;
use LastDragon_ru\LaraASP\Core\Package;
use LastDragon_ru\LaraASP\Core\Testing\Package\TestCase;
use LastDragon_ru\LaraASP\Core\Translator as PackageTranslator;
use LastDragon_ru\LaraASP\Testing\Utils\WithTranslations;
use PHPUnit\Framework\Attributes\CoversClass;

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Provider/WithTranslations.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace LastDragon_ru\LaraASP\Core\Provider;

use Illuminate\Support\ServiceProvider;
use LastDragon_ru\LaraASP\Core\Translator;
use LastDragon_ru\LaraASP\Core\Helpers\Translator;

/**
* @see Translator
Expand Down
2 changes: 1 addition & 1 deletion packages/formatter/src/PackageTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace LastDragon_ru\LaraASP\Formatter;

use Illuminate\Contracts\Translation\Translator as TranslatorContract;
use LastDragon_ru\LaraASP\Core\Translator;
use LastDragon_ru\LaraASP\Core\Helpers\Translator;

class PackageTranslator extends Translator {
public function __construct(TranslatorContract $translator) {
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/src/PackageTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace LastDragon_ru\LaraASP\GraphQL;

use Illuminate\Contracts\Translation\Translator as TranslatorContract;
use LastDragon_ru\LaraASP\Core\Translator;
use LastDragon_ru\LaraASP\Core\Helpers\Translator;

class PackageTranslator extends Translator {
public function __construct(TranslatorContract $translator) {
Expand Down
10 changes: 5 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$translations of method LastDragon_ru\\\\LaraASP\\\\Testing\\\\Package\\\\TestCase\\:\\:setTranslations\\(\\) expects array\\<string, array\\<string, string\\>\\>\\|\\(callable\\(LastDragon_ru\\\\LaraASP\\\\Core\\\\Helpers\\\\TranslatorTest, string, string\\)\\: array\\<string, array\\<string, string\\>\\>\\)\\|null, array\\<string, array\\<string, string\\>\\>\\|\\(callable\\(static, string, string\\)\\: array\\<string, array\\<string, string\\>\\>\\)\\|null given\\.$#"
count: 2
path: packages/core/src/Helpers/TranslatorTest.php

-
message: "#^Cannot call method once\\(\\) on mixed\\.$#"
count: 1
path: packages/core/src/Observer/DispatcherTest.php

-
message: "#^Parameter \\#1 \\$translations of method LastDragon_ru\\\\LaraASP\\\\Testing\\\\Package\\\\TestCase\\:\\:setTranslations\\(\\) expects array\\<string, array\\<string, string\\>\\>\\|\\(callable\\(LastDragon_ru\\\\LaraASP\\\\Core\\\\TranslatorTest, string, string\\)\\: array\\<string, array\\<string, string\\>\\>\\)\\|null, array\\<string, array\\<string, string\\>\\>\\|\\(callable\\(static, string, string\\)\\: array\\<string, array\\<string, string\\>\\>\\)\\|null given\\.$#"
count: 2
path: packages/core/src/TranslatorTest.php

-
message: "#^Parameter \\#1 \\$offset of method LastDragon_ru\\\\LaraASP\\\\Eloquent\\\\Iterators\\\\IteratorImpl\\<TItem of Illuminate\\\\Database\\\\Eloquent\\\\Model\\>\\:\\:setOffset\\(\\) expects int\\|string\\|null, mixed given\\.$#"
count: 1
Expand Down

0 comments on commit a5d98e4

Please sign in to comment.