Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
25d33b0
Plain package update
johanib Nov 20, 2025
e997288
PHPStan fixes
johanib Nov 20, 2025
88ec4dd
phpstan update & phpstan fixes
johanib Nov 24, 2025
a15da7b
Allow dynamic properties on FooBarCommand
johanib Nov 24, 2025
1b2cb57
Add rector & apply basic rules
johanib Nov 24, 2025
788892d
Clean & enforce clean imports
johanib Nov 24, 2025
0e8cef3
Fix deprecation: use getStringTypeDeclarationSQL instead of getVarcha…
johanib Nov 24, 2025
74e1cf5
Upgrade to PHPUnit 10 (for attribute support) & transition from annot…
johanib Nov 24, 2025
0cd1223
Also apply the phpcs rules to tests, mainly for import management rea…
johanib Nov 24, 2025
e2558f9
Don't recast variables that are already in the correc type.
johanib Nov 24, 2025
7ca65c0
Remove deprecated setAccessible. This is no longer needed, everything…
johanib Nov 24, 2025
7756b82
Rector: FunctionLikeToFirstClassCallableRector, ClosureToArrowFunctio…
johanib Nov 24, 2025
29230b6
Remove doctrine/annotations
johanib Nov 25, 2025
80fdf17
Fix Abstract test
johanib Nov 25, 2025
91037ce
Update dev packages
johanib Nov 25, 2025
2762ec9
Handle framework deprecations.
johanib Nov 25, 2025
a55f912
Handle twig sandbox deprecation
johanib Nov 25, 2025
94cd381
Disable code coverage to prevent warnings.
johanib Nov 25, 2025
c9e0563
Upgrade Symfony 6.4 > 7.3
johanib Nov 26, 2025
85958d9
Commands & twig functions now use attributes.
johanib Nov 26, 2025
e92e4dd
Require `doctrine/annotations` because `jms/translation-bundle` depen…
johanib Nov 26, 2025
4505834
Prior to this change, the custom console commands would not be availa…
johanib Nov 26, 2025
dec15de
Use attributes for more complicated commands
johanib Nov 27, 2025
6bcf540
Update readme & metadata
johanib Nov 27, 2025
9e2377c
Upgrade Symfony 7.3 > 7.4
johanib Nov 27, 2025
c8d329f
Doctrine: No longer rely on the deprecated `commented` setting in the…
johanib Dec 1, 2025
c31a288
Fix deprecation: Don't rely on db specific varchar size
johanib Dec 1, 2025
5889f27
Fix deprecation: Doctrine safepoints
johanib Dec 1, 2025
1192eea
Fix deprecation: $request->get
johanib Dec 1, 2025
3e2e1e9
AllowDynamicProperties on RegisterSelfAssertedSecondFactorCommand and…
johanib Dec 2, 2025
e10d090
Add changelog
johanib Dec 2, 2025
cab9488
rework
johanib Dec 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ jobs:
run: composer install

