reformat: fix codestyle issues
This commit is contained in:
@@ -289,8 +289,14 @@ class SettingsSerializerService
|
|||||||
throw new InvalidArgumentException('store.product_interaction_mode must be a string');
|
throw new InvalidArgumentException('store.product_interaction_mode must be a string');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($data['product_interaction_mode']) && ! in_array($data['product_interaction_mode'], ['order', 'manager', 'browser'], true)) {
|
if (isset($data['product_interaction_mode']) && ! in_array(
|
||||||
throw new InvalidArgumentException('store.product_interaction_mode must be one of: order, manager, browser');
|
$data['product_interaction_mode'],
|
||||||
|
['order', 'manager', 'browser'],
|
||||||
|
true
|
||||||
|
)) {
|
||||||
|
throw new InvalidArgumentException(
|
||||||
|
'store.product_interaction_mode must be one of: order, manager, browser'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($data['manager_username']) && $data['manager_username'] !== null) {
|
if (isset($data['manager_username']) && $data['manager_username'] !== null) {
|
||||||
@@ -300,7 +306,9 @@ class SettingsSerializerService
|
|||||||
// Проверяем, что это username (не числовой ID)
|
// Проверяем, что это username (не числовой ID)
|
||||||
$managerUsername = trim($data['manager_username']);
|
$managerUsername = trim($data['manager_username']);
|
||||||
if ($managerUsername !== '' && preg_match('/^-?\d+$/', $managerUsername)) {
|
if ($managerUsername !== '' && preg_match('/^-?\d+$/', $managerUsername)) {
|
||||||
throw new InvalidArgumentException('store.manager_username must be a username (e.g., @username), not a numeric ID');
|
throw new InvalidArgumentException(
|
||||||
|
'store.manager_username must be a username (e.g., @username), not a numeric ID'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user