Skip to content

Commit

Permalink
Update build
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar authored and Milan Felix Šulc committed Dec 25, 2018
1 parent 2ccaf59 commit 36ee64b
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 96 deletions.
13 changes: 4 additions & 9 deletions .editorconfig
@@ -1,21 +1,16 @@
# EditorConfig is awesome: http://EditorConfig.org

# Top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# JS / PHP
[*.{js,php,phpt}]
charset = utf-8
indent_style = tab
indent_size = 4
indent_size = tab
tab_width = 4

# Composer
[{composer.json}]
[{*.json,*.yml,*.md}]
indent_style = space
indent_size = 2
19 changes: 10 additions & 9 deletions .gitattributes
@@ -1,9 +1,10 @@
/.docs export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/LICENSE export-ignore
/phpstan.neon export-ignore
/README.md export-ignore
# Not archived
.docs export-ignore
tests export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
phpstan.neon export-ignore
README.md export-ignore
ruleset.xml export-ignore
4 changes: 2 additions & 2 deletions .gitignore
Expand Up @@ -5,5 +5,5 @@
/vendor
/composer.lock

# Temp
/temp
# Tests
/coverage.xml
89 changes: 42 additions & 47 deletions .travis.yml
@@ -1,65 +1,60 @@
language: php
php:
- 7.1
- 7.2
- 7.3
- 7.1
- 7.2
- 7.3

before_install:
# Turn off XDebug
- phpenv config-rm xdebug.ini || return 0
# Turn off XDebug
- phpenv config-rm xdebug.ini || return 0

install:
# Composer
- travis_retry composer install --no-progress --prefer-dist
# Composer
- travis_retry composer install --no-progress --prefer-dist

script:
# Check all dependencies at master are up-to-date when running regular builds
- |
if [[ $TRAVIS_EVENT_TYPE == "cron" && $TRAVIS_BRANCH == "master" ]]; then
composer outdated --direct --strict
fi
# Tests
- composer run-script phpunit

after_failure:
# Print *.actual content
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
# Tests
- composer run-script tests

jobs:
include:
- env: title="Lowest Dependencies 7.1"
php: 7.1
install:
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest
script:
- composer run-script phpunit

- stage: Quality Assurance
php: 7.1
script:
- composer run-script qa

- stage: Phpstan
php: 7.1
script:
- composer run-script phpstan-install
- composer run-script phpstan

- stage: Test Coverage
if: branch = master AND type = push
php: 7.1
script:
- composer run-script coverage
after_script:
- wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
- php php-coveralls.phar --verbose --config tests/.coveralls.yml
- env: title="Lowest Dependencies 7.1"
php: 7.1
install:
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest
script:
- composer run-script tests

- stage: Quality Assurance
php: 7.1
script:
- composer run-script qa

- stage: Phpstan
php: 7.1
script:
- composer run-script phpstan

- stage: Test Coverage
if: branch = master AND type = push
php: 7.1
script:
- composer run-script coverage
after_script:
- composer global require php-coveralls/php-coveralls ^2.1.0
- ~/.composer/vendor/bin/php-coveralls --verbose --config tests/.coveralls.yml

- stage: Outdated Dependencies
if: branch = master AND type = cron
php: 7.1
script:
- composer outdated --direct --strict

allow_failures:
- stage: Test Coverage
- stage: Test Coverage

sudo: false

