Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial stab at guzzle7 #45

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
phpunit.xml
test/server/node_modules
vendor
.phpunit*
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ cache:
- $HOME/.npm

php:
- 5.5
- 5.6
- 7
- 7.1
- 7.2
- 8.0
- hhvm
- nightly

Expand All @@ -31,8 +29,11 @@ before_script:

script:
- vendor/bin/phpcs -p --warning-severity=0 --ignore=test/server src/ test/
- vendor/bin/phpunit --coverage-clover=./tests/report/coverage.clover --testsuite unit
- vendor/bin/phpunit --coverage-clover=./tests/report/coverage.clover
--testsuite unit
- make test-functional

after_script:
- test -f ./tests/report/coverage.clover && (wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover ./tests/report/coverage.clover)
- test -f ./tests/report/coverage.clover && (wget
https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload
--format=php-clover ./tests/report/coverage.clover)
36 changes: 33 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
DOCKER ?= $(shell which docker)
PHP_VER := 8.0
IMAGE := graze/php-alpine:${PHP_VER}-test
VOLUME := /srv
DOCKER_RUN_BASE := ${DOCKER} run --rm -t -v $$(pwd):${VOLUME} -w ${VOLUME}
DOCKER_RUN := ${DOCKER_RUN_BASE} ${IMAGE}

PREFER_LOWEST ?=

.PHONY: deps deps-js deps-php help
.PHONY: lint test test-unit test-functional test-coverage test-coverage-clover
.PHONY: server-start server-stop


deps: ## Install all dependencies
deps: deps-php deps-js

deps-js: ## Install javascript dependencies
@docker-compose run --rm node yarn install

deps-php: ## Install php dependencies
@docker-compose run --rm composer install --prefer-dist
deps-php: build

deps-php-update: ## Update php dependencies
@docker-compose run --rm composer update --prefer-dist
deps-php-update: build-update

server-start: ## Start the test server
@docker-compose up -d node
Expand All @@ -22,6 +30,28 @@ server-stop: ## Stop the test server
@docker-compose stop node


## newer build

build: ## Install the dependencies
build: ensure-composer-file
make 'composer-install --optimize-autoloader --prefer-dist ${PREFER_LOWEST}'

build-update: ## Update the dependencies
build-update: ensure-composer-file
make 'composer-update --optimize-autoloader --prefer-dist ${PREFER_LOWEST}'

ensure-composer-file: # Update the composer file
make 'composer-config platform.php ${PHP_VER}'

composer-%: ## Run a composer command, `make "composer-<command> [...]"`.
${DOCKER} run -t --rm \
-v $$(pwd):/app:delegated \
-v ~/.composer:/tmp:delegated \
-v ~/.ssh:/root/.ssh:ro \
composer --ansi --no-interaction $* $(filter-out $@,$(MAKECMDGOALS))

##

lint: ## Run phpcs against the code.
@docker-compose run --rm test vendor/bin/phpcs -p --warning-severity=0 --ignore=test/server src/ test/

Expand Down
96 changes: 54 additions & 42 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,58 @@
{
"name": "graze/guzzle-jsonrpc",
"description": "JSON-RPC 2.0 client for Guzzle",
"keywords": ["guzzle", "guzzlehttp", "http", "json", "json-rpc", "jsonrpc", "ring", "rpc"],
"homepage": "https://github.com/graze/guzzle-jsonrpc",
"license": "MIT",
"type": "library",
"config": {
"platform": {
"ext-simplexml": "1.0",
"ext-dom": "1.0",
"ext-tokenizer": "1.0",
"ext-xmlwriter": "1.0"
}
},
"authors": [
{
"name": "Graze tech team",
"homepage": "https://github.com/graze/guzzle-jsonrpc/graphs/contributors"
}
"name": "graze/guzzle-jsonrpc",
"description": "JSON-RPC 2.0 client for Guzzle",
"keywords": [
"guzzle",
"guzzlehttp",
"http",
"json",
"json-rpc",
"jsonrpc",
"ring",
"rpc"
],
"homepage": "https://github.com/graze/guzzle-jsonrpc",
"license": "MIT",
"type": "library",
"config": {
"platform": {
"ext-simplexml": "1.0",
"ext-dom": "1.0",
"ext-tokenizer": "1.0",
"ext-xmlwriter": "1.0",
"php": "8.0"
}
},
"authors": [
{
"name": "Graze tech team",
"homepage": "https://github.com/graze/guzzle-jsonrpc/graphs/contributors"
}
],
"autoload": {
"files": [
"src/functions_include.php"
],
"autoload": {
"files": ["src/functions_include.php"],
"psr-4": {
"Graze\\GuzzleHttp\\JsonRpc\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Graze\\GuzzleHttp\\JsonRpc\\Test\\": "test/src"
}
},
"require": {
"php": ">=5.5|^7.0",
"guzzlehttp/guzzle": "^6.0",
"guzzlehttp/promises": "^1.0",
"psr/http-message": "^1.0"
},
"require-dev": {
"adlawson/timezone": "~1.0",
"squizlabs/php_codesniffer": "^2.9",
"mockery/mockery": "~0.9",
"phpunit/phpunit": "^4|^5",
"graze/standards": "^1.0"
"psr-4": {
"Graze\\GuzzleHttp\\JsonRpc\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Graze\\GuzzleHttp\\JsonRpc\\Test\\": "test/src"
}
},
"require": {
"php": "^7.2|^8.0",
"guzzlehttp/guzzle": "^7.0",
"guzzlehttp/promises": "^1.0",
"psr/http-message": "^1.0"
},
"require-dev": {
"adlawson/timezone": "~1.0",
"squizlabs/php_codesniffer": "^2.9",
"mockery/mockery": "^1.4",
"phpunit/phpunit": "^8|^9",
"graze/standards": "^1.0"
}
}
Loading