Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3a1b1da
Bring the example up to date with current application skeleton
tijsverkoyen Jun 13, 2025
6f4379c
Default values for mailer
tijsverkoyen Jun 13, 2025
d01b1f1
Give console command a more logical name
tijsverkoyen Jun 13, 2025
b849e09
Use constructor property promotion
tijsverkoyen Jun 13, 2025
bdfe5fd
Code styling
tijsverkoyen Jun 13, 2025
506b885
Fix PHPStan issues
tijsverkoyen Jun 13, 2025
79c15ed
Use instead of . In prepartion of HandleTrait
tijsverkoyen Jun 13, 2025
91bb92e
Fix stimulus error
tijsverkoyen Jun 13, 2025
f27a833
Redirect to success page
tijsverkoyen Jun 13, 2025
f4fab8c
Add missing translation
tijsverkoyen Jun 13, 2025
6fa0f91
Use decent autocomplete attributes
tijsverkoyen Jun 13, 2025
0794478
Move all #[Route] PHP attributes to class level
tijsverkoyen Jun 19, 2025
e677a2b
Standarised route names
tijsverkoyen Jun 19, 2025
299d35e
Use symfony/test-pack
tijsverkoyen Jun 19, 2025
0de0485
Use public properties instead of getters. Simplifies the code.
tijsverkoyen Jun 19, 2025
d52591b
Code styling
tijsverkoyen Jun 19, 2025
e52f794
Fix typo
tijsverkoyen Jun 19, 2025
5b62984
Simplified PHPDoc for PHPStan
tijsverkoyen Jul 9, 2025
c644f58
Improved (added) tests
tijsverkoyen Jul 10, 2025
9e85bce
Cleanup code
tijsverkoyen Jul 10, 2025
5f6a335
Use dama/doctrine-test-bundle to clear the database for each test
tijsverkoyen Jul 10, 2025
2974909
Test for MessageHandlers
tijsverkoyen Jul 11, 2025
c4085da
Use PHPUnit directly
tijsverkoyen Jul 11, 2025
d1c417d
Update outdated NPM packages
tijsverkoyen Jul 11, 2025
e855c6c
Remove useless fixtyre
tijsverkoyen Jul 14, 2025
26f0427
Remove symfony/simple-phpunit
tijsverkoyen Jul 14, 2025
86cefa5
Fix color attribute for PHPUnit command
tijsverkoyen Jul 14, 2025
b78ba11
Changes from sumocoders/application-skeleton
tijsverkoyen Jul 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# Real environment variables win over .env files.
#
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
# https://symfony.com/doc/current/configuration/secrets.html
#
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
Expand All @@ -26,21 +27,28 @@ APP_SECRET=9947170bb921f0390a44d613fa7a3ce5
DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"
# DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=13&charset=utf8"
###< doctrine/doctrine-bundle ###
###> sumocoders/framework-core-bundle ###
SITE_TITLE="Your application"
DEFAULT_URI="https://www.example.com"
###< sumocoders/framework-core-bundle ###

###> sentry/sentry-symfony ###
SENTRY_DSN=
###< sentry/sentry-symfony ###

###> symfony/mailer ###
MAILER_DSN=null://null
MAILER_DEFAULT_SENDER_NAME="Your application"
MAILER_DEFAULT_SENDER_EMAIL="mailer_default_sender_email_is_misconfigured@tesuta.be"
MAILER_DEFAULT_TO_NAME="Your application"
MAILER_DEFAULT_TO_EMAIL="mailer_default_to_email_is_misconfigured@tesuta.be"
###< symfony/mailer ###

###> symfony/messenger ###
# Choose one of the transports below
# MESSENGER_TRANSPORT_DSN=doctrine://default
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
###< symfony/messenger ###

