1 | <?php |
||||||
2 | |||||||
3 | namespace Signifly\Translator; |
||||||
4 | |||||||
5 | use Illuminate\Support\ServiceProvider; |
||||||
6 | use Signifly\Translator\Contracts\Translator as TranslatorContract; |
||||||
7 | |||||||
8 | class TranslatorServiceProvider extends ServiceProvider |
||||||
9 | { |
||||||
10 | /** |
||||||
11 | * Bootstrap the application services. |
||||||
12 | * |
||||||
13 | * @return void |
||||||
14 | */ |
||||||
15 | public function boot() |
||||||
16 | { |
||||||
17 | if ($this->app->runningInConsole()) { |
||||||
0 ignored issues
–
show
|
|||||||
18 | $this->publishConfigs(); |
||||||
19 | $this->publishMigrations(); |
||||||
20 | } |
||||||
21 | |||||||
22 | $this->mergeConfigFrom(__DIR__.'/../config/translator.php', 'translator'); |
||||||
0 ignored issues
–
show
The method
mergeConfigFrom() does not exist on Signifly\Translator\TranslatorServiceProvider .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||||
23 | } |
||||||
24 | |||||||
25 | /** |
||||||
26 | * Register the service provider. |
||||||
27 | * |
||||||
28 | * @return void |
||||||
29 | */ |
||||||
30 | public function register() |
||||||
31 | { |
||||||
32 | $this->app->singleton(TranslatorContract::class, function ($app) { |
||||||
0 ignored issues
–
show
The method
singleton() does not exist on Tests\Laravel\App .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||||
33 | return new Translator($app['config']); |
||||||
34 | }); |
||||||
35 | } |
||||||
36 | |||||||
37 | /** |
||||||
38 | * Get the services provided by the provider. |
||||||
39 | * |
||||||
40 | * @return array |
||||||
41 | */ |
||||||
42 | public function provides() |
||||||
43 | { |
||||||
44 | return [TranslatorContract::class]; |
||||||
45 | } |
||||||
46 | |||||||
47 | protected function publishConfigs(): void |
||||||
48 | { |
||||||
49 | $this->publishes([ |
||||||
0 ignored issues
–
show
The method
publishes() does not exist on Signifly\Translator\TranslatorServiceProvider . Did you maybe mean publishConfigs() ?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. ![]() |
|||||||
50 | __DIR__.'/../config/translator.php' => config_path('translator.php'), |
||||||
51 | ], 'translator-config'); |
||||||
52 | } |
||||||
53 | |||||||
54 | protected function publishMigrations(): void |
||||||
55 | { |
||||||
56 | if (class_exists('CreateTranslationsTable')) { |
||||||
57 | return; |
||||||
58 | } |
||||||
59 | |||||||
60 | $timestamp = date('Y_m_d_His', time()); |
||||||
61 | |||||||
62 | $this->publishes([ |
||||||
63 | __DIR__.'/../migrations/create_translations_table.php.stub' => database_path("/migrations/{$timestamp}_create_translations_table.php"), |
||||||
64 | ], 'translator-migrations'); |
||||||
65 | } |
||||||
66 | } |
||||||
67 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.