Skip to content

Commit

Permalink
Updated dependencies & tools
Browse files Browse the repository at this point in the history
  • Loading branch information
Norbert Orzechowicz committed Mar 28, 2023
1 parent efc94c0 commit babb445
Show file tree
Hide file tree
Showing 14 changed files with 3,956 additions and 1,023 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/composer.lock export-ignore
/.github/ export-ignore
/.phive/ export-ignore
/tools/ export-ignore
/spec export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Dependabot - Auto Merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
3 changes: 0 additions & 3 deletions .github/workflows/static-analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
ini-values: memory_limit=-1
tools: phive, composer:v2

- name: "Install tools"
run: "phive install --trust-gpg-keys E82B2FB314E9906E"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ jobs:
ini-values: memory_limit=-1
tools: phive, composer:v2

- name: "Install tools"
run: "phive install --trust-gpg-keys E82B2FB314E9906E"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
vendor/
bin/
tools/
var/
.DS_Store
.idea
4 changes: 0 additions & 4 deletions .phive/phars.xml

This file was deleted.

31 changes: 15 additions & 16 deletions .php_cs → .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@
->in([
__DIR__ . '/src',
__DIR__ . '/tests'
])
->notName('*.phpt');
]);

if (!\file_exists(__DIR__ . '/var')) {
\mkdir(__DIR__ . '/var');
}

/**
* This configuration was taken from https://github.com/sebastianbergmann/phpunit/blob/master/.php_cs.dist
* and slightly adjusted.
*/
return PhpCsFixer\Config::create()
if (!\file_exists(__DIR__ . '/var/cs-fixer')) {
\mkdir(__DIR__ . '/var/cs-fixer');
}

return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setCacheFile(__DIR__.'/var/.php_cs.cache')
->setCacheFile(__DIR__.'/var/cs-fixer/php_cs.cache')
->setRules([
'align_multiline_comment' => true,
'array_indentation' => true,
Expand All @@ -30,7 +29,6 @@
'continue',
'declare',
'default',
'die',
'do',
'exit',
'for',
Expand All @@ -50,7 +48,7 @@
],
'braces' => true,
'cast_spaces' => true,
'class_attributes_separation' => ['elements' => ['const', 'method', 'property']],
'class_attributes_separation' => ['elements' => ['const' => 'one', 'method' => 'one', 'property' => 'one']],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
Expand Down Expand Up @@ -85,13 +83,13 @@
'lowercase_static_reference' => true,
'magic_constant_casing' => true,
'magic_method_casing' => true,
'method_argument_space' => ['ensure_fully_multiline' => true],
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
'modernize_types_casting' => false,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => true,
'native_constant_invocation' => false,
'native_function_casing' => false,
'native_function_invocation' => true,
'native_function_invocation' => ['include' => ['@all']],
'native_function_type_declaration_casing' => true,
'new_with_braces' => false,
'no_alias_functions' => true,
Expand All @@ -112,7 +110,7 @@
'no_null_property_initialization' => true,
'no_php4_constructor' => true,
'no_short_bool_cast' => true,
'no_short_echo_tag' => true,
'echo_tag_syntax' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => true,
Expand Down Expand Up @@ -159,6 +157,7 @@
'method_protected_static',
'method_private_static',
],
'sort_algorithm' => 'alpha'
],
'ordered_imports' => [
'imports_order' => [
Expand Down Expand Up @@ -192,7 +191,7 @@
'phpdoc_var_without_name' => true,
'pow_to_exponentiation' => true,
'protected_to_private' => true,
'return_assignment' => true,
'return_assignment' => false,
'return_type_declaration' => ['space_before' => 'one'],
'self_accessor' => true,
'self_static_accessor' => true,
Expand All @@ -208,7 +207,7 @@
'standardize_not_equals' => true,
'strict_param' => true,
'ternary_to_null_coalescing' => true,
'trailing_comma_in_multiline_array' => true,
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => [
Expand All @@ -221,4 +220,4 @@
'void_return' => true,
'whitespace_after_comma_in_array' => true,
])
->setFinder($finder);
->setFinder($finder);
18 changes: 12 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
"require": {
"php": ">=7.2"
},
"require-dev": {
"phpunit/phpunit": "^8.5|^9.5"
},
"autoload": {
"psr-4": {
"Coduo\\ToString\\" : "src/Coduo/ToString"
Expand All @@ -39,13 +36,22 @@
"@test"
],
"cs:php:fix": [
"tools/php-cs-fixer fix --using-cache=no"
"tools/vendor/bin/php-cs-fixer fix --using-cache=no"
],
"test" : [
"phpunit"
"tools/vendor/bin/phpunit"
],
"static:analyze": [
"tools/php-cs-fixer fix --dry-run"
"tools/vendor/bin/php-cs-fixer fix --dry-run"
],
"post-install-cmd": [
"@tools:install"
],
"post-update-cmd": [
"@tools:install"
],
"tools:install": [
"composer install --working-dir=./tools"
]
}
}

0 comments on commit babb445

Please sign in to comment.