Skip to content

Conversation

@johanib
Copy link
Contributor

@johanib johanib commented Jan 8, 2026

After merging, also merge:
OpenConext/OpenConext-devconf#72

Prior to this change, clearing the cache required the manual correction of the var/log and var/cache dirs to be owned by 33/www-data.

This change corrects this on frontend-install automatically.
- fix phplint cache dir
- make phpunit fail in dev on any deprecation warning
- update phpstan baseline after update
The button group does not have data to map so needs mapped > false.
And no data to inherit as wel. Symfony became more strict.
RecastingRemovalRector
RemoveUselessParamTagRector
RemoveUselessReturnTagRector
@johanib johanib marked this pull request as ready for review January 15, 2026 14:05
@johanib johanib requested a review from MKodde January 15, 2026 14:05
Copy link
Member

@MKodde MKodde left a comment

Choose a reason for hiding this comment

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

I do not see any definitive requests for changes. Although some of my feedback might require some minor rework. See what clicks with you and feel free to discuss.

rules:

parameters:
treatPhpDocTypesAsCertain: false
Copy link
Member

Choose a reason for hiding this comment

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

Should we add this for the other StepUp projects? Or maybe ensure we do not need it here? The other projects do not seem to have this setting? I'm not rejecting the PR because of this, just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initially, I thought this created a lot of issues. But 4, with 1 being fixable.
So removed it for now. We don't usually have this.


use DateTime as CoreDateTime;

class DateTime
Copy link
Member

Choose a reason for hiding this comment

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

Is this class used anywhere? I could not find any usages myself. The Surfnet\StepupRa\RaBundle\Value\DateTime seems to be used instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👀 good spot. It is unused.

public static function now(): DateTime
{
return self::$now ?: new self(new CoreDateTime);
return self::$now ?? new self(new CoreDateTime);
Copy link
Member

Choose a reason for hiding this comment

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

Does this change cause the addition of the phpstan-ignore-next-line property.unusedType ? This feels like a low gain optimization.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the ignore is needed because this is how $now is used:

        $nowProperty = new ReflectionProperty(DateTime::class, 'now');
        $nowProperty->setValue(null, $now);

I thought ?? was because of phpstan, but it is not, so reverted to ?:

* between a closing angle bracket and an opening angle bracket ("> <" => "><"). Whitespace inside
* tags or textual content is preserved.
*/
class Spaceless
Copy link
Member

Choose a reason for hiding this comment

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

1: I'd expect the introduction of this replacement feature to be in a commit of it's own. But OK to keep it like this..
2: Have you tried to use the 'replacement' feature that was introduced?

See: https://twig.symfony.com/doc/3.x/templates.html#whitespace-control

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know the exact reason why the spaceless is used here. I cannot confidently determine if the whitespace control does the exact same. It seems more targeted towards specific expressions. So I opted for this to be 100% backwards compatible.

New code should use the whitespace control.

Comment on lines +81 to +82
$command->orderBy = $request->query->get('orderBy');
$command->orderDirection = $request->query->get('orderDirection');
Copy link
Member

Choose a reason for hiding this comment

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

Why not use the trait here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This targeted way is still preferred imo. The trait is because the GET + POST + default lines got too long and messy.. This only does GET + default


use Symfony\Component\HttpFoundation\Request;

trait OrderFromRequest
Copy link
Member

@MKodde MKodde Jan 20, 2026

Choose a reason for hiding this comment

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

Maybe create two dedicated methods; one to get the sort order and one to get the column to sort on? orderBy & orderDirection. That way the trait becomes more focused on this specific purpose. I would be OK with hard coding the name of the request parameter for these methods. They always seem to be: orderDirection and orderBy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

Comment on lines 138 to 139
$command->orderBy = $this->getString($request, 'orderBy');
$command->orderDirection = $this->getString($request, 'orderDirection');
Copy link
Member

Choose a reason for hiding this comment

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

Use OrderFromRequest trait?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it does? ;)

- Drop unused DateTime
- Small refactorings & improvements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants