Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.4"
- "8.5"

steps:
- name: "Install PHP"
Expand Down
26 changes: 13 additions & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cache: &global_cache

# Build section
Install dependencies and build assets:
image: sumocoders/cli-tools-php84:latest
image: sumocoders/cli-tools-php85:latest
script:
- COMPOSER_MEMORY_LIMIT=-1 composer install --no-scripts --no-progress
- COMPOSER_MEMORY_LIMIT=-1 composer run-script post-autoload-dump
Expand All @@ -35,7 +35,7 @@ Install dependencies and build assets:

# Code Quality section
PHP_CodeSniffer - check code styling:
image: sumocoders/cli-tools-php84:latest
image: sumocoders/cli-tools-php85:latest
script:
- php vendor/bin/phpcs --colors --report-full --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=phpcs-report.json
artifacts:
Expand All @@ -48,7 +48,7 @@ PHP_CodeSniffer - check code styling:
- docker

PHPStan - check for bugs:
image: sumocoders/cli-tools-php84:latest
image: sumocoders/cli-tools-php85:latest
before_script:
- php bin/console cache:warmup --env=dev
script:
Expand All @@ -69,7 +69,7 @@ PHPStan - check for bugs:
- docker

Twig-CS-Fixer - check code styling:
image: sumocoders/cli-tools-php84:latest
image: sumocoders/cli-tools-php85:latest
script:
- php vendor/bin/twig-cs-fixer lint templates/ --report=junit > twigcs-report.xml
after_script:
Expand Down Expand Up @@ -124,7 +124,7 @@ StandardJS - check code styling:

# Dependency Scanning section
NPM packages - check for vulnerabilities:
image: sumocoders/cli-tools-php84:latest
image: sumocoders/cli-tools-php85:latest
script:
- php bin/console importmap:audit --no-interaction --ansi
stage: dependency scanning
Expand All @@ -134,7 +134,7 @@ NPM packages - check for vulnerabilities:
allow_failure: true

PHP packages - composer audit:
image: sumocoders/cli-tools-php84:latest
image: sumocoders/cli-tools-php85:latest
script:
- composer audit --ansi --no-interaction
stage: dependency scanning
Expand All @@ -146,7 +146,7 @@ PHP packages - composer audit:

# Outdated packages Scanning section
NPM packages - check for outdated packages:
image: sumocoders/cli-tools-php84:latest
image: sumocoders/cli-tools-php85:latest
script:
- php bin/console importmap:outdated --no-interaction --ansi
stage: outdated packages
Expand All @@ -156,7 +156,7 @@ NPM packages - check for outdated packages:
allow_failure: true

PHP packages - composer outdated:
image: sumocoders/cli-tools-php84:latest
image: sumocoders/cli-tools-php85:latest
script:
- composer outdated --ansi --no-interaction --strict
stage: outdated packages
Expand All @@ -168,7 +168,7 @@ PHP packages - composer outdated:

# Test section
PHPUnit - Run tests:
image: sumocoders/framework-php84:latest
image: sumocoders/framework-php85:latest
services:
- mysql:8.0
before_script:
Expand Down Expand Up @@ -203,7 +203,7 @@ PHPUnit - Run tests:

# Scheduled tasks section
Task - Update dependencies:
image: sumocoders/cli-tools-php84:latest
image: sumocoders/cli-tools-php85:latest
script:
- git config --global user.email "bot@sumocoders.be"
- git config --global user.name "Sumo Bot"
Expand All @@ -220,7 +220,7 @@ Task - Update dependencies:

# Deploy section
Deploy - to staging:
image: sumocoders/cli-tools-php84:latest
image: sumocoders/cli-tools-php85: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 @@ -234,7 +234,7 @@ Deploy - to staging:
- php vendor/bin/dep deploy stage=staging
environment:
name: staging
url: https://$project.$client.php84.sumocoders.eu
url: https://$project.$client.php85.sumocoders.eu
only:
- staging
stage: deploy
Expand All @@ -244,7 +244,7 @@ Deploy - to staging:
USER: "CI/CD gitlab-runner"

