File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 77use Elegantly \Translator \Collections \Translations ;
88use Elegantly \Translator \Drivers \Driver ;
99use Elegantly \Translator \Services \Exporter \ExporterInterface ;
10+ use Elegantly \Translator \Services \Proofread \ProofreadServiceInterface ;
11+ use Elegantly \Translator \Services \SearchCode \SearchCodeServiceInterface ;
12+ use Elegantly \Translator \Services \Translate \TranslateServiceInterface ;
1013use Illuminate \Support \Facades \Facade ;
1114
1215/**
1316 * @method static \Elegantly\Translator\Translator driver(null|string|Driver $name)
17+ * @method static withProofreadService(ProofreadServiceInterface $service)
18+ * @method static withTranslateService(TranslateServiceInterface $service)
19+ * @method static withSearchcodeService(SearchCodeServiceInterface $service)
1420 * @method static array<int, string> getLocales()
1521 * @method static Translations getTranslations(string $locale)
1622 * @method static array<string, array{ count: int, files: string[] }> getMissingTranslations(string $locale)
Original file line number Diff line number Diff line change @@ -36,6 +36,39 @@ public function driver(null|string|Driver $name): static
3636 );
3737 }
3838
39+ public function withProofreadService (ProofreadServiceInterface $ service ): static
40+ {
41+ return new static (
42+ driver: $ this ->driver ,
43+ translateService: $ this ->translateService ,
44+ proofreadService: $ service ,
45+ searchcodeService: $ this ->searchcodeService ,
46+ exporter: $ this ->exporter
47+ );
48+ }
49+
50+ public function withTranslateService (TranslateServiceInterface $ service ): static
51+ {
52+ return new static (
53+ driver: $ this ->driver ,
54+ translateService: $ service ,
55+ proofreadService: $ this ->proofreadService ,
56+ searchcodeService: $ this ->searchcodeService ,
57+ exporter: $ this ->exporter
58+ );
59+ }
60+
61+ public function withSearchcodeService (SearchCodeServiceInterface $ service ): static
62+ {
63+ return new static (
64+ driver: $ this ->driver ,
65+ translateService: $ this ->translateService ,
66+ proofreadService: $ this ->proofreadService ,
67+ searchcodeService: $ service ,
68+ exporter: $ this ->exporter
69+ );
70+ }
71+
3972 /**
4073 * @return array<int, string>
4174 */
You can’t perform that action at this time.
0 commit comments