8000 Make backwards compatibility virtual parameters real by mamazu · Pull Request #7936 · sulu/sulu · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Make backwards compatibility virtual parameters real #7936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 3.0
Choose a base branch
from

Conversation

mamazu
Copy link
Contributor
@mamazu mamazu commented May 2, 2025
Q A
Bug fix? no
New feature? no
BC breaks? yes
Deprecations? no
Fixed tickets -
Related issues/PRs -
License MIT
Documentation PR -

What's in this PR?

Making optional Parameters in 2.6 now required.

Why?

PHPstan does not like when the parameters aren't officially there.

8000
@mamazu mamazu force-pushed the make_parameter_real branch 2 times, most recently from ed2c2e4 to 701584d Compare May 2, 2025 12:42
@alexander-schranz alexander-schranz changed the title Make parameters real again Make backwards cmpatibile virtual parameters real May 2, 2025
@alexander-schranz alexander-schranz changed the title Make backwards cmpatibile virtual parameters real Make backwards compatibility virtual parameters real May 2, 2025
@mamazu mamazu force-pushed the make_parameter_real branch from 701584d to bda28e7 Compare May 2, 2025 13:18
@@ -68,15 +68,8 @@ public function __construct(
$this->logger = $logger ?: new NullLogger();
}

public function returnImage($id, $formatKey, $fileName /*, int<1, max>|null $version = null */)
public function returnImage($id, $formatKey, $fileName, ?int $version)
Copy link
Contributor Author
@mamazu mamazu May 2, 2025

Choose a reason for hiding this comment

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

This parameter should not be nullable, but seeing that this would need a refactor of the FormatManager I've kept it nullable.

For Context: If the version is null then it will return the latest version (which is what we use in the FormatCacheRegenerate) If the version is not set to the current version, then it returns a redirect (very coupled with http). So maybe this method should be split up.

Comment on lines -26 to -35
public function testConvert(): void
{
$tagManager = $this->prophesize(TagManager::class);
$tagsConverter = new TagsConverter($tagManager->reveal());

$tagManager->resolveTagNames(['Tag1', 'Tag2', 'Tag3'])->willReturn([1, 2, 3]);

$this->assertEquals([1, 2, 3], $tagsConverter->convert(['Tag1', 'Tag2', 'Tag3']));
}

Copy link
Contributor Author
@mamazu mamazu May 2, 2025

Choose a reason for hiding this comment

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

This behaviour has been removed. Since we always have to pass 2 parameters to the function and then the output has a completely different shape.

@mamazu mamazu force-pushed the make_parameter_real branch from bda28e7 to 4cabd35 Compare May 2, 2025 13:27
@mamazu mamazu marked this pull request as ready for review May 2, 2025 13:29
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.

1 participant
0