-
Notifications
You must be signed in to change notification settings - Fork 340
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
base: 3.0
Are you sure you want to change the base?
Conversation
ed2c2e4
to
701584d
Compare
701584d
to
bda28e7
Compare
@@ -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) |
There was a problem hiding this comment.
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.
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'])); | ||
} | ||
|
There was a problem hiding this comment.
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.
bda28e7
to
4cabd35
Compare
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.