cache:
directories:
- $HOME/.composer/cache
- $HOME/.composer/cache
7 changes: 3 additions & 4 deletions README.md
Expand Up @@ -7,11 +7,10 @@ Doctrine DBAL for Nette Framework.
[![Build Status](https://img.shields.io/travis/nettrine/dbal.svg?style=flat-square)](https://travis-ci.org/nettrine/dbal)
[![Code coverage](https://img.shields.io/coveralls/nettrine/dbal.svg?style=flat-square)](https://coveralls.io/r/nettrine/dbal)
[![Licence](https://img.shields.io/packagist/l/nettrine/dbal.svg?style=flat-square)](https://packagist.org/packages/nettrine/dbal)

[![Downloads this Month](https://img.shields.io/packagist/dm/nettrine/dbal.svg?style=flat-square)](https://packagist.org/packages/nettrine/dbal)
[![Downloads total](https://img.shields.io/packagist/dt/nettrine/dbal.svg?style=flat-square)](https://packagist.org/packages/nettrine/dbal)
[![Latest stable](https://img.shields.io/packagist/v/nettrine/dbal.svg?style=flat-square)](https://packagist.org/packages/nettrine/dbal)
[![Latest unstable](https://img.shields.io/packagist/vpre/nettrine/dbal.svg?style=flat-square)](https://packagist.org/packages/nettrine/dbal)
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat-square)](https://github.com/phpstan/phpstan)

## Discussion / Help

Expand All @@ -27,7 +26,7 @@ composer require nettrine/dbal

| State | Version | Branch | PHP |
|-------------|-------------|----------|----------|
| development | dev-master | `master` | `>= 7.1` |
| development | `^0.3` | `master` | `>= 7.1` |
| stable | `^0.2` | `master` | `>= 7.1` |

## Overview
Expand Down Expand Up @@ -59,7 +58,7 @@ composer require nettrine/dbal
<a href="https://github.com/benijo">Josef Benjač</a>
</td>
</tr>
<tbody>
</tbody>
</table>

---
Expand Down
21 changes: 9 additions & 12 deletions composer.json
Expand Up @@ -7,9 +7,7 @@
"dbal"
],
"type": "library",
"license": [
"MIT"
],
"license": "MIT",
"homepage": "https://github.com/nettrine/dbal",
"authors": [
{
Expand All @@ -27,7 +25,11 @@
"phpunit/phpunit": "^7.2.6",
"mockery/mockery": "^1.1.0",
"contributte/console": "^0.5.0",
"tracy/tracy": "~2.5.0"
"tracy/tracy": "~2.5.0",
"phpstan/phpstan-shim": "^0.10.6",
"phpstan/phpstan-deprecation-rules": "^0.10.2",
"phpstan/phpstan-nette": "^0.10.1",
"phpstan/phpstan-strict-rules": "^0.10.1"
},
"autoload": {
"psr-4": {
Expand All @@ -47,19 +49,14 @@
"linter src tests",
"codesniffer src tests"
],
"phpunit": [
"tests": [
"phpunit tests --colors=always"
],
"coverage": [
"phpunit tests --colors=always -c tests/coverage.xml"
],
"phpstan-install": [
"mkdir -p temp/phpstan",
"composer require -d temp/phpstan phpstan/phpstan:0.10",
"composer require -d temp/phpstan phpstan/phpstan-nette:0.10"
"phpdbg -qrr vendor/bin/phpunit tests --colors=always -c tests/coverage.xml"
],
"phpstan": [
"temp/phpstan/vendor/bin/phpstan analyse -l max -c phpstan.neon src"
"vendor/bin/phpstan analyse -l max -c phpstan.neon src"
]
},
"extra": {
Expand Down
13 changes: 8 additions & 5 deletions phpstan.neon
@@ -1,8 +1,11 @@
includes:
- temp/phpstan/vendor/phpstan/phpstan-nette/extension.neon
- temp/phpstan/vendor/phpstan/phpstan-nette/rules.neon
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
- vendor/phpstan/phpstan-nette/extension.neon
- vendor/phpstan/phpstan-nette/rules.neon

parameters:
ignoreErrors:
- '#Cannot call method getMessage\(\) on Throwable\|null#'
- '~Parameter \#1 \$function of function call_user_func expects callable, array\<int, object\|string\> given.~'
ignoreErrors:
- '#^Cannot call method getMessage\(\) on Throwable\|null\.$#'
- "#^Parameter \\#1 \\$function of function call_user_func expects callable, array\\(object, 'getSubscribedEvents'\\) given.#"
# No replacement available
- '#^Fetching class constant class of deprecated class Doctrine\\DBAL\\Tools\\Console\\Command\\ImportCommand\.$#'
2 changes: 1 addition & 1 deletion src/ConnectionFactory.php
Expand Up @@ -96,7 +96,7 @@ private function getDatabasePlatform(Connection $connection): AbstractPlatform
} catch (DBALException $driverException) {
if ($driverException instanceof DriverException) {
throw new DBALException(
'An exception occured while establishing a connection to figure out your platform version.' . PHP_EOL .
'An exception occurred while establishing a connection to figure out your platform version.' . PHP_EOL .
'You can circumvent this by setting a \'server_version\' configuration value' . PHP_EOL . PHP_EOL .
'For further information have a look at:' . PHP_EOL .
'https://github.com/doctrine/DoctrineBundle/issues/673',
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/QueryUtils.php
Expand Up @@ -31,7 +31,7 @@ public static function highlight(string $sql): string
}
}, $sql);

return trim($sql);
return trim((string) $sql);
}

}
2 changes: 1 addition & 1 deletion tests/.coveralls.yml
@@ -1,4 +1,4 @@
# for php-coveralls
service_name: travis-ci
coverage_clover: coverage.xml
json_path: coverage.json
json_path: coverage.json
6 changes: 1 addition & 5 deletions tests/.gitignore
@@ -1,10 +1,6 @@
# Folders - recursive
*.expected
*.actual

# Folders
/tmp

# Files
/*.log
/*.html
/*.html

0 comments on commit 36ee64b

Please sign in to comment.