Skip to content

Commit

Permalink
Do not use an optional parameter in LintMessage's constructor (#97)
Browse files Browse the repository at this point in the history
* Do not use an optional parameter in LintMessage's constructor

Using optional parameters before required parameters is deprecated since PHP 8.0 -- https://www.php.net/manual/en/migration80.deprecated.php

Removing the default value has no effect.

* Update the parameter type for `$file`

It might also be `null`
  • Loading branch information
xknown authored Sep 29, 2023
1 parent 9fc94ed commit 80840f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PhpcsChanged/LintMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class LintMessage {
private $type;
private $otherProperties;

public function __construct(int $line, string $file = null, string $type, array $otherProperties) {
public function __construct(int $line, ?string $file, string $type, array $otherProperties) {
$this->line = $line;
$this->file = $file;
$this->type = $type;
Expand Down

0 comments on commit 80840f6

Please sign in to comment.