It seems like the GitHub access token used for retrieving details about this repository from
GitHub became invalid. This might prevent certain types of inspections from being run (in
particular,
everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
The call to DataTransferObjectError::__construct() has too many arguments starting with "Public properties `{$pr... found on {$className}".
This check compares calls to functions or methods with their respective definitions.
If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the
check may pick up the wrong definition and report false positives. One codebase
where this has been known to happen is Wordpress.
In this case you can add the @ignorePhpDoc
annotation to the duplicate definition and it will be ignored.
Loading history...
16
}
17
18
public static function invalidTypes(array $invalidTypes): DataTransferObjectError
19
{
20
$msg = count($invalidTypes) > 1
21
? "The following invalid types were encountered:\n" . implode("\n", $invalidTypes) . "\n"
The call to DataTransferObjectError::__construct() has too many arguments starting with $msg.
This check compares calls to functions or methods with their respective definitions.
If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the
check may pick up the wrong definition and report false positives. One codebase
where this has been known to happen is Wordpress.
In this case you can add the @ignorePhpDoc
annotation to the duplicate definition and it will be ignored.
Loading history...
25
}
26
27
public static function invalidTypeMessage(
28
string $class,
29
string $field,
30
array $expectedTypes,
31
$value
32
): string {
33
$currentType = gettype($value);
34
35
if ($value === null) {
36
$value = 'null';
37
}
38
39
if (is_object($value)) {
40
$value = get_class($value);
41
}
42
43
if (is_array($value)) {
44
$value = 'array';
45
}
46
47
$expectedTypes = implode(', ', $expectedTypes);
48
49
if ($value === $currentType) {
50
$instead = "instead got value `{$value}`.";
51
} else {
52
$instead = "instead got value `{$value}`, which is {$currentType}.";
53
}
54
55
return "expected `{$class}::{$field}` to be of type `{$expectedTypes}`, {$instead}";
56
}
57
58
public static function uninitialized(string $class, string $field): DataTransferObjectError
59
{
60
return new self("Non-nullable property `{$class}::{$field}` has not been initialized.");
The call to DataTransferObjectError::__construct() has too many arguments starting with "Non-nullable property `... not been initialized.".
This check compares calls to functions or methods with their respective definitions.
If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the
check may pick up the wrong definition and report false positives. One codebase
where this has been known to happen is Wordpress.
In this case you can add the @ignorePhpDoc
annotation to the duplicate definition and it will be ignored.
Loading history...
61
}
62
63
public static function immutable(string $property): DataTransferObjectError
64
{
65
return new self("Cannot change the value of property {$property} on an immutable data transfer object");
The call to DataTransferObjectError::__construct() has too many arguments starting with "Cannot change the value...e data transfer object".
This check compares calls to functions or methods with their respective definitions.
If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the
check may pick up the wrong definition and report false positives. One codebase
where this has been known to happen is Wordpress.
In this case you can add the @ignorePhpDoc
annotation to the duplicate definition and it will be ignored.
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.