8000 add some missing type declarations · symfony/symfony@1c287d7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1c287d7

Browse files
committed
add some missing type declarations
1 parent 1cc7067 commit 1c287d7

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

src/Symfony/Component/Yaml/Exception/ParseException.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ public function __construct(string $message, int $parsedLine = -1, string $snipp
4444

4545
/**
4646
* Gets the snippet of code near the error.
47-
*
48-
* @return string The snippet of code
4947
*/
5048
public function getSnippet()
5149
{
@@ -57,7 +55,7 @@ public function getSnippet()
5755
*
5856
* @param string $snippet The code snippet
5957
*/
60-
public function setSnippet($snippet)
58+
public function setSnippet(string $snippet)
6159
{
6260
$this->snippet = $snippet;
6361

@@ -67,8 +65,6 @@ public function setSnippet($snippet)
6765
/**
6866
* Gets the filename where the error occurred.
6967
*
70-
* This method returns null if a string is parsed.
71-
*
7268
* @return string The filename
7369
*/
7470
public function getParsedFile()
@@ -78,10 +74,8 @@ public function getParsedFile()
7874

7975
/**
8076
* Sets the filename where the error occurred.
81-
*
82-
* @param string $parsedFile The filename
8377
*/
84-
public function setParsedFile($parsedFile)
78+
public function setParsedFile(string $parsedFile)
8579
{
8680
$this->parsedFile = $parsedFile;
8781

@@ -100,10 +94,8 @@ public function getParsedLine()
10094

10195
/**
10296
* Sets the line where the error occurred.
103-
*
104-
* @param int $parsedLine The file line
10597
*/
106-
public function setParsedLine($parsedLine)
98+
public function setParsedLine(int $parsedLine)
10799
{
108100
$this->parsedLine = $parsedLine;
109101

src/Symfony/Component/Yaml/Inline.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ class Inline
3434
private static $objectForMap = false;
3535
private static $constantSupport = false;
3636

37-
/**
38-
* @param int $flags
39-
* @param int|null $parsedLineNumber
40-
* @param string|null $parsedFilename
41-
*/
42-
public static function initialize($flags, $parsedLineNumber = null, $parsedFilename = null)
37+
public static function initialize(int $flags, int $parsedLineNumber = null, string $parsedFilename = null)
4338
{
4439
self::$exceptionOnInvalidType = (bool) (Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE & $flags);
4540
self::$objectSupport = (bool) (Yaml::PARSE_OBJECT & $flags);
@@ -704,7 +699,7 @@ public static function evaluateBinaryScalar(string $scalar): string
704699
return base64_decode($parsedBinaryData, true);
705700
}
706701

707-
private static function isBinaryString(string $value)
702+
private static function isBinaryString(string $value): bool
708703
{
709704
return !preg_match('//u', $value) || preg_match('/[^\x00\x07-\x0d\x1B\x20-\xff]/', $value);
710705
}

0 commit comments

Comments
 (0)
0