Skip to content

Commit 286f124

Browse files
committed
Fixed typos, added more comments
1 parent b6d6bc9 commit 286f124

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

config/config.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
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,

src/Factory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55

66
class 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
}

src/MorphyServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)