- name: Run QA tests
run: composer check
run: composer check-ci
env:
SYMFONY_DEPRECATIONS_HELPER: 999999
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
.github/*.md
/web/bundles/
/web/app_dev.php
/web/app_test.php
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

# 7.0.0 - unreleased
**Notable Changes**
- Upgrade to Symfony 7.4 (from 6.4)
- Upgrade to PHPUnit 10 (from 9.x)
- Upgrade to PHPStan 2.0 (from 1.x)
- Migrate from annotations to attributes (PHP 8 attributes)

**Important for System Administrators**
Ensure the `database_server_version` parameter contains the correct MariaDB version. e.g. `10.6.23-MariaDB`


**Improvements**
- Upgrade all Symfony components to 7.4
- Upgrade Stepup-Bundle to 7.0
- Modernize codebase with PHP 8+ features
- Fix various Symfony and Doctrine deprecations
- Improved code quality with updated tooling

# 6.0.2
- Repair deprovisioning API calls
- Restore deprovisioned user on new login (returing users)
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ This component is part of "Step-up Authentication as-a Service". See [Stepup-Dep

## Requirements

* PHP 5.6+ or PHP7
* PHP 8.2
* [Composer](https://getcomposer.org/)
* A web server (Apache, Nginx)
* MariaDB 10
* MariaDB 10.6
* A working [Gateway](https://github.com/OpenConext/Stepup-Gateway)

## Installation

Clone the repository or download the archive to a directory. Install the dependencies by running `composer install` and fill out the database credentials et cetera.

Make sure to run database migrations using `bin/console middleware:migrations:migrate`.
Copy link
Member

Choose a reason for hiding this comment

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

There was a distinction between the middleware and doctrine migrations. From the top of my head, this had to do with the combined middleware and gateway migrations. At this moment I do not have time to look into this further, but this might be a risky change..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, afaik, middleware:migrations:migrate does not exist, so I assumed it should be stepup.. But that may be wrong. I should look into the migrations, as my dev env does not actually run the migrations, but does end up with a working db ..

Make sure to run database migrations using `bin/console doctrine:migrations:migrate`.

When using 'Stepup-Deploy' the 'deploy' entity manager should be used in order to use the correct credentials e.g. `bin/console middleware:migrations:migrate --em=deploy`
When using 'Stepup-Deploy' the 'deploy' entity manager should be used in order to use the correct credentials e.g. `bin/console doctrine:migrations:migrate --em=deploy`

## Management API

Expand All @@ -31,6 +31,9 @@ Some of the configuration of the components is static (i.e. stored in parametere

## Development Notes

### Technical debt
* https://github.com/broadway/event-store-dbal blocks upgrade to `doctrine/dbal:^4.0`

### Adding new events

Whenever adding a new event, be sure to update `bin/config/events.yml`.
Expand Down
16 changes: 13 additions & 3 deletions ci/qa/phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
</description>

<exclude-pattern>src/*/*Bundle/Resources</exclude-pattern>
<exclude-pattern>src/*/*Bundle/Tests</exclude-pattern>
<exclude-pattern>src/*/Bundle/*Bundle/Resources</exclude-pattern>
<exclude-pattern>src/*/Bundle/*Bundle/Tests</exclude-pattern>
<exclude-pattern>*/Tests/*</exclude-pattern>
<exclude-pattern>*/Migrations/*</exclude-pattern>

<!-- This is the rule we inherit from. If you want to exlude some specific rules, see the docs on how to do that -->
Expand All @@ -21,5 +18,18 @@
<property name="lineLimit" value="120"/>
<property name="absoluteLineLimit" value="150"/>
</properties>
<exclude-pattern>*/Tests/*</exclude-pattern>
</rule>

<rule ref="PSR1.Methods.CamelCapsMethodName">
<exclude-pattern>*/Tests/*</exclude-pattern>
</rule>

<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"/>
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" type="bool" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
</ruleset>
2 changes: 1 addition & 1 deletion ci/qa/phplint.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
path: [./src, ./tests]
jobs: 10
cache: /var/qa/phplint.cache
cache-dir: var/cache/qa/phpla int.cache
extensions:
- php
exclude:
Expand Down
3,028 changes: 1,576 additions & 1,452 deletions ci/qa/phpstan-baseline.neon

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ci/qa/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ includes:
- ../../vendor/phpstan/phpstan-symfony/extension.neon

parameters:
treatPhpDocTypesAsCertain: false
level: 9
paths:
- ../../src
2 changes: 1 addition & 1 deletion ci/qa/phpunit
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ cd $(dirname $0)/../../

# PHPUnit Bridge should always be used in Symfony applications. (https://symfony.com/doc/current/components/phpunit_bridge.html)
# This will create a phpunit executable in /bin/ instead of /vendor/bin/
./vendor/bin/phpunit --configuration=ci/qa/phpunit.xml --coverage-text --stop-on-error $1
./vendor/bin/phpunit --configuration=ci/qa/phpunit.xml --stop-on-error $@
./vendor/bin/phpunit --configuration=ci/qa/phpunit.xml --testsuite=database
19 changes: 8 additions & 11 deletions ci/qa/phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="../../tests/bootstrap.php">
<coverage processUncoveredFiles="true">
<include>
<directory suffix="Test.php">../../src</directory>
</include>
</coverage>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="../../tests/bootstrap.php"
cacheDirectory="../../var/qa/phpunit.cache"
>
<php>
<ini name="error_reporting" value="-1"/>
<ini name="memory_limit" value="256M"/>
<server name="APP_ENV" value="test" force="true"/>
<server name="SHELL_VERBOSITY" value="-1"/>
<server name="KERNEL_CLASS" value="\Surfnet\StepupMiddleware\Kernel"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="999999"/>
<env name="APP_ENV" value="test" force="true"/>
</php>
<testsuites>
Expand All @@ -23,8 +24,4 @@
<directory suffix="Test.php">../../tests/database</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
<listener class="\Mockery\Adapter\Phpunit\TestListener"/>
</listeners>
</phpunit>
29 changes: 29 additions & 0 deletions ci/qa/rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

use Rector\Config\RectorConfig;
use Rector\Php74\Rector\Property\RestoreDefaultNullToNullableTypePropertyRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Php82\Rector\Class_\ReadOnlyClassRector;

return RectorConfig::configure()
->withPaths([
__DIR__ . '/../../config',
__DIR__ . '/../../src',
__DIR__ . '/../../tests',
__DIR__ . '/../../templates',
])
->withPhpSets()
->withAttributesSets(all: true)
->withComposerBased(symfony: true, twig: true, doctrine: true, phpunit: true)
->withTypeCoverageLevel(10)
->withDeadCodeLevel(10)
->withCodeQualityLevel(10)
->withSkip([
ReadOnlyClassRector::class,
ReadOnlyPropertyRector::class,
ClassPropertyAssignToConstructorPromotionRector::class,
RestoreDefaultNullToNullableTypePropertyRector::class,
]);
5 changes: 5 additions & 0 deletions ci/qa/rector.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh

# Ensure we run from project root
cd "$(dirname "$0")/../../" || exit 1
./vendor/bin/rector --config=ci/qa/rector.php "$@"
2 changes: 1 addition & 1 deletion component_info
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PHP_VERSION=82
SYMFONY_VERSION=6
SYMFONY_VERSION=7
Copy link
Member

Choose a reason for hiding this comment

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

Do we require stepup build changes for SYMFONY_VERSION=7?

ENCORE=no
ASSETIC=no
NODE_VERSION=20
Expand Down
72 changes: 40 additions & 32 deletions composer.json
Copy link
Member

Choose a reason for hiding this comment

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

Don't forget to remove the @TODO when upgraded to SF7.4 comment I saw in a previous commit :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

think I removed it..

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"ext-pdo": "*",
"broadway/broadway": "^2.5",
"broadway/event-store-dbal": "^0.6",
"doctrine/annotations": "^2.0.2",
"doctrine/annotations": "^2.0",
"doctrine/doctrine-bundle": "^2.13.2",
"doctrine/doctrine-migrations-bundle": "^3.4.1",
"doctrine/orm": "^3.3.2",
Expand All @@ -35,53 +35,58 @@
"openconext/monitor-bundle": "^4.3.1",
"pagerfanta/pagerfanta": "^4.7.1",
"ramsey/uuid": "^4.7.6",
"surfnet/stepup-bundle": "^6.0.17",
"symfony/asset": "6.4.*",
"symfony/expression-language": "6.4.*",
"surfnet/stepup-bundle": "^7.0",
"symfony/asset": "7.4.*",
"symfony/expression-language": "7.4.*",
"symfony/flex": "^2.4.7",
"symfony/form": "6.4.*",
"symfony/framework-bundle": "6.4.*",
"symfony/intl": "6.4.*",
"symfony/mailer": "6.4.*",
"symfony/form": "7.4.*",
"symfony/framework-bundle": "7.4.*",
"symfony/intl": "7.4.*",
"symfony/mailer": "7.4.*",
"symfony/monolog-bundle": "^3.10",
"symfony/password-hasher": "6.4.*",
"symfony/runtime": "6.4.*",
"symfony/security-bundle": "6.4.*",
"symfony/translation": "6.4.*",
"symfony/twig-bundle": "6.4.*",
"symfony/validator": "6.4.*",
"symfony/password-hasher": "7.4.*",
"symfony/runtime": "7.4.*",
"symfony/security-bundle": "7.4.*",
"symfony/translation": "7.4.*",
"symfony/twig-bundle": "7.4.*",
"symfony/validator": "7.4.*",
"twig/extra-bundle": "^3.20",
"twig/intl-extra": "^3.20",
"twig/twig": "^3.20"
},
"require-dev": {
"doctrine/data-fixtures": "^1.8.1",
"doctrine/doctrine-fixtures-bundle": "^3.7.1",
"liip/test-fixtures-bundle": "^2.9.2",
"doctrine/data-fixtures": "^2.2",
"doctrine/doctrine-fixtures-bundle": "^4.3",
"irstea/phpcpd-shim": "^6.0",
"liip/test-fixtures-bundle": "^3.6",
"malukenho/docheader": "^1.1",
"mockery/mockery": "1.7.x-dev",
"moontoast/math": "^1.2.1",
"overtrue/phplint": ">=9.5.6",
"phpmd/phpmd": "^2.15",
"phpstan/phpstan": "^1.11.x-dev",
"phpstan/phpstan-doctrine": "^1.5.7",
"phpstan/phpstan-mockery": "^1.1.3",
"phpstan/phpstan-symfony": "^1.4.13",
"phpunit/phpunit": "^9.6.22",
"rector/rector": "^1.2.10",
"sebastian/phpcpd": "^6.0.3",
"squizlabs/php_codesniffer": "^3.11.3",
"symfony/browser-kit": "6.4.*",
"symfony/phpunit-bridge": "^6.4.16",
"symfony/stopwatch": "6.4.*",
"symfony/web-profiler-bundle": "6.4.*"
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-doctrine": "^2.0",
"phpstan/phpstan-mockery": "^2.0",
"phpstan/phpstan-symfony": "^2.0",
"phpunit/phpunit": "^10",
"rector/rector": "^2.2",
"slevomat/coding-standard": "^8.25",
"squizlabs/php_codesniffer": "^4",
"symfony/browser-kit": "7.4.*",
"symfony/phpunit-bridge": "7.4.*",
"symfony/stopwatch": "7.4.*",
"symfony/web-profiler-bundle": "7.4.*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"check": [
"@check-ci",
"@rector",
"composer audit"
],
"check-ci": [
"@phplint",
"@phpmd",
"@phpcs",
Expand All @@ -93,11 +98,13 @@
"phplint": "./ci/qa/phplint",
"phpmd": "./ci/qa/phpmd",
"license-headers": "./ci/qa/docheader",
"rector": "./ci/qa/rector.sh --dry-run",
"rector-fix": "./ci/qa/rector.sh",
"phpstan": "./ci/qa/phpstan",
"phpcs": "./ci/qa/phpcs",
"phpcbf": "./ci/qa/phpcbf",
"phpcpd": "./ci/qa/phpcpd",
"phpunit": "./ci/qa/phpunit --",
"phpunit": "./ci/qa/phpunit",

"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
Expand Down Expand Up @@ -128,6 +135,7 @@
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"endroid/installer": false,
"symfony/flex": true,
"symfony/runtime": true
Expand All @@ -144,7 +152,7 @@
},
"symfony": {
"allow-contrib": false,
"require": "6.4.*"
"require": "7.4.*"
},
"runtime": {
"disable_dotenv": true
Expand Down
Loading