Skip to content

Commit

Permalink
Merge pull request #16 from maxmind/greg/5.4-min
Browse files Browse the repository at this point in the history
PHP 5.4 min. Run php-cs-fixer on code.
  • Loading branch information
klp2 authored Jul 6, 2017
2 parents 5813f07 + f648c08 commit 622f7c7
Show file tree
Hide file tree
Showing 15 changed files with 209 additions and 148 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
_site
.gh-pages
.idea
.php_cs.cache
apigen.phar
box.phar
build
Expand Down
33 changes: 33 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_unsets' => true,
'concat_space' => [ 'spacing' => 'one'],
'heredoc_to_nowdoc' => true,
'list_syntax' => ['syntax' => 'long'],
'no_extra_consecutive_blank_lines' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block'],
'no_short_echo_tag' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => true,
'pre_increment' => false,
'php_unit_strict' => true,
'php_unit_test_class_requires_covers' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_no_alias_tag' => false,
'phpdoc_order' => true,
'semicolon_after_instruction' => true,
'strict_comparison' => true,
'strict_param' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
)
;
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ before_install:
- phpenv rehash
script:
- mkdir -p build/logs
- 'if [ "5.5" == $TRAVIS_PHP_VERSION ]; then ./vendor/bin/phpcs --standard=PSR2 src/; fi'
- if [[ $TRAVIS_PHP_VERSION = '7.1' ]]; then vendor/bin/php-cs-fixer fix --verbose --diff --dry-run --config=.php_cs; fi
- if [[ $TRAVIS_PHP_VERSION = '7.1' ]]; then vendor/bin/phpcs --standard=PSR2 src/; fi
- ./vendor/bin/phpunit
notifications:
email:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

0.4.0 (2017-XX-XX)
------------------

* PHP 5.4 is now required.

0.3.1 (2016-08-10)
------------------

Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ shared code between MaxMind's various web service APIs.

## Requirements ##

This code is tested on PHP 5.4 and greater. PHP 5.3 may work, but older
versions of PHP are not supported. This library works and is tested with
HHVM.
The library requires PHP 5.4 or greater. This library works and is tested
with HHVM.

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

Expand All @@ -22,6 +21,6 @@ This API uses [Semantic Versioning](http://semver.org/).

## Copyright and License ##

This software is Copyright (c) 2015 by MaxMind, Inc.
This software is Copyright (c) 2015-2017 by MaxMind, Inc.

This is free software, licensed under the Apache License, Version 2.0.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
}
],
"require": {
"php": ">=5.3",
"php": ">=5.4",
"composer/ca-bundle": "^1.0.3",
"ext-curl": "*",
"ext-json": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "2.*",
"phpunit/phpunit": "4.*",
"squizlabs/php_codesniffer": "2.*"
"squizlabs/php_codesniffer": "3.*"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/AuthenticationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace MaxMind\Exception;

/**
* This class represents an error authenticating
* This class represents an error authenticating.
*/
class AuthenticationException extends InvalidRequestException
{
Expand Down
10 changes: 5 additions & 5 deletions src/Exception/HttpException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
class HttpException extends WebServiceException
{
/**
* The URI queried
* The URI queried.
*/
private $uri;

/**
* @param string $message A message describing the error.
* @param int $httpStatus The HTTP status code of the response
* @param string $uri The URI used in the request.
* @param \Exception $previous The previous exception, if any.
* @param string $message a message describing the error
* @param int $httpStatus the HTTP status code of the response
* @param string $uri the URI used in the request
* @param \Exception $previous the previous exception, if any
*/
public function __construct(
$message,
Expand Down
12 changes: 6 additions & 6 deletions src/Exception/InvalidRequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
class InvalidRequestException extends HttpException
{
/**
* The code returned by the MaxMind web service
* The code returned by the MaxMind web service.
*/
private $error;

/**
* @param string $message The exception message
* @param int $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.
* @param string $message the exception message
* @param int $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,
Expand Down
Loading

0 comments on commit 622f7c7

Please sign in to comment.