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 e176c09

Browse filesBrowse files
committed
[Yaml] Remove internal arguments from the api
1 parent 63b8d31 commit e176c09
Copy full SHA for e176c09

File tree

3 files changed

+26
-11
lines changed
Filter options

3 files changed

+26
-11
lines changed

‎UPGRADE-3.3.md

Copy file name to clipboardExpand all lines: UPGRADE-3.3.md
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,10 @@ Workflow
6565

6666
* Deprecated class name support in `WorkflowRegistry::add()` as second parameter.
6767
Wrap the class name in an instance of ClassInstanceSupportStrategy instead.
68+
69+
Yaml
70+
----
71+
72+
* The constructor arguments `$offset`, `$totalNumberOfLines` and
73+
`$skippedLineNumbers` of the `Parser` class are deprecated and will be
74+
removed in 4.0

‎UPGRADE-4.0.md

Copy file name to clipboardExpand all lines: UPGRADE-4.0.md
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ Yaml
391391

392392
* Duplicate mapping keys lead to a `ParseException`.
393393

394+
* The constructor arguments `$offset`, `$totalNumberOfLines` and
395+
`$skippedLineNumbers` of the `Parser` class were removed.
396+
394397
Ldap
395398
----
396399

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Parser.php
+16-11Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,19 @@ class Parser
3232
private $skippedLineNumbers = array();
3333
private $locallySkippedLineNumbers = array();
3434

35-
/**
36-
* Constructor.
37-
*
38-
* @param int $offset The offset of YAML document (used for line numbers in error messages)
39-
* @param int|null $totalNumberOfLines The overall number of lines being parsed
40-
* @param int[] $skippedLineNumbers Number of comment lines that have been skipped by the parser
41-
*/
4235
public function __construct($offset = 0, $totalNumberOfLines = null, array $skippedLineNumbers = array())
4336
{
44-
$this->offset = $offset;
45-
$this->totalNumberOfLines = $totalNumberOfLines;
46-
$this->skippedLineNumbers = $skippedLineNumbers;
37+
if (func_num_args() > 0) {
38+
@trigger_error(sprintf('The constructor arguments $offset, $totalNumberOfLines, $skippedLineNumbers of %s are deprecated and will be removed in 4.0', self::class), E_USER_DEPRECATED);
39+
40+
$this->offset = func_get_arg(0);
41+
if (func_num_args() > 1) {
42+
$this->totalNumberOfLines = func_get_arg(1);
43+
}
44+
if (func_num_args() > 2) {
45+
$this->skippedLineNumbers = func_get_arg(2);
46+
}
47+
}
4748
}
4849

4950
/**
@@ -384,7 +385,11 @@ private function parseBlock($offset, $yaml, $flags)
384385
$skippedLineNumbers[] = $lineNumber;
385386
}
386387

387-
$parser = new self($offset, $this->totalNumberOfLines, $skippedLineNumbers);
388+
$parser = new self();
389+
$parser->offset = $offset;
390+
$parser->totalNumberOfLines = $this->totalNumberOfLines;
391+
$parser->skippedLineNumbers = $skippedLineNumbers;
392+
388393
$parser->refs = &$this->refs;
389394

390395
return $parser->parse($yaml, $flags);

0 commit comments

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