mirror of
https://github.com/flarum/core.git
synced 2025-08-09 09:57:06 +02:00
Add integration tests for settings API endpoint
This commit is contained in:
@@ -13,11 +13,6 @@ use Flarum\Foundation\AbstractValidator;
|
||||
|
||||
class SettingsValidator extends AbstractValidator
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $rules = [];
|
||||
|
||||
/**
|
||||
* These rules apply to all attributes.
|
||||
*
|
||||
@@ -45,9 +40,7 @@ class SettingsValidator extends AbstractValidator
|
||||
|
||||
// Apply attribute specific rules.
|
||||
foreach ($rules as $key => $value) {
|
||||
if (array_key_exists($key, $this->rules)) {
|
||||
$rules[$key] = array_merge($rules[$key], $this->rules[$key]);
|
||||
}
|
||||
$rules[$key] = array_merge($rules[$key], $this->rules[$key] ?? []);
|
||||
}
|
||||
|
||||
$validator = $this->validator->make($attributes, $rules, $this->getMessages());
|
||||
|
Reference in New Issue
Block a user