Deploy - to production:
image: sumocoders/cli-tools-php84:latest
image: sumocoders/cli-tools-php85: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 Down
2 changes: 1 addition & 1 deletion .php-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.4
8.5
38 changes: 19 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "project",
"license": "proprietary",
"require": {
"php": "^8.4",
"php": "^8.5",
"ext-ctype": "*",
"ext-iconv": "*",
"ext-sodium": "*",
Expand All @@ -13,44 +13,44 @@
"beberlei/doctrineextensions": "^1.5",
"doctrine/doctrine-migrations-bundle": "^3.3",
"sentry/sentry-symfony": "^5.1",
"sumocoders/framework-core-bundle": "^16.0",
"sumocoders/framework-core-bundle": "^17.0",
"symfony/apache-pack": "^1.0.1",
"symfony/asset-mapper": "^7.3",
"symfony/debug-bundle": "^7.3",
"symfony/dotenv": "^7.3",
"symfony/expression-language": "^7.3",
"symfony/asset-mapper": "^8.0",
"symfony/debug-bundle": "^8.0",
"symfony/dotenv": "^8.0",
"symfony/expression-language": "^8.0",
"symfony/flex": "^2.4",
"symfony/http-client": "^7.3",
"symfony/mailer": "^7.3",
"symfony/messenger": "^7.3",
"symfony/http-client": "^8.0",
"symfony/mailer": "^8.0",
"symfony/messenger": "^8.0",
"symfony/monolog-bundle": "^3.10",
"symfony/rate-limiter": "^7.3",
"symfony/runtime": "^7.3",
"symfony/security-bundle": "^7.3",
"symfony/rate-limiter": "^8.0",
"symfony/runtime": "^8.0",
"symfony/security-bundle": "^8.0",
"symfony/stimulus-bundle": "^2.22",
"symfony/ux-turbo": "^2.22",
"symfony/validator": "^7.3",
"symfony/web-profiler-bundle": "^7.3",
"symfony/yaml": "^7.3",
"symfony/validator": "^8.0",
"symfony/web-profiler-bundle": "^8.0",
"symfony/yaml": "^8.0",
"symfonycasts/sass-bundle": "^0.8",
"twbs/bootstrap": "^5.3",
"twbs/bootstrap-icons": "^1.13",
"nelmio/security-bundle": "^3.5"
"nelmio/security-bundle": "^3.7"
},
"require-dev": {
},
"flex-require-dev": {
"dama/doctrine-test-bundle": "^8.3",
"doctrine/doctrine-fixtures-bundle": "^3.7",
"doctrine/doctrine-fixtures-bundle": "^4.3",
"micheh/phpcs-gitlab": "^2.0",
"phpstan/phpstan-symfony": "^2.0",
"phpstan/phpstan-doctrine": "^2.0",
"phpunit/phpunit": "^12.2",
"squizlabs/php_codesniffer": "^4.0",
"symfony/debug-pack": "*",
"symfony/maker-bundle": "*",
"symfony/stopwatch": "^7.3",
"tijsverkoyen/deployer-sumo": "^4.1",
"symfony/stopwatch": "^8.0",
"tijsverkoyen/deployer-sumo": "^4.3",
"vincentlanglet/twig-cs-fixer": "*"
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
set('repository', '$repository');
set('production_url', '$productionUrl');
set('production_user', '$productionUser');
set('php_version', '8.4');
set('php_version', '8.5');

// Define staging
host('dev03.sumocoders.eu')
Expand Down
54 changes: 31 additions & 23 deletions src/Skeleton/PostCreateProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,22 +178,21 @@ private static function reconfigureAnnotations(Event $event): void
$projectDir = realpath($event->getComposer()->getConfig()->get('vendor-dir') . '/..');

$io->notice('→ Reconfigure annotations');
$content = file_get_contents($projectDir . '/config/routes.yaml');
$matches = [];
preg_match('|controllers:.*attribute|smU', $content, $matches, PREG_OFFSET_CAPTURE);
$offset = $matches[0][1] + mb_strlen($matches[0][0]);
$insert = [
' prefix: /{_locale}',
' requirements:',
' _locale: \'%locales_regex%\'',
' trailing_slash_on_root: false',
];
$content = self::insertStringAtPosition(
$content,
$offset,
PHP_EOL . implode(PHP_EOL, $insert)
);
file_put_contents($projectDir . '/config/routes.yaml', $content);
$routesFile = $projectDir . '/config/routes.yaml';

$content = implode(PHP_EOL, [
'controllers:',
' resource:',
' path: ../src/Controller/',
' namespace: App\Controller',
' type: attribute',
' prefix: /{_locale}',
' requirements:',
' _locale: \'%locales_regex%\'',
' trailing_slash_on_root: false',
]);

file_put_contents($routesFile, $content);
}

private static function reconfigureRouting(Event $event): void
Expand Down Expand Up @@ -301,13 +300,22 @@ private static function reconfigureValidator(Event $event): void
$projectDir = realpath($event->getComposer()->getConfig()->get('vendor-dir') . '/..');

$io->notice('→ Reconfigure validator');
$content = file_get_contents($projectDir . '/config/packages/validator.yaml');
$content = preg_replace(
'/email_validation_mode: .+/',
'email_validation_mode: strict',
$content
);
file_put_contents($projectDir . '/config/packages/validator.yaml', $content);
$file = $projectDir . '/config/packages/validator.yaml';
$lines = file($file, FILE_IGNORE_NEW_LINES);

$newLines = [];
$added = false;

foreach ($lines as $line) {
$newLines[] = $line;

if (!$added && preg_match('/^\s*validation:/', $line)) {
$newLines[] = ' email_validation_mode: strict';
$added = true;
}
}

file_put_contents($file, implode(PHP_EOL, $newLines));
}

private static function reconfigureMonolog(Event $event): void
Expand Down