###> symfony/mailer ###
MAILER_DSN=smtp://localhost
MAILER_DEFAULT_SENDER_NAME=
MAILER_DEFAULT_SENDER_EMAIL=
MAILER_DEFAULT_TO_NAME=
MAILER_DEFAULT_TO_EMAIL=
###< symfony/mailer ###
###> sumocoders/framework-core-bundle ###
SITE_TITLE="Your application"
ENCRYPTION_KEY="8ea13de9680e2a1441774ec26642fa65a56d8099f44a301f219864b51bbaa925"
DEFAULT_URI="/"
###< sumocoders/framework-core-bundle ###
4 changes: 2 additions & 2 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
#DATABASE_URL="sqlite:///%kernel.project_dir%/var/test.db"
DATABASE_URL="sqlite:///:memory:"
DATABASE_URL="mysql://root:root@127.0.0.1:3306/ci?serverVersion=5.7"
MAILER_DSN=null://default
31 changes: 13 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
.phpcs-cache
.phpunit.result.cache

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
Expand All @@ -11,27 +8,25 @@
/vendor/
###< symfony/framework-bundle ###

###> symfony/webpack-encore-bundle ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###
###> phpstan/phpstan ###
phpstan.neon
###< phpstan/phpstan ###

###> phpunit/phpunit ###
/phpunit.xml
/.phpunit.cache/
###< phpunit/phpunit ###

###> squizlabs/php_codesniffer ###
/.phpcs-cache
/phpcs.xml
###< squizlabs/php_codesniffer ###

###> symfony/asset-mapper ###
/public/assets/
/assets/vendor/
###< symfony/asset-mapper ###

###> vincentlanglet/twig-cs-fixer ###
/.twig-cs-fixer.cache
###< vincentlanglet/twig-cs-fixer ###

###> phpstan/phpstan ###
phpstan.neon
###< phpstan/phpstan ###

###> symfony/phpunit-bridge ###
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###
130 changes: 69 additions & 61 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ stages:
- build
- code quality
- dependency scanning
- outdated packages
- test
- deploy

Expand All @@ -17,13 +18,12 @@ cache: &global_cache

# Build section
Install dependencies and build assets:
image: sumocoders/cli-tools-php83:latest
image: sumocoders/cli-tools-php84:latest
script:
- COMPOSER_MEMORY_LIMIT=-1 composer install --no-scripts --no-progress
- COMPOSER_MEMORY_LIMIT=-1 composer run-script post-autoload-dump
- volta install node
- npm ci --no-progress
- node_modules/.bin/encore production
- php bin/console importmap:install --no-interaction
- php bin/console sass:build --no-interaction
- php bin/console fos:js-routing:dump --format=json --locale=nl --target=public/build/routes/fos_js_routes.json
cache:
<<: *global_cache
Expand All @@ -35,154 +35,162 @@ Install dependencies and build assets:

# Code Quality section
PHP_CodeSniffer - check code styling:
image: sumocoders/cli-tools-php83:latest
image: sumocoders/cli-tools-php84:latest
script:
- vendor/bin/phpcs --report-full --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=phpcs-report.xml
- php vendor/bin/phpcs --report-full --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=phpcs-report.json
artifacts:
expire_in: 1 week
reports:
codequality: phpcs-report.xml
codequality: phpcs-report.json
stage: code quality
needs: ["Install dependencies and build assets"]
needs: [ "Install dependencies and build assets" ]
tags:
- docker

PHPStan - check for bugs:
image: sumocoders/cli-tools-php83:latest
image: sumocoders/cli-tools-php84:latest
before_script:
- bin/console cache:warmup --env=dev
- php bin/console cache:warmup --env=dev
script:
- vendor/bin/phpstan analyse --memory-limit=-1 --error-format=gitlab --no-progress --no-interaction > phpstan-report.xml
- php vendor/bin/phpstan analyse --memory-limit=-1 --error-format=gitlab --no-progress --no-interaction > phpstan-report.json
after_script:
# Run it again so the output is visible in the job
- >
if [ $CI_JOB_STATUS != 'success' ]; then
vendor/bin/phpstan analyse --memory-limit=-1 --no-progress
php vendor/bin/phpstan analyse --memory-limit=-1 --no-progress
fi
artifacts:
expire_in: 1 week
reports:
codequality: phpstan-report.xml
codequality: phpstan-report.json
stage: code quality
needs: ["Install dependencies and build assets"]
needs: [ "Install dependencies and build assets" ]
tags:
- docker

