diff --git a/app/SwissGeo.php b/app/SwissGeo.php index 9014b3a..f02ade6 100644 --- a/app/SwissGeo.php +++ b/app/SwissGeo.php @@ -63,7 +63,7 @@ public static function findCitiesNearPoint(float $x, float $y, float $radius): ? return $cityArray; } - public static function findCitiesNearAddress(string $location, float $radius): ?array + public static function findCitiesNearAddress(string $location, float $radius = 0): ?array { $currentLocation = self::findPointByAddress($location); if (!$currentLocation) { diff --git a/composer.lock b/composer.lock index 09e6abf..0446da7 100644 --- a/composer.lock +++ b/composer.lock @@ -69,12 +69,12 @@ "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7" + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/579bb7356d91f9456ccd505f24ca8b667966a0a7", - "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", "shasum": "" }, "require": { @@ -109,7 +109,7 @@ "object", "object graph" ], - "time": "2019-12-15T19:12:40+00:00" + "time": "2020-01-17T21:11:47+00:00" }, { "name": "phar-io/manifest", @@ -437,12 +437,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c2ba6f66e54f496e1c1bf0dc8c163cf028d57edb" + "reference": "5fdf354719d776916492938c9e299c1bdb94965c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c2ba6f66e54f496e1c1bf0dc8c163cf028d57edb", - "reference": "c2ba6f66e54f496e1c1bf0dc8c163cf028d57edb", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5fdf354719d776916492938c9e299c1bdb94965c", + "reference": "5fdf354719d776916492938c9e299c1bdb94965c", "shasum": "" }, "require": { @@ -492,7 +492,7 @@ "testing", "xunit" ], - "time": "2019-12-27T07:43:04+00:00" + "time": "2020-01-17T12:36:02+00:00" }, { "name": "phpunit/php-file-iterator", @@ -550,12 +550,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "4ded0adeba3374d20df3d3ac913bbd694363ecd3" + "reference": "a1f8273e22e3ca9d1498eab743048ea4ed598710" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/4ded0adeba3374d20df3d3ac913bbd694363ecd3", - "reference": "4ded0adeba3374d20df3d3ac913bbd694363ecd3", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/a1f8273e22e3ca9d1498eab743048ea4ed598710", + "reference": "a1f8273e22e3ca9d1498eab743048ea4ed598710", "shasum": "" }, "require": { @@ -595,7 +595,7 @@ "keywords": [ "process" ], - "time": "2019-12-07T05:02:56+00:00" + "time": "2020-01-17T10:49:09+00:00" }, { "name": "phpunit/php-text-template", @@ -644,12 +644,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "2c84d1b7d56c8fe6988d16a9119a18d995f18c74" + "reference": "0f76cad901d778be0e908160d850b5469b9dff89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2c84d1b7d56c8fe6988d16a9119a18d995f18c74", - "reference": "2c84d1b7d56c8fe6988d16a9119a18d995f18c74", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/0f76cad901d778be0e908160d850b5469b9dff89", + "reference": "0f76cad901d778be0e908160d850b5469b9dff89", "shasum": "" }, "require": { @@ -685,7 +685,7 @@ "keywords": [ "timer" ], - "time": "2019-12-27T07:40:22+00:00" + "time": "2020-01-17T12:26:29+00:00" }, { "name": "phpunit/php-token-stream", @@ -693,12 +693,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "4a863f9ce1871119671a4a7e90333f499b22a0e7" + "reference": "80d6b894fd17bbeb2c6432209afbda84c34e129d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/4a863f9ce1871119671a4a7e90333f499b22a0e7", - "reference": "4a863f9ce1871119671a4a7e90333f499b22a0e7", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/80d6b894fd17bbeb2c6432209afbda84c34e129d", + "reference": "80d6b894fd17bbeb2c6432209afbda84c34e129d", "shasum": "" }, "require": { @@ -734,7 +734,7 @@ "keywords": [ "tokenizer" ], - "time": "2019-12-27T07:40:11+00:00" + "time": "2020-01-17T12:30:57+00:00" }, { "name": "phpunit/phpunit", @@ -742,12 +742,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "655558a622e9cfa67f376b2fd640635a72eac6e3" + "reference": "619868463e06e5072c6e42dbae174d99cdd10fc2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/655558a622e9cfa67f376b2fd640635a72eac6e3", - "reference": "655558a622e9cfa67f376b2fd640635a72eac6e3", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/619868463e06e5072c6e42dbae174d99cdd10fc2", + "reference": "619868463e06e5072c6e42dbae174d99cdd10fc2", "shasum": "" }, "require": { @@ -820,7 +820,7 @@ "testing", "xunit" ], - "time": "2020-01-17T06:58:49+00:00" + "time": "2020-01-17T16:15:53+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -828,12 +828,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "5a1086ca6f2307d3d05699535f0aed498cd04605" + "reference": "f48317adc82e5b3f6d2b369af78e2a721d027f5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5a1086ca6f2307d3d05699535f0aed498cd04605", - "reference": "5a1086ca6f2307d3d05699535f0aed498cd04605", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/f48317adc82e5b3f6d2b369af78e2a721d027f5d", + "reference": "f48317adc82e5b3f6d2b369af78e2a721d027f5d", "shasum": "" }, "require": { @@ -865,7 +865,7 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2019-12-27T07:40:57+00:00" + "time": "2020-01-17T12:04:18+00:00" }, { "name": "sebastian/comparator", @@ -873,12 +873,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "b9494f5255afdf7ff522fb99ab39024ec4b066a0" + "reference": "99ca128ebc89c8b52a833cc8509d1a96f68c8029" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/b9494f5255afdf7ff522fb99ab39024ec4b066a0", - "reference": "b9494f5255afdf7ff522fb99ab39024ec4b066a0", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/99ca128ebc89c8b52a833cc8509d1a96f68c8029", + "reference": "99ca128ebc89c8b52a833cc8509d1a96f68c8029", "shasum": "" }, "require": { @@ -929,7 +929,7 @@ "compare", "equality" ], - "time": "2019-12-27T07:40:38+00:00" + "time": "2020-01-17T12:00:41+00:00" }, { "name": "sebastian/diff", @@ -937,12 +937,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "c961b8746a1eb3016d36494c1eb88f90c752c67c" + "reference": "cffa47fbd31d34858a8fae5235445af221689028" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c961b8746a1eb3016d36494c1eb88f90c752c67c", - "reference": "c961b8746a1eb3016d36494c1eb88f90c752c67c", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/cffa47fbd31d34858a8fae5235445af221689028", + "reference": "cffa47fbd31d34858a8fae5235445af221689028", "shasum": "" }, "require": { @@ -985,7 +985,7 @@ "unidiff", "unified diff" ], - "time": "2020-01-06T13:13:10+00:00" + "time": "2020-01-17T12:05:53+00:00" }, { "name": "sebastian/environment", @@ -993,12 +993,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "e6e8e5503d69e910ad16340d55dd208307a8bcf0" + "reference": "635345ff4f2262c07379fdbb4ead0ca14efa941b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/e6e8e5503d69e910ad16340d55dd208307a8bcf0", - "reference": "e6e8e5503d69e910ad16340d55dd208307a8bcf0", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/635345ff4f2262c07379fdbb4ead0ca14efa941b", + "reference": "635345ff4f2262c07379fdbb4ead0ca14efa941b", "shasum": "" }, "require": { @@ -1038,7 +1038,7 @@ "environment", "hhvm" ], - "time": "2019-12-27T07:41:20+00:00" + "time": "2020-01-17T12:13:49+00:00" }, { "name": "sebastian/exporter", @@ -1046,12 +1046,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "5c4345bb9a966b8e5c5db0ff7415defb7811aabb" + "reference": "a20d741c53278346c3d06b11679f2ac11b514a42" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/5c4345bb9a966b8e5c5db0ff7415defb7811aabb", - "reference": "5c4345bb9a966b8e5c5db0ff7415defb7811aabb", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/a20d741c53278346c3d06b11679f2ac11b514a42", + "reference": "a20d741c53278346c3d06b11679f2ac11b514a42", "shasum": "" }, "require": { @@ -1105,7 +1105,7 @@ "export", "exporter" ], - "time": "2019-12-27T07:41:40+00:00" + "time": "2020-01-17T12:16:05+00:00" }, { "name": "sebastian/global-state", @@ -1113,12 +1113,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "7c6cd8549a2efadb65f19bf21a080e1b3fdea32e" + "reference": "a276af74f11884c1071af9de840e83b2699a34da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7c6cd8549a2efadb65f19bf21a080e1b3fdea32e", - "reference": "7c6cd8549a2efadb65f19bf21a080e1b3fdea32e", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a276af74f11884c1071af9de840e83b2699a34da", + "reference": "a276af74f11884c1071af9de840e83b2699a34da", "shasum": "" }, "require": { @@ -1159,7 +1159,7 @@ "keywords": [ "global state" ], - "time": "2019-12-27T07:41:27+00:00" + "time": "2020-01-17T12:18:26+00:00" }, { "name": "sebastian/object-enumerator", @@ -1167,12 +1167,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "2433e3c454abf3c1d3d2d7dcef3d8ce9f85f371c" + "reference": "9b995602514d979119740cfc2f8b0a9ba5fa20f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/2433e3c454abf3c1d3d2d7dcef3d8ce9f85f371c", - "reference": "2433e3c454abf3c1d3d2d7dcef3d8ce9f85f371c", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/9b995602514d979119740cfc2f8b0a9ba5fa20f0", + "reference": "9b995602514d979119740cfc2f8b0a9ba5fa20f0", "shasum": "" }, "require": { @@ -1206,7 +1206,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2019-12-27T07:41:54+00:00" + "time": "2020-01-17T12:21:33+00:00" }, { "name": "sebastian/object-reflector", @@ -1214,12 +1214,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b460ee91c739fff47e91ed09584ae4c0f83483a4" + "reference": "1df36c0abf55daf0c71d053c905b146b83c5cac4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b460ee91c739fff47e91ed09584ae4c0f83483a4", - "reference": "b460ee91c739fff47e91ed09584ae4c0f83483a4", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/1df36c0abf55daf0c71d053c905b146b83c5cac4", + "reference": "1df36c0abf55daf0c71d053c905b146b83c5cac4", "shasum": "" }, "require": { @@ -1251,7 +1251,7 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2019-12-27T07:41:47+00:00" + "time": "2020-01-17T12:24:06+00:00" }, { "name": "sebastian/recursion-context", @@ -1259,12 +1259,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "7e026994ce2247128670301c684d1ea4c4fd58c1" + "reference": "6cb3d7ee69cd8c5f89e35832e30a7ed478ec262f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/7e026994ce2247128670301c684d1ea4c4fd58c1", - "reference": "7e026994ce2247128670301c684d1ea4c4fd58c1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/6cb3d7ee69cd8c5f89e35832e30a7ed478ec262f", + "reference": "6cb3d7ee69cd8c5f89e35832e30a7ed478ec262f", "shasum": "" }, "require": { @@ -1304,7 +1304,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2019-12-27T07:42:02+00:00" + "time": "2020-01-17T12:28:51+00:00" }, { "name": "sebastian/resource-operations", @@ -1354,12 +1354,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "8adce14115ddffc0210f1b3f1c9ae4ef277217e5" + "reference": "9db020c95456fb9e13e75770c8f054ef8acc15b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/8adce14115ddffc0210f1b3f1c9ae4ef277217e5", - "reference": "8adce14115ddffc0210f1b3f1c9ae4ef277217e5", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/9db020c95456fb9e13e75770c8f054ef8acc15b8", + "reference": "9db020c95456fb9e13e75770c8f054ef8acc15b8", "shasum": "" }, "require": { @@ -1392,7 +1392,7 @@ ], "description": "Collection of value objects that represent the types of the PHP type system", "homepage": "https://github.com/sebastianbergmann/type", - "time": "2019-12-27T07:41:34+00:00" + "time": "2020-01-17T10:46:29+00:00" }, { "name": "sebastian/version", diff --git a/tests/SwissGeo/SwissGeoTest.php b/tests/SwissGeo/SwissGeoTest.php index 62c6016..9762118 100644 --- a/tests/SwissGeo/SwissGeoTest.php +++ b/tests/SwissGeo/SwissGeoTest.php @@ -10,6 +10,8 @@ class SwissGeoTest extends TestCase public function testFindCitiesNearAddress() { $this->assertCount(2,SwissGeo::findCitiesNearAddress('Malters', 1.5)); + $this->assertCount(1,SwissGeo::findCitiesNearAddress('Malters')); + $this->assertEquals(['Malters'], SwissGeo::findCitiesNearAddress('Malters')); } public function testFindPointByAddress()