1
0
mirror of https://github.com/danog/postgres.git synced 2024-11-26 20:15:02 +01:00

Define scripts in composer.json; remove Makefile; fix styles

This commit is contained in:
Aaron Piotrowski 2018-04-08 21:53:10 -05:00
parent 9269fe5a96
commit 8a6c2ec1e4
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB
3 changed files with 5 additions and 46 deletions

View File

@ -1,45 +0,0 @@
PHP_BIN := php
COMPOSER_BIN := composer
COVERAGE = coverage
SRCS = src test
find_php_files = $(shell find $(1) -type f -name "*.php")
src = $(foreach d,$(SRCS),$(call find_php_files,$(d)))
.PHONY: test
test: setup phpunit code-style
.PHONY: clean
clean: clean-coverage clean-vendor
.PHONY: clean-coverage
clean-coverage:
test ! -e coverage || rm -r coverage
.PHONY: clean-vendor
clean-vendor:
test ! -e vendor || rm -r vendor
.PHONY: setup
setup: vendor/autoload.php
.PHONY: deps-update
deps-update:
$(COMPOSER_BIN) update
.PHONY: phpunit
phpunit: setup
$(PHP_BIN) vendor/bin/phpunit
.PHONY: code-style
code-style: setup
PHP_CS_FIXER_IGNORE_ENV=1 $(PHP_BIN) vendor/bin/php-cs-fixer --diff -v fix
composer.lock: composer.json
$(COMPOSER_BIN) install
touch $@
vendor/autoload.php: composer.lock
$(COMPOSER_BIN) install
touch $@

View File

@ -45,5 +45,9 @@
"platform": { "platform": {
"php": "7.0.0" "php": "7.0.0"
} }
},
"scripts": {
"test": "@php -dzend.assertions=1 -dassert.exception=1 ./vendor/bin/phpunit",
"code-style": "@php ./vendor/bin/php-cs-fixer fix"
} }
} }

View File

@ -5,8 +5,8 @@ namespace Amp\Postgres\Test;
use Amp\Delayed; use Amp\Delayed;
use Amp\Loop; use Amp\Loop;
use Amp\PHPUnit\TestCase; use Amp\PHPUnit\TestCase;
use Amp\Postgres\Pool;
use Amp\Postgres\Internal\PooledStatement; use Amp\Postgres\Internal\PooledStatement;
use Amp\Postgres\Pool;
use Amp\Postgres\ResultSet; use Amp\Postgres\ResultSet;
use Amp\Postgres\Statement; use Amp\Postgres\Statement;
use Amp\Success; use Amp\Success;