Skip to content

Commit babb445

Browse files
author
Norbert Orzechowicz
committed
Updated dependencies & tools
1 parent efc94c0 commit babb445

File tree

14 files changed

+3956
-1023
lines changed

14 files changed

+3956
-1023
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/composer.lock export-ignore
44
/.github/ export-ignore
55
/.phive/ export-ignore
6+
/tools/ export-ignore
67
/spec export-ignore
78
/.gitattributes export-ignore
89
/.gitignore export-ignore
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Dependabot - Auto Merge
2+
on: pull_request
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
if: ${{ github.actor == 'dependabot[bot]' }}
12+
steps:
13+
- name: Dependabot metadata
14+
id: metadata
15+
uses: dependabot/fetch-metadata@v1
16+
with:
17+
github-token: "${{ secrets.GITHUB_TOKEN }}"
18+
- name: Enable auto-merge for Dependabot PRs
19+
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
20+
run: gh pr merge --auto --merge "$PR_URL"
21+
env:
22+
PR_URL: ${{github.event.pull_request.html_url}}
23+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/static-analyze.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ jobs:
3535
ini-values: memory_limit=-1
3636
tools: phive, composer:v2
3737

38-
- name: "Install tools"
39-
run: "phive install --trust-gpg-keys E82B2FB314E9906E"
40-
4138
- name: "Install lowest dependencies"
4239
if: ${{ matrix.dependencies == 'lowest' }}
4340
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"

.github/workflows/testsuite.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ jobs:
4040
ini-values: memory_limit=-1
4141
tools: phive, composer:v2
4242

43-
- name: "Install tools"
44-
run: "phive install --trust-gpg-keys E82B2FB314E9906E"
45-
4643
- name: "Install lowest dependencies"
4744
if: ${{ matrix.dependencies == 'lowest' }}
4845
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
vendor/
22
bin/
3-
tools/
43
var/
54
.DS_Store
65
.idea

.phive/phars.xml

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

.php_cs renamed to .php-cs-fixer.php

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,19 @@
55
->in([
66
__DIR__ . '/src',
77
__DIR__ . '/tests'
8-
])
9-
->notName('*.phpt');
8+
]);
109

1110
if (!\file_exists(__DIR__ . '/var')) {
1211
\mkdir(__DIR__ . '/var');
1312
}
1413

15-
/**
16-
* This configuration was taken from https://github.com/sebastianbergmann/phpunit/blob/master/.php_cs.dist
17-
* and slightly adjusted.
18-
*/
19-
return PhpCsFixer\Config::create()
14+
if (!\file_exists(__DIR__ . '/var/cs-fixer')) {
15+
\mkdir(__DIR__ . '/var/cs-fixer');
16+
}
17+
18+
return (new PhpCsFixer\Config())
2019
->setRiskyAllowed(true)
21-
->setCacheFile(__DIR__.'/var/.php_cs.cache')
20+
->setCacheFile(__DIR__.'/var/cs-fixer/php_cs.cache')
2221
->setRules([
2322
'align_multiline_comment' => true,
2423
'array_indentation' => true,
@@ -30,7 +29,6 @@
3029
'continue',
3130
'declare',
3231
'default',
33-
'die',
3432
'do',
3533
'exit',
3634
'for',
@@ -50,7 +48,7 @@
5048
],
5149
'braces' => true,
5250
'cast_spaces' => true,
53-
'class_attributes_separation' => ['elements' => ['const', 'method', 'property']],
51+
'class_attributes_separation' => ['elements' => ['const' => 'one', 'method' => 'one', 'property' => 'one']],
5452
'combine_consecutive_issets' => true,
5553
'combine_consecutive_unsets' => true,
5654
'compact_nullable_typehint' => true,
@@ -85,13 +83,13 @@
8583
'lowercase_static_reference' => true,
8684
'magic_constant_casing' => true,
8785
'magic_method_casing' => true,
88-
'method_argument_space' => ['ensure_fully_multiline' => true],
86+
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
8987
'modernize_types_casting' => false,
9088
'multiline_comment_opening_closing' => true,
9189
'multiline_whitespace_before_semicolons' => true,
9290
'native_constant_invocation' => false,
9391
'native_function_casing' => false,
94-
'native_function_invocation' => true,
92+
'native_function_invocation' => ['include' => ['@all']],
9593
'native_function_type_declaration_casing' => true,
9694
'new_with_braces' => false,
9795
'no_alias_functions' => true,
@@ -112,7 +110,7 @@
112110
'no_null_property_initialization' => true,
113111
'no_php4_constructor' => true,
114112
'no_short_bool_cast' => true,
115-
'no_short_echo_tag' => true,
113+
'echo_tag_syntax' => true,
116114
'no_singleline_whitespace_before_semicolons' => true,
117115
'no_spaces_after_function_name' => true,
118116
'no_spaces_around_offset' => true,
@@ -159,6 +157,7 @@
159157
'method_protected_static',
160158
'method_private_static',
161159
],
160+
'sort_algorithm' => 'alpha'
162161
],
163162
'ordered_imports' => [
164163
'imports_order' => [
@@ -192,7 +191,7 @@
192191
'phpdoc_var_without_name' => true,
193192
'pow_to_exponentiation' => true,
194193
'protected_to_private' => true,
195-
'return_assignment' => true,
194+
'return_assignment' => false,
196195
'return_type_declaration' => ['space_before' => 'one'],
197196
'self_accessor' => true,
198197
'self_static_accessor' => true,
@@ -208,7 +207,7 @@
208207
'standardize_not_equals' => true,
209208
'strict_param' => true,
210209
'ternary_to_null_coalescing' => true,
211-
'trailing_comma_in_multiline_array' => true,
210+
'trailing_comma_in_multiline' => true,
212211
'trim_array_spaces' => true,
213212
'unary_operator_spaces' => true,
214213
'visibility_required' => [
@@ -221,4 +220,4 @@
221220
'void_return' => true,
222221
'whitespace_after_comma_in_array' => true,
223222
])
224-
->setFinder($finder);
223+
->setFinder($finder);

composer.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
"require": {
1818
"php": ">=7.2"
1919
},
20-
"require-dev": {
21-
"phpunit/phpunit": "^8.5|^9.5"
22-
},
2320
"autoload": {
2421
"psr-4": {
2522
"Coduo\\ToString\\" : "src/Coduo/ToString"
@@ -39,13 +36,22 @@
3936
"@test"
4037
],
4138
"cs:php:fix": [
42-
"tools/php-cs-fixer fix --using-cache=no"
39+
"tools/vendor/bin/php-cs-fixer fix --using-cache=no"
4340
],
4441
"test" : [
45-
"phpunit"
42+
"tools/vendor/bin/phpunit"
4643
],
4744
"static:analyze": [
48-
"tools/php-cs-fixer fix --dry-run"
45+
"tools/vendor/bin/php-cs-fixer fix --dry-run"
46+
],
47+
"post-install-cmd": [
48+
"@tools:install"
49+
],
50+
"post-update-cmd": [
51+
"@tools:install"
52+
],
53+
"tools:install": [
54+
"composer install --working-dir=./tools"
4955
]
5056
}
5157
}

0 commit comments

Comments
 (0)