Skip to content

Commit

Permalink
feature: update bundle struture to latest version (#1)
Browse files Browse the repository at this point in the history
update bundle struture to latest version

- run cs:fix
- run phpstan --generate-baseline
- apply Leitfaden
- fix some phpstan issues
- uvm.
  • Loading branch information
lukadschaak authored Jan 2, 2024
1 parent 8f7152d commit 27110f6
Show file tree
Hide file tree
Showing 27 changed files with 1,197 additions and 10 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.{json,yaml,yml}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[*.neon]
indent_style = tab
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github/ export-ignore
/.gitignore export-ignore
/.gitlab-ci.yml export-ignore
/.gitlab-ci/ export-ignore
/.php-cs-fixer.php export-ignore
/bin/ export-ignore
/compose.yaml export-ignore
/docs/ export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon export-ignore
/phpunit.xml.dist export-ignore
/sonar-project.properties export-ignore
/tests/ export-ignore
37 changes: 37 additions & 0 deletions .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Quality Assurance

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

permissions:
contents: read

jobs:
qa:
name: Quality Checks
runs-on: ubuntu-latest

steps:
- name: Git Checkout
uses: actions/checkout@v4

- name: PHP Setup
uses: shivammathur/setup-php@v2
with:
php-version: 8.1

- name: Validate composer.json
run: composer validate --strict

- name: Install dependencies
uses: ramsey/composer-install@v2

- name: Check CS-Fixer
run: composer cs:check

- name: Check PHPStan
run: composer phpstan
42 changes: 42 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

permissions:
contents: read

jobs:
tests:
name: PHPUnit with PHP ${{ matrix.php-version }} ${{ matrix.dependencies }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- php-version: "8.1"
dependencies: "lowest"
- php-version: "8.1"
dependencies: "highest"

steps:
- name: Git Checkout
uses: actions/checkout@v4

- name: PHP Setup
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}

- name: Install dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}

- name: Execute tests
run: composer tests
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Composer
/composer.lock
/vendor/

# Docker Compose
/compose.override.yaml

# PHP-CS-Fixer
/.php-cs-fixer.cache

# PHPUnit
/.phpunit.result.cache
/.phpunit.cache/
/reports/

# Optionally, ignore project files for common IDE
# A better alternative would be to globally ignore configuration files of your preferred IDE (see: https://stackoverflow.com/a/7335487)
#/.idea/
39 changes: 39 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

/*
* This document has been initially generated with
* https://mlocati.github.io/php-cs-fixer-configurator/#version:3.5.0|configurator
* and then adapted to our needs
*/

return (new PhpCsFixer\Config)
->setFinder((new PhpCsFixer\Finder)
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->notPath(['DependencyInjection/Configuration.php', 'app/var'])
)
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,

// declare strict types must be on first line after opening tag
'blank_line_after_opening_tag' => false, // overwrite @Symfony
'linebreak_after_opening_tag' => false, // overwrite @Symfony
'declare_strict_types' => true, // custom

// allow throw's in multiple lines, so message can be a long string
'single_line_throw' => false, // overwrite @Symfony

// we want spaces
'concat_space' => ['spacing' => 'one'], // overwrite @Symfony

// we want to leave the choice to the developer,
// because some people have their own style of naming test methods
'php_unit_method_casing' => false, // overwrite @Symfony

// we want to leave the choice to the developer
'php_unit_test_annotation' => false, // overwrite @Symfony:risky
]);
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## next

- feature: update bundle structure
Loading

0 comments on commit 27110f6

Please sign in to comment.