This commit is contained in:
2023-11-09 19:24:47 +02:00
parent 1645f58a63
commit fc17eada24
19 changed files with 1255 additions and 953 deletions
+1 -6
View File
@@ -32,18 +32,13 @@ class DataModel
{
$result = [];
foreach ($this->data as $k => $v) {
if ($this->searchByPrefix($prefix, $k)) {
if (str_starts_with($k, $prefix)) {
$result[str_replace($prefix, '', $k)] = $v;
}
}
return $result;
}
private function searchByPrefix(string $prefix, string $string): bool
{
return substr($string, 0, strlen($prefix)) === $prefix;
}
public function getBonuses(): array
{
return $this->getPrefixed('add_');