Skip to content

Commit

Permalink
Exclusive support for php 7 (#48)
Browse files Browse the repository at this point in the history
* PHP 7 exclusive (#45)

* Update mock-client and guzzle adapter

* Remove phpunit exception annotations

* Make php7 exclusive

* Fix tests

* Remove php5 references

* Revert nightly build removal

* Update composer.json

Co-Authored-By: Hassansin <[email protected]>

* Include php 7.x test support

* Fix Travis Build on php 7.1 [ch14742] (#46)

* install phpunit 7 when testing on php 7.1

* fix shell if condition

* revert composer.json changes

* Updated dependencies & Remove outdated docs [ch14742] (#47)

* Updated dependencies and removed outdated docs

* Updated README

* Updated README & Added nightly build
  • Loading branch information
hassansin authored Aug 5, 2019
1 parent 1a2bcdf commit 1e03bdc
Show file tree
Hide file tree
Showing 60 changed files with 49 additions and 15,903 deletions.
20 changes: 16 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
language: php
php:
- '5.5'
- '5.6'
- '7.1'
- '7.2'
- '7.3'
- nightly

before_script:
- composer install
- |
if [[ "$TRAVIS_PHP_VERSION" == 'nightly' ]]; then
#ignore php version check on nightly build
composer install --ignore-platform-reqs
else
composer install
fi
- if [[ "$TRAVIS_PHP_VERSION" == '7.1' ]]; then composer require phpunit/phpunit:^7; fi

script:
- phpunit
- |
if [[ "$TRAVIS_PHP_VERSION" == '7.1' ]]; then
vendor/bin/phpunit
else
phpunit
fi
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ RUN mv composer.phar /usr/local/bin/composer
RUN chmod a+x /usr/local/bin/composer
RUN apt-get update && apt-get install -y git unzip
ARG VERSION
RUN if [ "$VERSION" = "7.2" ]; then \
composer global require phpunit/phpunit:^7 && pecl install xdebug-2.7.0alpha1; else \
composer global require phpunit/phpunit:^4 && pecl install xdebug-2.5.5; fi
RUN docker-php-ext-enable xdebug
RUN composer global require hirak/prestissimo
RUN if [ "$VERSION" = "7.1" ]; then \
composer global require phpunit/phpunit:^7; else \
composer global require phpunit/phpunit:^8; fi
RUN pecl install xdebug-2.7.2;
RUN docker-php-ext-enable xdebug
ENV PATH="${PATH}:/root/.composer/vendor/bin"
COPY php.ini /usr/local/etc/php/
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
RUNNER=docker run -it --rm --workdir "/src" -v "$(PWD):/src" -v "$(HOME)/.composer/cache:/root/.composer/cache" chartmogulphp5 /bin/bash -c
RUNNER=docker run -it --rm --workdir "/src" -v "$(PWD):/src" -v "$(HOME)/.composer/cache:/root/.composer/cache" chartmogulphp71 /bin/bash -c

.PHONY: build composer php

build:
@docker build --build-arg VERSION=5.5 --tag=chartmogulphp5 .
@docker build --build-arg VERSION=7.2 --tag=chartmogulphp7 .
@docker build --build-arg VERSION=7.1 --tag=chartmogulphp71 .
@docker build --build-arg VERSION=7.2 --tag=chartmogulphp72 .
@docker build --build-arg VERSION=7.3 --tag=chartmogulphp73 .
composer:
@$(RUNNER) "composer $(filter-out $@,$(MAKECMDGOALS))"
dependencies:
Expand All @@ -17,8 +18,5 @@ cs:
$(RUNNER) "./vendor/bin/phpcs --standard=PSR2 src/"
cbf:
$(RUNNER) "./vendor/bin/phpcbf --standard=PSR2 src/"
doc:
$(RUNNER) "./vendor/bin/phpdoc"
$(RUNNER) "./vendor/bin/phpdocmd docs/structure.xml docs --index README.md"
%:
@:
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@

This library requires php 5.5 or above.

For older php versions (`< 7.1`) use `1.x.x` releases of this library.

For php version `>=7.1` use the latest releases (`2.x.x`) of the library

**Using Composer**:

**Using Composer**:

```sh
composer require chartmogul/chartmogul-php
Expand All @@ -43,7 +46,7 @@ or in `composer.json`:
```json
{
"require": {
"chartmogul/chartmogul-php": "~1.1"
"chartmogul/chartmogul-php": "~2.0"
}
}
```
Expand Down Expand Up @@ -633,10 +636,6 @@ ChartMogul\Configuration::getDefaultConfiguration()
->setRetries(15); //0 disables retrying
```

## API Documentation

Find the full public API documentation [here](docs/README.md).


## Development

Expand All @@ -648,7 +647,6 @@ You need `Docker` installed locally to use our `Makefile` workflow.
* Install dependencies: `make build`.
* Fix bugs or add features. Make sure the changes pass the coding guidelines by runing PHP CodeSniffer: `make cs`. You can also run `make cbf` to fix some errors automatically.
* Write tests for your new features. Run tests and check test coverage with `make test`.
* Generate API documentation by running `make doc`.
* To run any composer commands or php scripts, use `make composer <commands>` or `make php <script>`.
* If all tests are passed, push to the branch (`git push origin my-new-feature`).
* Create a new Pull Request.
Expand Down
15 changes: 6 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@
}
},
"require": {
"php": ">=5.5",
"php": "^7.1",
"php-http/client-implementation": "^1.0",
"zendframework/zend-diactoros": "^1.3",
"php-http/guzzle6-adapter": "^1.0",
"doctrine/collections": "^1.3",
"zendframework/zend-diactoros": "^2.1",
"php-http/guzzle6-adapter": "^2.0",
"doctrine/collections": "^1.6",
"stechstudio/backoff": "^1.0"

},
"require-dev": {
"php-http/mock-client": "^0.3",
"squizlabs/php_codesniffer": "^2.7",
"phpdocumentor/phpdocumentor": "^2.9",
"evert/phpdoc-md": "^0.2.0"
"php-http/mock-client": "^1.3",
"squizlabs/php_codesniffer": "^3.4"
}
}
126 changes: 0 additions & 126 deletions docs/ChartMogul-Configuration.md

This file was deleted.

Loading

0 comments on commit 1e03bdc

Please sign in to comment.