Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b2c916f

Browse filesBrowse files
committed
Add more scalar typehints/return types on final classes
1 parent 115928f commit b2c916f
Copy full SHA for b2c916f

File tree

4 files changed

+6
-14
lines changed
Filter options

4 files changed

+6
-14
lines changed

‎src/Symfony/Component/Console/Event/ConsoleErrorEvent.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Event/ConsoleErrorEvent.php
+1-6Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Console\Event;
1313

1414
use Symfony\Component\Console\Command\Command;
15-
use Symfony\Component\Console\Exception\InvalidArgumentException;
1615
use Symfony\Component\Console\Input\InputInterface;
1716
use Symfony\Component\Console\Output\OutputInterface;
1817

@@ -48,12 +47,8 @@ public function getError()
4847
*
4948
* @param \Throwable $error
5049
*/
51-
public function setError($error)
50+
public function setError(\Throwable $error)
5251
{
53-
if (!$error instanceof \Throwable && !$error instanceof \Exception) {
54-
throw new InvalidArgumentException(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-
5752
$this->error = $error;
5853
}
5954

‎src/Symfony/Component/Validator/Validation.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Validation.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class Validation
2828
*
2929
* @return ValidatorInterface The new validator
3030
*/
31-
public static function createValidator()
31+
public static function createValidator(): ValidatorInterface
3232
{
3333
return self::createValidatorBuilder()->getValidator();
3434
}
@@ -38,7 +38,7 @@ public static function createValidator()
3838
*
3939
* @return ValidatorBuilderInterface The new builder
4040
*/
41-
public static function createValidatorBuilder()
41+
public static function createValidatorBuilder(): ValidatorBuilder
4242
{
4343
return new ValidatorBuilder();
4444
}

‎src/Symfony/Component/WebLink/HttpHeaderSerializer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/WebLink/HttpHeaderSerializer.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class HttpHeaderSerializer
2929
*
3030
* @return string|null
3131
*/
32-
public function serialize($links)
32+
public function serialize(iterable $links)
3333
{
3434
$elements = array();
3535
foreach ($links as $link) {

‎src/Symfony/Component/Yaml/Tag/TaggedValue.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Tag/TaggedValue.php
+2-5Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,13 @@ final class TaggedValue
2424
* @param string $tag
2525
* @param mixed $value
2626
*/
27-
public function __construct($tag, $value)
27+
public function __construct(string $tag, $value)
2828
{
2929
$this->tag = $tag;
3030
$this->value = $value;
3131
}
3232

33-
/**
34-
* @return string
35-
*/
36-
public function getTag()
33+
public function getTag(): string
3734
{
3835
return $this->tag;
3936
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.