Skip to content

Commit

Permalink
Merge pull request #15 from shopwareLabs/update-dependencies
Browse files Browse the repository at this point in the history
Update deps and code style make php 8.0 compatible
  • Loading branch information
JanPietrzyk authored Dec 4, 2020
2 parents ffb20f4 + 96f598b commit d7aceda
Show file tree
Hide file tree
Showing 24 changed files with 3,191 additions and 813 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/cs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI-CS

on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "7.4"
coverage: "pcov"
ini-values: "zend.assertions=1"

- name: Prepare project
run: |
composer install
composer bin all install
- name: Check
run: |
bin/php-cs-fixer fix --dry-run
55 changes: 55 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI-Unit

on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- "7.2"
- "7.3"
- "7.4"
- "8.0"

services:
mysql:
image: mysql:5.7
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- "3306:3306"
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: nested_set

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "pcov"
ini-values: "zend.assertions=1"
extensions: mysqli, pdo_mysql

- name: "Update deps for newer php versions"
run: |
composer config platform.php 8.0
composer update --no-interaction --no-progress --no-suggest --prefer-dist
if: "${{ matrix.php-version == '8.0' }}"

- name: Prepare project
run: |
composer install
- name: Check
run: |
DB_HOST=127.0.0.1 bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/.idea
.DS_Store

.phpunit.result.cache
.php_cs.cache
vendor/
bin/
54 changes: 44 additions & 10 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?php

<?php declare(strict_types=1);
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
;
->append([__FILE__]);

return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'@Symfony' => true,

// Fix declare style
Expand All @@ -20,16 +18,17 @@ return PhpCsFixer\Config::create()
'phpdoc_summary' => false,
'increment_style' => false,
'php_unit_fqcn_annotation' => false,
'single_line_throw' => false,

'array_syntax' => [
'syntax' => 'short'
'syntax' => 'short',
],
'class_definition' => [
'single_line' => true
'single_line' => true,
],
'comment_to_phpdoc' => true,
'concat_space' => [
'spacing' => 'one'
'spacing' => 'one',
],
'declare_strict_types' => true,
'dir_constant' => true,
Expand All @@ -41,18 +40,53 @@ return PhpCsFixer\Config::create()
'multiline_whitespace_before_semicolons' => true,
'mb_str_functions' => true,
'ordered_class_elements' => false,
'ordered_imports' => true,
'ordered_imports' => [
'imports_order' => [
'class',
'function',
'const',
],
],
'native_function_invocation' => [
'exclude' => [
'call_user_func_array',
],
],
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => false,
'import_functions' => true,
],
'php_unit_ordered_covers' => true,
'php_unit_namespaced' => true,
'php_unit_construct' => true,
'phpdoc_add_missing_param_annotation' => [
'only_untyped' => true
'only_untyped' => true,
],
'phpdoc_order' => true,
'phpdoc_var_annotation_correct_order' => true,
'strict_comparison' => true,
'strict_param' => true,
'general_phpdoc_annotation_remove' => [
'annotations' => ['inheritdoc'],
],
'class_attributes_separation' => [
'elements' => [
'method',
'property',
],
],
'void_return' => true,
'php_unit_test_case_static_method_calls' => [
'call_type' => 'self',
],
'yoda_style' => [
'equal' => false,
'identical' => false,
'less_and_greater' => false,
],
'nullable_type_declaration_for_default_null_value' => true,
])
->setRiskyAllowed(true)
->setUsingCache(false)
->setUsingCache(true)
->setFinder($finder);
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ If you want to develop locally you may have to configure the database access thr
export DB_USER='foo'
export DB_PASSWORD='bar'
export DB_HOST='baz'
export DB_NAME='dbal_nested_set'

bin/phpunit
```
12 changes: 8 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
}
},
"require": {
"php": "^7.0"
"php": "^7.2|^8.0"
},
"require-dev": {
"phpunit/phpunit": "^6.2",
"doctrine/dbal": "^2.5"
"phpunit/phpunit": "^8.0",
"doctrine/dbal": "^2.5",
"bamarni/composer-bin-plugin": "^1.4"
},
"license": "MIT",
"authors": [
Expand All @@ -28,6 +29,9 @@
],
"minimum-stability": "stable",
"config": {
"bin-dir": "bin"
"bin-dir": "bin",
"platform": {
"php": "7.2"
}
}
}
Loading

0 comments on commit d7aceda

Please sign in to comment.