Twig-CS-Fixer - check code styling:
image: sumocoders/cli-tools-php83:latest
image: sumocoders/cli-tools-php84:latest
script:
- vendor/bin/twig-cs-fixer lint templates/ --report=junit > twigcs-report.xml
- php vendor/bin/twig-cs-fixer lint templates/ --report=junit > twigcs-report.xml
after_script:
# Run it again so the output is visible in the job
- vendor/bin/twig-cs-fixer lint templates/
- >
if [ $CI_JOB_STATUS != 'success' ]; then
php vendor/bin/twig-cs-fixer --no-interaction lint templates/
fi
artifacts:
expire_in: 1 week
reports:
junit: twigcs-report.xml
stage: code quality
needs: ["Install dependencies and build assets"]
needs: [ "Install dependencies and build assets" ]
tags:
- docker
allow_failure: true

Stylelint - check code styling:
image: sumocoders/cli-tools-php83:latest
image: sumocoders/stylelint:latest
script:
- node_modules/.bin/stylelint --output-file=stylelint-report.json --custom-formatter=node_modules/stylelint-formatter-gitlab-code-quality-report/index.js .
- stylelint --output-file=stylelint-report.json --custom-formatter=stylelint-formatter-gitlab-code-quality-report .
after_script:
# Run it again so the output is visible in the job
- node_modules/.bin/stylelint --color .
- >
if [ $CI_JOB_STATUS != 'success' ]; then
stylelint --color .
fi
artifacts:
expire_in: 1 week
reports:
codequality: stylelint-report.json
stage: code quality
needs: ["Install dependencies and build assets"]
needs: [ "Install dependencies and build assets" ]
tags:
- docker
allow_failure: true

StandardJS - check code styling:
image: sumocoders/cli-tools-php83:latest
image: sumocoders/standardjs:latest
script:
- node_modules/.bin/standard | node_modules/.bin/standard-gitlab --output-file standardjs-report.json --human-readable
- sh -c 'standard . | standard-gitlab --output-file standardjs-report.json --human-readable'
artifacts:
expire_in: 1 week
reports:
codequality: standardjs-report.json
stage: code quality
needs: ["Install dependencies and build assets"]
needs: [ "Install dependencies and build assets" ]
tags:
- docker
allow_failure: true


# Dependency Scanning section
NPM packages - check for vulnerabilities:
image: sumocoders/cli-tools-php83:latest
image: sumocoders/cli-tools-php84:latest
script:
- npm audit --omit=dev --json | ./node_modules/.bin/gitlab-npm-audit-parser -o npm-audit-report.json
- npm audit --omit=dev
artifacts:
expire_in: 1 week
reports:
dependency_scanning: npm-audit-report.json
- php bin/console importmap:audit --no-interaction --ansi
stage: dependency scanning
needs: ["Install dependencies and build assets"]
needs: [ "Install dependencies and build assets" ]
tags:
- docker
allow_failure: true

