You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was merged into the 4.0-dev branch.
Discussion
----------
Add scalar typehints/return types
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no (final, already breaks if doc not respected)
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | symfony/symfony#23242 (comment)
| License | MIT
| Doc PR | n/a
Commits
-------
7b1715b078 [Yaml] use scalar type hints where possible
6ce70e4bf9 Add scalar typehints/return types on final/internal/private code
if (!$errorinstanceof \Throwable && !$errorinstanceof \Exception) {
54
-
thrownewInvalidArgumentException(sprintf('The error passed to ConsoleErrorEvent must be an instance of \Throwable or \Exception, "%s" was passed instead.', is_object($error) ? get_class($error) : gettype($error)));
55
-
}
56
-
57
42
$this->error = $error;
58
43
}
59
44
60
-
/**
61
-
* Sets the exit code.
62
-
*
63
-
* @param int $exitCode The command exit code
64
-
*/
65
-
publicfunctionsetExitCode($exitCode)
45
+
publicfunctionsetExitCode(int$exitCode): void
66
46
{
67
-
$this->exitCode = (int) $exitCode;
47
+
$this->exitCode = $exitCode;
68
48
69
49
$r = new \ReflectionProperty($this->error, 'code');
0 commit comments