Skip to content

Commit 3070575

Browse files
authored
Merge pull request #128 from maxmind/horgh/phpdoc
Use phpDocumentor2 instead of ApiGen
2 parents 3e5b2db + aa7ffa3 commit 3070575

File tree

14 files changed

+60
-157
lines changed

14 files changed

+60
-157
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ _site
33
.idea
44
.php_cs.cache
55
GeoLite2-City.mmdb
6-
apigen.phar
76
box.phar
87
build
98
composer.lock
109
composer.phar
10+
/phpDocumentor.phar
1111
phpunit.xml
1212
geoip2.phar
1313
geoip2-php.sublime-*

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ matrix:
1010
- php: '7.0'
1111
- php: '7.1'
1212
- php: '7.2'
13+
- php: '7.3'
1314
env:
1415
- RUN_LINTER=1
1516
- RUN_SNYK=1

README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
## Description ##
44

55
This package provides an API for the GeoIP2
6-
[web services](http://dev.maxmind.com/geoip/geoip2/web-services) and
7-
[databases](http://dev.maxmind.com/geoip/geoip2/downloadable). The API also
6+
[web services](https://dev.maxmind.com/geoip/geoip2/web-services) and
7+
[databases](https://dev.maxmind.com/geoip/geoip2/downloadable). The API also
88
works with the free
9-
[GeoLite2 databases](http://dev.maxmind.com/geoip/geoip2/geolite2/).
9+
[GeoLite2 databases](https://dev.maxmind.com/geoip/geoip2/geolite2/).
1010

1111
## Install via Composer ##
1212

13-
We recommend installing this package with [Composer](http://getcomposer.org/).
13+
We recommend installing this package with [Composer](https://getcomposer.org/).
1414

1515
### Download Composer ###
1616

@@ -46,18 +46,18 @@ require 'vendor/autoload.php';
4646
## Install via Phar ##
4747

4848
Although we strongly recommend using Composer, we also provide a
49-
[phar archive](http://php.net/manual/en/book.phar.php) containing most of the
49+
[phar archive](https://php.net/manual/en/book.phar.php) containing most of the
5050
dependencies for GeoIP2. Our latest phar archive is available on
5151
[our releases page](https://github.com/maxmind/GeoIP2-php/releases).
5252

5353
### Install Dependencies ###
5454

5555
In order to use the phar archive, you must have the PHP
56-
[Phar extension](http://php.net/manual/en/book.phar.php) installed and
56+
[Phar extension](https://php.net/manual/en/book.phar.php) installed and
5757
enabled.
5858

5959
If you will be making web service requests, you must have the PHP
60-
[cURL extension](http://php.net/manual/en/book.curl.php)
60+
[cURL extension](https://php.net/manual/en/book.curl.php)
6161
installed to use this archive. For Debian based distributions, this can
6262
typically be found in the the `php-curl` package. For other operating
6363
systems, please consult the relevant documentation. After installing the
@@ -326,15 +326,15 @@ Because of these factors, it is possible for any end point to return a record
326326
where some or all of the attributes are unpopulated.
327327

328328
See the
329-
[GeoIP2 Precision web service docs](http://dev.maxmind.com/geoip/geoip2/web-services)
329+
[GeoIP2 Precision web service docs](https://dev.maxmind.com/geoip/geoip2/web-services)
330330
for details on what data each end point may return.
331331

332332
The only piece of data which is always returned is the `ipAddress`
333333
attribute in the `GeoIp2\Record\Traits` record.
334334

335335
## Integration with GeoNames ##
336336

337-
[GeoNames](http://www.geonames.org/) offers web services and downloadable
337+
[GeoNames](https://www.geonames.org/) offers web services and downloadable
338338
databases with data on geographical features around the world, including
339339
populated places. They offer both free and paid premium data. Each
340340
feature is unique identified by a `geonameId`, which is an integer.
@@ -351,10 +351,10 @@ the GeoNames premium data set.
351351

352352
If the problem you find is that an IP address is incorrectly mapped,
353353
please
354-
[submit your correction to MaxMind](http://www.maxmind.com/en/correction).
354+
[submit your correction to MaxMind](https://www.maxmind.com/en/correction).
355355

356356
If you find some other sort of mistake, like an incorrect spelling,
357-
please check the [GeoNames site](http://www.geonames.org/) first. Once
357+
please check the [GeoNames site](https://www.geonames.org/) first. Once
358358
you've searched for a place and found it on the GeoNames map view, there
359359
are a number of links you can use to correct data ("move", "edit",
360360
"alternate names", etc.). Once the correction is part of the GeoNames
@@ -363,7 +363,7 @@ releases.
363363

364364
If you are a paying MaxMind customer and you're not sure where to submit
365365
a correction, please
366-
[contact MaxMind support](http://www.maxmind.com/en/support) for help.
366+
[contact MaxMind support](https://www.maxmind.com/en/support) for help.
367367

368368
## Other Support ##
369369

@@ -372,7 +372,7 @@ Please report all issues with this code using the
372372

373373
If you are having an issue with a MaxMind service that is not specific
374374
to the client API, please see
375-
[our support page](http://www.maxmind.com/en/support).
375+
[our support page](https://www.maxmind.com/en/support).
376376

377377
## Requirements ##
378378

@@ -390,11 +390,10 @@ https://github.com/maxmind/MaxMind-DB
390390

391391
## Versioning ##
392392

393-
The GeoIP2 PHP API uses [Semantic Versioning](http://semver.org/).
393+
The GeoIP2 PHP API uses [Semantic Versioning](https://semver.org/).
394394

395395
## Copyright and License ##
396396

397-
This software is Copyright (c) 2013-2018 by MaxMind, Inc.
397+
This software is Copyright (c) 2013-2019 by MaxMind, Inc.
398398

399399
This is free software, licensed under the Apache License, Version 2.0.
400-

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{
1010
"name": "Gregory J. Oschwald",
1111
"email": "[email protected]",
12-
"homepage": "http://www.maxmind.com/"
12+
"homepage": "https://www.maxmind.com/"
1313
}
1414
],
1515
"require": {

dev-bin/release.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,21 @@ if [ -n "$(git status --porcelain)" ]; then
7676
exit 1
7777
fi
7878

79-
# We no longer have apigen as a dependency in Composer as it pulls in old
80-
# versions of other libraries, breaking PHP 7.2.
81-
#
82-
# Note that the Phar is no longer being updated. We will likely need to go
83-
# back to a Composer dep or use another generator at some point in the
84-
# future.
85-
wget -O apigen.phar "http://apigen.org/apigen.phar"
86-
87-
php apigen.phar generate \
88-
-s ../src \
89-
-s ../../MaxMind-DB-Reader-php/src \
90-
-d "doc/$tag" \
79+
# Using Composer is possible, but they don't recommend it.
80+
wget -O phpDocumentor.phar https://github.com/phpDocumentor/phpDocumentor2/releases/download/v2.9.0/phpDocumentor.phar
81+
82+
# Use cache dir in /tmp as otherwise cache files get into the output directory.
83+
cachedir="/tmp/phpdoc-$$-$RANDOM"
84+
rm -rf "$cachedir"
85+
86+
php phpDocumentor.phar \
87+
-d src,../MaxMind-DB-Reader-php/src \
88+
--visibility public \
89+
--cache-folder "$cachedir" \
9190
--title "GeoIP2 PHP API $tag" \
92-
--php
91+
-t "doc/$tag"
9392

93+
rm -rf "$cachedir"
9494

9595
page=index.md
9696
cat <<EOF > $page

src/Model/City.php

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,25 @@
77
*
88
* The only difference between the City and Insights model classes is which
99
* fields in each record may be populated. See
10-
* http://dev.maxmind.com/geoip/geoip2/web-services more details.
10+
* https://dev.maxmind.com/geoip/geoip2/web-services for more details.
1111
*
1212
* @property-read \GeoIp2\Record\City $city City data for the requested IP
1313
* address.
14-
* @property-read \GeoIp2\Record\Continent $continent Continent data for the
15-
* requested IP address.
16-
* @property-read \GeoIp2\Record\Country $country Country data for the requested
17-
* IP address. This object represents the country where MaxMind believes the
18-
* end user is located.
1914
* @property-read \GeoIp2\Record\Location $location Location data for the
2015
* requested IP address.
2116
* @property-read \GeoIp2\Record\Postal $postal Postal data for the
2217
* requested IP address.
23-
* @property-read \GeoIp2\Record\MaxMind $maxmind Data related to your MaxMind
24-
* account.
25-
* @property-read \GeoIp2\Record\Country $registeredCountry Registered country
26-
* data for the requested IP address. This record represents the country
27-
* where the ISP has registered a given IP block and may differ from the
28-
* user's country.
29-
* @property-read \GeoIp2\Record\RepresentedCountry $representedCountry
30-
* Represented country data for the requested IP address. The represented
31-
* country is used for things like military bases. It is only present when
32-
* the represented country differs from the country.
33-
* @property-read array $subdivisions An array of {@link \GeoIp2\Record\Subdivision}
18+
* @property-read array $subdivisions An array \GeoIp2\Record\Subdivision
3419
* objects representing the country subdivisions for the requested IP
3520
* address. The number and type of subdivisions varies by country, but a
3621
* subdivision is typically a state, province, county, etc. Subdivisions
3722
* are ordered from most general (largest) to most specific (smallest).
3823
* If the response did not contain any subdivisions, this method returns
3924
* an empty array.
40-
* @property-read \GeoIp2\Record\Subdivision $mostSpecificSubdivision An object
25+
* @property-read \GeoIp2\Record\Subdivision $mostSpecificSubdivision An object
4126
* representing the most specific subdivision returned. If the response
4227
* did not contain any subdivisions, this method returns an empty
43-
* {@link \GeoIp2\Record\Subdivision} object.
44-
* @property-read \GeoIp2\Record\Traits $traits Data for the traits of the
45-
* requested IP address.
28+
* \GeoIp2\Record\Subdivision object.
4629
*/
4730
class City extends Country
4831
{

src/Model/Country.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* The only difference between the City and Insights model classes is which
99
* fields in each record may be populated. See
10-
* http://dev.maxmind.com/geoip/geoip2/web-services more details.
10+
* https://dev.maxmind.com/geoip/geoip2/web-services for more details.
1111
*
1212
* @property-read \GeoIp2\Record\Continent $continent Continent data for the
1313
* requested IP address.

src/Model/Enterprise.php

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,7 @@
77
*
88
* The only difference between the City and Enterprise model classes is which
99
* fields in each record may be populated. See
10-
* http://dev.maxmind.com/geoip/geoip2/web-services more details.
11-
*
12-
* @property-read \GeoIp2\Record\City $city City data for the requested IP
13-
* address.
14-
* @property-read \GeoIp2\Record\Continent $continent Continent data for the
15-
* requested IP address.
16-
* @property-read \GeoIp2\Record\Country $country Country data for the requested
17-
* IP address. This object represents the country where MaxMind believes the
18-
* end user is located.
19-
* @property-read \GeoIp2\Record\Location $location Location data for the
20-
* requested IP address.
21-
* @property-read \GeoIp2\Record\MaxMind $maxmind Data related to your MaxMind
22-
* account.
23-
* @property-read \GeoIp2\Record\Country $registeredCountry Registered country
24-
* data for the requested IP address. This record represents the country
25-
* where the ISP has registered a given IP block and may differ from the
26-
* user's country.
27-
* @property-read \GeoIp2\Record\RepresentedCountry $representedCountry
28-
* Represented country data for the requested IP address. The represented
29-
* country is used for things like military bases. It is only present when
30-
* the represented country differs from the country.
31-
* @property-read array $subdivisions An array of {@link \GeoIp2\Record\Subdivision}
32-
* objects representing the country subdivisions for the requested IP
33-
* address. The number and type of subdivisions varies by country, but a
34-
* subdivision is typically a state, province, county, etc. Subdivisions
35-
* are ordered from most general (largest) to most specific (smallest).
36-
* If the response did not contain any subdivisions, this method returns
37-
* an empty array.
38-
* @property-read \GeoIp2\Record\Subdivision $mostSpecificSubdivision An object
39-
* representing the most specific subdivision returned. If the response
40-
* did not contain any subdivisions, this method returns an empty
41-
* {@link \GeoIp2\Record\Subdivision} object.
42-
* @property-read \GeoIp2\Record\Traits $traits Data for the traits of the
43-
* requested IP address.
10+
* https://dev.maxmind.com/geoip/geoip2/web-services for more details.
4411
*/
4512
class Enterprise extends City
4613
{

src/Model/Insights.php

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,7 @@
77
*
88
* The only difference between the City and Insights model classes is which
99
* fields in each record may be populated. See
10-
* http://dev.maxmind.com/geoip/geoip2/web-services more details.
11-
*
12-
* @property-read \GeoIp2\Record\City $city City data for the requested IP
13-
* address.
14-
* @property-read \GeoIp2\Record\Continent $continent Continent data for the
15-
* requested IP address.
16-
* @property-read \GeoIp2\Record\Country $country Country data for the requested
17-
* IP address. This object represents the country where MaxMind believes the
18-
* end user is located.
19-
* @property-read \GeoIp2\Record\Location $location Location data for the
20-
* requested IP address.
21-
* @property-read \GeoIp2\Record\MaxMind $maxmind Data related to your MaxMind
22-
* account.
23-
* @property-read \GeoIp2\Record\Country $registeredCountry Registered country
24-
* data for the requested IP address. This record represents the country
25-
* where the ISP has registered a given IP block and may differ from the
26-
* user's country.
27-
* @property-read \GeoIp2\Record\RepresentedCountry $representedCountry
28-
* Represented country data for the requested IP address. The represented
29-
* country is used for things like military bases. It is only present when
30-
* the represented country differs from the country.
31-
* @property-read array $subdivisions An array of {@link \GeoIp2\Record\Subdivision}
32-
* objects representing the country subdivisions for the requested IP
33-
* address. The number and type of subdivisions varies by country, but a
34-
* subdivision is typically a state, province, county, etc. Subdivisions
35-
* are ordered from most general (largest) to most specific (smallest).
36-
* If the response did not contain any subdivisions, this method returns
37-
* an empty array.
38-
* @property-read \GeoIp2\Record\Subdivision $mostSpecificSubdivision An object
39-
* representing the most specific subdivision returned. If the response
40-
* did not contain any subdivisions, this method returns an empty
41-
* {@link \GeoIp2\Record\Subdivision} object.
42-
* @property-read \GeoIp2\Record\Traits $traits Data for the traits of the
43-
* requested IP address.
10+
* https://dev.maxmind.com/geoip/geoip2/web-services for more details.
4411
*/
4512
class Insights extends City
4613
{

src/Record/Country.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
* @property-read bool $isInEuropeanUnion This is true if the country is a
1616
* member state of the European Union. This attribute is returned by all
1717
* location services and databases.
18-
* @property-read string|null $isoCode The
19-
* {@link * http://en.wikipedia.org/wiki/ISO_3166-1 two-character ISO 3166-1 alpha
20-
* code} for the country. This attribute is returned by all location services
21-
* and databases.
18+
* @property-read string|null $isoCode The two-character ISO 3166-1 alpha code
19+
* for the country. See https://en.wikipedia.org/wiki/ISO_3166-1. This
20+
* attribute is returned by all location services and databases.
2221
* @property-read string|null $name The name of the country based on the locales
2322
* list passed to the constructor. This attribute is returned by all location
2423
* services and databases.

0 commit comments

Comments
 (0)