PHP packages - local-php-security-checker:
image: sumocoders/cli-tools-php83:latest
before_script:
- PHP_SC_VERSION=$(curl -s "https://api.github.com/repos/fabpot/local-php-security-checker/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/;s/^v//')
- curl -LSs https://github.com/fabpot/local-php-security-checker/releases/download/v${PHP_SC_VERSION}/local-php-security-checker_linux_amd64 > ./local-php-security-checker
- chmod +x ./local-php-security-checker
PHP packages - composer audit:
image: sumocoders/cli-tools-php84:latest
script:
- ./local-php-security-checker --format=ansi
- composer audit --ansi --no-interaction
stage: dependency scanning
needs: ["Install dependencies and build assets"]
needs: [ "Install dependencies and build assets" ]
tags:
- docker
allow_failure: true

PHP packages - composer audit:
image: sumocoders/cli-tools-php83:latest

# Outdated packages Scanning section
NPM packages - check for outdated packages:
image: sumocoders/cli-tools-php84:latest
script:
- composer audit --ansi --no-interaction
stage: dependency scanning
needs: ["Install dependencies and build assets"]
- php bin/console importmap:outdated --no-interaction --ansi
stage: outdated packages
needs: [ "Install dependencies and build assets" ]
tags:
- docker
allow_failure: true

PHP packages - composer outdated:
image: sumocoders/cli-tools-php84:latest
script:
- composer outdated --ansi --no-interaction
stage: outdated packages
needs: [ "Install dependencies and build assets" ]
tags:
- docker
allow_failure: true


# Test section
PHPUnit - Run tests:
image: sumocoders/framework-php83:latest
image: sumocoders/framework-php84:latest
services:
- mysql:5.7
before_script:
# Uncomment this if you need Chrome for PDF's
# or if you have integration tests that use Symfony Panther (https://github.com/symfony/panther)
# # install Chromium
# - apt-get --allow-releaseinfo-change update && apt-get install -y chromium
# # install Chromium Chromedriver
# - |
# curl -s -f -L -o /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE_97`/chromedriver_linux64.zip
# unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/
# Uncomment this if you need Chrome for PDF's
# or if you have integration tests that use Symfony Panther (https://github.com/symfony/panther)
# # install Chromium
# - apt-get --allow-releaseinfo-change update && apt-get install -y chromium
# # install Chromium Chromedriver
# - |
# curl -s -f -L -o /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE_97`/chromedriver_linux64.zip
# unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/
script:
- php bin/console doctrine:migrations:migrate --env=test --no-interaction --allow-no-migration
# Uncomment this if you have fixtures that need to be loaded
# Make sure that you have installed doctrine/doctrine-fixtures-bundle
#- php bin/console doctrine:fixtures:load --env=test
- php vendor/bin/simple-phpunit --log-junit phpunit-report.xml
- php vendor/bin/phpunit --color --testdox --log-junit phpunit-report.xml
artifacts:
reports:
junit: phpunit-report.xml
stage: test
needs: ["Install dependencies and build assets"]
needs: [ "Install dependencies and build assets" ]
tags:
- docker
variables:
Expand All @@ -195,7 +203,7 @@ PHPUnit - Run tests:

# Deploy section
Deploy - to staging:
image: sumocoders/cli-tools-php83:latest
image: sumocoders/cli-tools-php84:latest
before_script:
# Add the private SSH key to the CI environment
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
Expand All @@ -206,10 +214,10 @@ Deploy - to staging:
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- vendor/bin/dep deploy stage=staging
- php vendor/bin/dep deploy stage=staging
environment:
name: staging
url: https://$project.$client.php83.sumocoders.eu
url: https://$project.$client.php84.sumocoders.eu
only:
- staging
stage: deploy
Expand Down
21 changes: 11 additions & 10 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
assets/images/*.svg
assets/images/
assets/vendor/
bin/*
config/*
public/build/*
public/bundles/*
public/files/*
drivers/*
migrations/*
node_modules/*
public/*
src/*
tests/*
translations/*
var/*
vendor/*
**/*.dist
**/*.json
**/*.lock
**/*.yaml
**/*.yml
php.ini
*.*
Copy link

Copilot AI Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The glob pattern '.' may match more files than intended; consider narrowing the pattern to target only non-style files that should be ignored.

Suggested change
*.*
*.js
*.html
*.json
*.txt
*.md

Copilot uses AI. Check for mistakes.
!*.css
!*.scss
Loading