Skip to content

Commit d7aceda

Browse files
authored
Merge pull request #15 from shopwareLabs/update-dependencies
Update deps and code style make php 8.0 compatible
2 parents ffb20f4 + 96f598b commit d7aceda

24 files changed

+3191
-813
lines changed

.github/workflows/cs.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI-CS
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: "Checkout"
15+
uses: "actions/checkout@v2"
16+
17+
- name: "Install PHP"
18+
uses: "shivammathur/setup-php@v2"
19+
with:
20+
php-version: "7.4"
21+
coverage: "pcov"
22+
ini-values: "zend.assertions=1"
23+
24+
- name: Prepare project
25+
run: |
26+
composer install
27+
composer bin all install
28+
29+
- name: Check
30+
run: |
31+
bin/php-cs-fixer fix --dry-run

.github/workflows/phpunit.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI-Unit
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
php-version:
16+
- "7.2"
17+
- "7.3"
18+
- "7.4"
19+
- "8.0"
20+
21+
services:
22+
mysql:
23+
image: mysql:5.7
24+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
25+
ports:
26+
- "3306:3306"
27+
env:
28+
MYSQL_ROOT_PASSWORD: root
29+
MYSQL_DATABASE: nested_set
30+
31+
steps:
32+
- name: "Checkout"
33+
uses: "actions/checkout@v2"
34+
35+
- name: "Install PHP"
36+
uses: "shivammathur/setup-php@v2"
37+
with:
38+
php-version: "${{ matrix.php-version }}"
39+
coverage: "pcov"
40+
ini-values: "zend.assertions=1"
41+
extensions: mysqli, pdo_mysql
42+
43+
- name: "Update deps for newer php versions"
44+
run: |
45+
composer config platform.php 8.0
46+
composer update --no-interaction --no-progress --no-suggest --prefer-dist
47+
if: "${{ matrix.php-version == '8.0' }}"
48+
49+
- name: Prepare project
50+
run: |
51+
composer install
52+
53+
- name: Check
54+
run: |
55+
DB_HOST=127.0.0.1 bin/phpunit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/.idea
22
.DS_Store
33

4+
.phpunit.result.cache
45
.php_cs.cache
56
vendor/
67
bin/

.php_cs

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
<?php
2-
1+
<?php declare(strict_types=1);
32
$finder = PhpCsFixer\Finder::create()
43
->in(__DIR__ . '/src')
54
->in(__DIR__ . '/tests')
6-
;
5+
->append([__FILE__]);
76

87
return PhpCsFixer\Config::create()
98
->setRules([
10-
'@PSR2' => true,
119
'@Symfony' => true,
1210

1311
// Fix declare style
@@ -20,16 +18,17 @@ return PhpCsFixer\Config::create()
2018
'phpdoc_summary' => false,
2119
'increment_style' => false,
2220
'php_unit_fqcn_annotation' => false,
21+
'single_line_throw' => false,
2322

2423
'array_syntax' => [
25-
'syntax' => 'short'
24+
'syntax' => 'short',
2625
],
2726
'class_definition' => [
28-
'single_line' => true
27+
'single_line' => true,
2928
],
3029
'comment_to_phpdoc' => true,
3130
'concat_space' => [
32-
'spacing' => 'one'
31+
'spacing' => 'one',
3332
],
3433
'declare_strict_types' => true,
3534
'dir_constant' => true,
@@ -41,18 +40,53 @@ return PhpCsFixer\Config::create()
4140
'multiline_whitespace_before_semicolons' => true,
4241
'mb_str_functions' => true,
4342
'ordered_class_elements' => false,
44-
'ordered_imports' => true,
43+
'ordered_imports' => [
44+
'imports_order' => [
45+
'class',
46+
'function',
47+
'const',
48+
],
49+
],
50+
'native_function_invocation' => [
51+
'exclude' => [
52+
'call_user_func_array',
53+
],
54+
],
55+
'global_namespace_import' => [
56+
'import_classes' => true,
57+
'import_constants' => false,
58+
'import_functions' => true,
59+
],
4560
'php_unit_ordered_covers' => true,
4661
'php_unit_namespaced' => true,
4762
'php_unit_construct' => true,
4863
'phpdoc_add_missing_param_annotation' => [
49-
'only_untyped' => true
64+
'only_untyped' => true,
5065
],
5166
'phpdoc_order' => true,
5267
'phpdoc_var_annotation_correct_order' => true,
5368
'strict_comparison' => true,
5469
'strict_param' => true,
70+
'general_phpdoc_annotation_remove' => [
71+
'annotations' => ['inheritdoc'],
72+
],
73+
'class_attributes_separation' => [
74+
'elements' => [
75+
'method',
76+
'property',
77+
],
78+
],
79+
'void_return' => true,
80+
'php_unit_test_case_static_method_calls' => [
81+
'call_type' => 'self',
82+
],
83+
'yoda_style' => [
84+
'equal' => false,
85+
'identical' => false,
86+
'less_and_greater' => false,
87+
],
88+
'nullable_type_declaration_for_default_null_value' => true,
5589
])
5690
->setRiskyAllowed(true)
57-
->setUsingCache(false)
91+
->setUsingCache(true)
5892
->setFinder($finder);

.travis.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ If you want to develop locally you may have to configure the database access thr
135135
export DB_USER='foo'
136136
export DB_PASSWORD='bar'
137137
export DB_HOST='baz'
138+
export DB_NAME='dbal_nested_set'
138139

139140
bin/phpunit
140141
```

composer.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
}
1414
},
1515
"require": {
16-
"php": "^7.0"
16+
"php": "^7.2|^8.0"
1717
},
1818
"require-dev": {
19-
"phpunit/phpunit": "^6.2",
20-
"doctrine/dbal": "^2.5"
19+
"phpunit/phpunit": "^8.0",
20+
"doctrine/dbal": "^2.5",
21+
"bamarni/composer-bin-plugin": "^1.4"
2122
},
2223
"license": "MIT",
2324
"authors": [
@@ -28,6 +29,9 @@
2829
],
2930
"minimum-stability": "stable",
3031
"config": {
31-
"bin-dir": "bin"
32+
"bin-dir": "bin",
33+
"platform": {
34+
"php": "7.2"
35+
}
3236
}
3337
}

0 commit comments

Comments
 (0)