Skip to content

Commit 58cb9a1

Browse files
feat(geolocation): Prepare for country and city MaxMind database types
1 parent 69453d7 commit 58cb9a1

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/Configuration.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,19 @@ public function getConfigTreeBuilder(): TreeBuilder
5151
->addDefaultsIfNotSet()
5252
->children()
5353
->booleanNode('enabled')
54-
->isRequired()
5554
->defaultFalse()
5655
->end()
5756
->enumNode('type')
58-
->isRequired()
5957
->defaultValue(Constants::GEOLOCATION_TYPE_MAXMIND)
6058
->values([Constants::GEOLOCATION_TYPE_MAXMIND])
6159
->end()
6260
->arrayNode(Constants::GEOLOCATION_TYPE_MAXMIND)
6361
->addDefaultsIfNotSet()
6462
->children()
63+
->enumNode('database_type')
64+
->defaultValue(Constants::MAXMIND_COUNTRY)
65+
->values([Constants::MAXMIND_COUNTRY, Constants::MAXMIND_CITY])
66+
->end()
6567
->scalarNode('database_path')
6668
->cannotBeEmpty()
6769
->end()

src/Constants.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,10 @@ class Constants
6666

6767
/** @var string The "MaxMind" geolocation type */
6868
public const GEOLOCATION_TYPE_MAXMIND = 'maxmind';
69+
70+
/** @var string The Maxmind "Country" database type */
71+
public const MAXMIND_COUNTRY = 'country';
72+
73+
/** @var string The Maxmind "City" database type */
74+
public const MAXMIND_CITY = 'city';
6975
}

0 commit comments

Comments
 (0)