Skip to content

Commit 16684f7

Browse files
ipswisenetzlodern-patsglorand
authored
[Proposal] Rename HasSettings::getRules to HasSettings::getSettingsRules (#123)
* Rename HasSettings::getRules to HasSettings::getSettingsRules * Mark get rules as depricated --------- Co-authored-by: pats <patrick.schroeder@netzlodern.de> Co-authored-by: Gombos Lorand <gombos.lorand@gmail.com>
1 parent bb5aae5 commit 16684f7

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/Managers/AbstractSettingsManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,6 @@ public function deleteMultiple(iterable $paths): SettingsManagerContract
236236
*/
237237
protected function validate(array $settings)
238238
{
239-
Validator::make(Arr::wrap($settings), Arr::wrap($this->model->getRules()))->validate();
239+
Validator::make(Arr::wrap($settings), Arr::wrap($this->model->getSettingsRules()))->validate();
240240
}
241241
}

src/Traits/HasSettings.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@
1212
*/
1313
trait HasSettings
1414
{
15+
/**
16+
* @deprecated Use getSettingsValue() instead
17+
* Will be removed in the next major version
18+
*
19+
* @return array
20+
*/
1521
public function getRules(): array
22+
{
23+
return $this->getSettingsRules();
24+
}
25+
public function getSettingsRules(): array
1626
{
1727
if (property_exists($this, 'settingsRules') && is_array($this->settingsRules)) {
1828
return $this->settingsRules;

0 commit comments

Comments
 (0)