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 d8797c4

Browse filesBrowse files
committed
minor #32761 [Yaml] add some missing type declarations (xabbuh)
This PR was merged into the 5.0-dev branch. Discussion ---------- [Yaml] add some missing type declarations | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- f2a4a19 add some missing type declarations
2 parents 1cc7067 + f2a4a19 commit d8797c4
Copy full SHA for d8797c4

File tree

Expand file treeCollapse file tree

2 files changed

+5
-16
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-16
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Exception/ParseException.php
+3-9Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,8 @@ public function getSnippet()
5454

5555
/**
5656
* Sets the snippet of code near the error.
57-
*
58-
* @param string $snippet The code snippet
5957
*/
60-
public function setSnippet($snippet)
58+
public function setSnippet(string $snippet)
6159
{
6260
$this->snippet = $snippet;
6361

@@ -78,10 +76,8 @@ public function getParsedFile()
7876

7977
/**
8078
* Sets the filename where the error occurred.
81-
*
82-
* @param string $parsedFile The filename
8379
*/
84-
public function setParsedFile($parsedFile)
80+
public function setParsedFile(string $parsedFile)
8581
{
8682
$this->parsedFile = $parsedFile;
8783

@@ -100,10 +96,8 @@ public function getParsedLine()
10096

10197
/**
10298
* Sets the line where the error occurred.
103-
*
104-
* @param int $parsedLine The file line
10599
*/
106-
public function setParsedLine($parsedLine)
100+
public function setParsedLine(int $parsedLine)
107101
{
108102
$this->parsedLine = $parsedLine;
109103

‎src/Symfony/Component/Yaml/Inline.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Inline.php
+2-7Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.