Skip to content

Commit c073146

Browse files
Merge pull request #112 from pietereggink/feature/php-constants-in-yaml
Added support for php constants in yaml
2 parents 2065b1f + 894fea6 commit c073146

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"phpunit/phpunit": "~4.0",
2020
"scrutinizer/ocular": "~1.1",
2121
"squizlabs/php_codesniffer": "~2.2",
22-
"symfony/yaml": "~2.5"
22+
"symfony/yaml": "~3.4"
2323
},
2424
"suggest": {
25-
"symfony/yaml": "~2.5"
25+
"symfony/yaml": "~3.4"
2626
},
2727
"autoload": {
2828
"psr-4": {

src/FileParser/Yaml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Yaml implements FileParserInterface
2626
public function parse($path)
2727
{
2828
try {
29-
$data = YamlParser::parse(file_get_contents($path));
29+
$data = YamlParser::parse(file_get_contents($path), YamlParser::PARSE_CONSTANT);
3030
} catch (Exception $exception) {
3131
throw new ParseException(
3232
array(

tests/mocks/fail/error.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/as/d
2-
3-
4-
cz
5-
6-
<asd>
7-
</qwe>
1+
---
2+
-
3+
---

0 commit comments

Comments
 (0)