Files
pterodactyl-panel/app/Support/ValidationRuleSubset.php
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

26 lines
530 B
PHP

<?php
declare(strict_types=1);
namespace Pterodactyl\Support;
final class ValidationRuleSubset
{
/**
* @param NormalizedValidationRules $rules
* @param list<string> $keys
* @return NormalizedValidationRules
*/
public static function select(array $rules, array $keys): array
{
$selected = [];
foreach ($keys as $key) {
if (array_key_exists($key, $rules)) {
$selected[$key] = $rules[$key];
}
}
return $selected;
}
}