-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Fix warning in PHP 8 about optional parameter before mandatory one #25004
Fix warning in PHP 8 about optional parameter before mandatory one #25004
Conversation
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
@@ -56,7 +56,7 @@ class File extends LogDetails implements IWriter, IFileBased { | |||
/** @var SystemConfig */ | |||
private $config; | |||
|
|||
public function __construct(string $path, string $fallbackPath = '', SystemConfig $config) { | |||
public function __construct(string $path, string $fallbackPath, SystemConfig $config) { |
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.
is it always set?
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.
Yes, otherwise you cannot set the $config
one and therefore PHP would crash initializing this object. I also checked all occurrences of this to be sure xD
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.
Yes:
server/lib/private/Log/LogFactory.php
Line 78 in 2dd04f7
$fallback = $defaultLogFile !== $logFile ? $defaultLogFile : ''; |
@@ -56,7 +56,7 @@ class File extends LogDetails implements IWriter, IFileBased { | |||
/** @var SystemConfig */ | |||
private $config; | |||
|
|||
public function __construct(string $path, string $fallbackPath = '', SystemConfig $config) { | |||
public function __construct(string $path, string $fallbackPath, SystemConfig $config) { |
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.
Yes:
server/lib/private/Log/LogFactory.php
Line 78 in 2dd04f7
$fallback = $defaultLogFile !== $logFile ? $defaultLogFile : ''; |
No description provided.