-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update bundle structure to latest version (#7)
* chore: update bundle structure to latest version * fix: tests by composer require doctrine/annotations="^1.5" * qa: add phpstan + baseline (temporarily) * qa: remove psalm
- Loading branch information
1 parent
2403e2e
commit b81eaec
Showing
20 changed files
with
382 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
/.* export-ignore | ||
/tests export-ignore | ||
/phpunit.xml.dist export-ignore | ||
/psalm.xml.dist export-ignore | ||
/README.md export-ignore | ||
/.editorconfig export-ignore | ||
/.env 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Quality Assurance | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
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.2 | ||
|
||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
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" | ||
- php-version: "8.2" | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +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', | ||
])) | ||
->setFinder((new PhpCsFixer\Finder) | ||
->in([ | ||
__DIR__ . '/src', | ||
__DIR__ . '/tests', | ||
]) | ||
->notPath(['DependencyInjection/Configuration.php', 'app/var']) | ||
) | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
// See: https://mlocati.github.io/php-cs-fixer-configurator | ||
'@PHP74Migration' => true, | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
'@DoctrineAnnotation' => true, | ||
'@PHPUnit84Migration:risky' => true, | ||
'array_push' => true, | ||
'class_attributes_separation' => ['elements' => ['method' => 'one']], | ||
'class_definition' => ['single_item_single_line' => true], | ||
'combine_consecutive_unsets' => true, | ||
'declare_strict_types' => true, | ||
'echo_tag_syntax' => ['format' => 'long'], | ||
'heredoc_indentation' => ['indentation' => 'same_as_start'], | ||
'heredoc_to_nowdoc' => true, | ||
'linebreak_after_opening_tag' => true, | ||
'mb_str_functions' => true, | ||
'method_chaining_indentation' => true, | ||
'native_constant_invocation' => [ | ||
'fix_built_in' => false, | ||
'include' => [ | ||
'DIRECTORY_SEPARATOR', | ||
'PHP_INT_SIZE', | ||
'PHP_SAPI', | ||
'PHP_VERSION_ID', | ||
], | ||
'scope' => 'namespaced', | ||
'strict' => true, | ||
], | ||
'native_function_invocation' => [ | ||
'include' => [ | ||
'@compiler_optimized', | ||
], | ||
'scope' => 'namespaced', | ||
'strict' => true, | ||
], | ||
'new_with_braces' => false, | ||
'no_extra_blank_lines' => [ | ||
'tokens' => [ | ||
'break', | ||
'continue', | ||
'extra', | ||
'return', | ||
'throw', | ||
'use', | ||
'parenthesis_brace_block', | ||
'square_brace_block', | ||
'curly_brace_block', | ||
], | ||
], | ||
'no_null_property_initialization' => true, | ||
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'remove_inheritdoc' => true], | ||
'no_unreachable_default_argument_value' => true, | ||
'no_useless_else' => true, | ||
'no_useless_return' => true, | ||
'ordered_class_elements' => true, | ||
'ordered_traits' => false, | ||
'php_unit_method_casing' => false, | ||
'php_unit_strict' => false, | ||
'php_unit_test_annotation' => ['style' => 'annotation'], | ||
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], | ||
'php_unit_test_class_requires_covers' => false, | ||
'phpdoc_add_missing_param_annotation' => true, | ||
'phpdoc_order' => true, | ||
'phpdoc_summary' => false, | ||
'return_assignment' => true, | ||
'simple_to_complex_string_variable' => true, | ||
'simplified_if_return' => true, | ||
'single_line_throw' => false, | ||
'strict_comparison' => true, | ||
'strict_param' => true, | ||
'visibility_required' => ['elements' => ['property', 'method', 'const']], | ||
|
||
// 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 | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
exec docker compose run --rm --user "$(id -u):$(id -g)" --no-deps php composer "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
docker compose run --rm --user "$(id -u):$(id -g)" php composer tests | ||
docker compose down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
services: | ||
database: | ||
image: mariadb:10.11.4 | ||
command: [ "mysqld", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci" ] | ||
environment: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: yes | ||
MYSQL_DATABASE: pimcore | ||
MYSQL_PASSWORD: pimcore | ||
MYSQL_USER: pimcore | ||
tmpfs: | ||
- /tmp/ | ||
- /var/lib/mysql/ | ||
healthcheck: | ||
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ] | ||
interval: 5s | ||
timeout: 10s | ||
|
||
php: | ||
image: pimcore/pimcore:php8.2-latest | ||
volumes: | ||
- ./:/var/www/html/ | ||
environment: | ||
MYSQL_SERVER_VERSION: mariadb-10.11.4 | ||
depends_on: | ||
database: | ||
condition: service_healthy |
Oops, something went wrong.