Skip to content

Commit

Permalink
Merge pull request #30 from maxmind/greg/types
Browse files Browse the repository at this point in the history
Add additional type hints
  • Loading branch information
horgh authored Oct 1, 2020
2 parents 74c996c + a12b30a commit ba67d95
Show file tree
Hide file tree
Showing 19 changed files with 152 additions and 156 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ language: php
dist: trusty
matrix:
include:
- php: '5.6'
- php: '7.0'
- php: '7.1'
- php: '7.2'
- php: '7.3'
- php: '7.4'
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGELOG
=========

0.8.0
------------------

* PHP 7.2 or greater is now required.
* Added additional type hints.

0.7.0 (2020-05-06)
------------------

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ shared code between MaxMind's various web service client APIs.

## Requirements ##

The library requires PHP 5.6 or greater.
The library requires PHP 7.2 or greater.

There are several other dependencies as defined in the `composer.json` file.

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
}
],
"require": {
"php": ">=5.6",
"php": ">=7.2",
"composer/ca-bundle": "^1.0.3",
"ext-curl": "*",
"ext-json": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "2.*",
"phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0",
"phpunit/phpunit": "^8.0 || ^9.0",
"squizlabs/php_codesniffer": "3.*"
},
"autoload": {
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/AuthenticationException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace MaxMind\Exception;

/**
Expand Down
12 changes: 7 additions & 5 deletions src/Exception/HttpException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace MaxMind\Exception;

/**
Expand All @@ -19,21 +21,21 @@ class HttpException extends WebServiceException
* @param \Exception $previous the previous exception, if any
*/
public function __construct(
$message,
$httpStatus,
$uri,
string $message,
int $httpStatus,
string $uri,
\Exception $previous = null
) {
$this->uri = $uri;
parent::__construct($message, $httpStatus, $previous);
}

public function getUri()
public function getUri(): string
{
return $this->uri;
}

public function getStatusCode()
public function getStatusCode(): int
{
return $this->getCode();
}
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/InsufficientFundsException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace MaxMind\Exception;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/InvalidInputException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace MaxMind\Exception;

/**
Expand Down
14 changes: 8 additions & 6 deletions src/Exception/InvalidRequestException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace MaxMind\Exception;

/**
Expand All @@ -14,23 +16,23 @@ class InvalidRequestException extends HttpException

/**
* @param string $message the exception message
* @param int $error the error code returned by the MaxMind web service
* @param string $error the error code returned by the MaxMind web service
* @param int $httpStatus the HTTP status code of the response
* @param string $uri the URI queries
* @param \Exception $previous the previous exception, if any
*/
public function __construct(
$message,
$error,
$httpStatus,
$uri,
string $message,
string $error,
int $httpStatus,
string $uri,
\Exception $previous = null
) {
$this->error = $error;
parent::__construct($message, $httpStatus, $uri, $previous);
}

public function getErrorCode()
public function getErrorCode(): string
{
return $this->error;
}
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/IpAddressNotFoundException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace MaxMind\Exception;

class IpAddressNotFoundException extends InvalidRequestException
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/PermissionRequiredException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace MaxMind\Exception;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Exception/WebServiceException.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace MaxMind\Exception;

/**
Expand Down
Loading

0 comments on commit ba67d95

Please sign in to comment.