File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 99 ],
1010
1111 'morphies ' => [
12- // order determines search predecence when facade called directly
1312 [
14- // by this name specific morphy can be accessed thorough Morphy::morphy method
15- 'name ' => 'ru ' ,
13+ // by this name specific morphy can be accessed through Morphy::morphy method
14+ // it may be any string
15+ 'name ' => SEOService2020 \Morphy \Morphy::russianLang,
1616 'language ' => SEOService2020 \Morphy \Morphy::russianLang,
17- // if [] specified, default options will be used
18- // to use common options, specify null
17+ // if no options key or null value specified, default options will be used
18+ // to use common options from this config , specify []
1919 'options ' => [],
2020 // when null specified, default morphy dicts path will be used
2121 'dicts_path ' => null ,
Original file line number Diff line number Diff line change 55
66class Factory
77{
8- public static function makeMorphy (array $ config , ?array $ defaultOptions = null ): Morphy
8+ public static function makeMorphy (array $ config , ?array $ commonOptions = null ): Morphy
99 {
1010 return new Morphy (
1111 $ config ['language ' ],
1212 ($ config ['options ' ] ?? null ) === null ?
1313 null :
14- array_replace_recursive ($ defaultOptions ?? [], $ config ['options ' ] ?? []),
14+ array_replace_recursive ($ commonOptions ?? [], $ config ['options ' ] ?? []),
1515 $ config ['dicts_path ' ] ?? null
1616 );
1717 }
1818
19- public static function fromArray (array $ configs , ?array $ defaultOptions = null ): array
19+ public static function fromArray (array $ configs , ?array $ commonOptions = null ): array
2020 {
2121 $ morphies = [];
2222 foreach ($ configs as $ config ) {
23- $ morphies [$ config ['name ' ]] = self ::makeMorphy ($ config , $ defaultOptions );
23+ $ morphies [$ config ['name ' ]] = self ::makeMorphy ($ config , $ commonOptions );
2424 }
2525 return $ morphies ;
2626 }
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public function register()
3535 return new MorphyManager (
3636 Factory::fromArray (
3737 config ('morphy.morphies ' ),
38- config ('morphy.default_options ' )
38+ config ('morphy.common_options ' )
3939 )
4040 );
4141 });
You can’t perform that action at this time.
0 commit comments