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 f0d27ae

Browse filesBrowse files
committed
report deprecations when linting YAML files
1 parent 4a5f22b commit f0d27ae
Copy full SHA for f0d27ae

File tree

1 file changed

+8
-0
lines changed
Filter options

1 file changed

+8
-0
lines changed

‎src/Symfony/Component/Yaml/Command/LintCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Command/LintCommand.php
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
102102

103103
private function validate($content, $file = null)
104104
{
105+
set_error_handler(function ($level, $message, $file, $line) {
106+
if (E_USER_DEPRECATED === $level) {
107+
throw new ParseException($message, $line);
108+
}
109+
});
110+
105111
try {
106112
$this->getParser()->parse($content);
107113
} catch (ParseException $e) {
108114
return array('file' => $file, 'valid' => false, 'message' => $e->getMessage());
115+
} finally {
116+
restore_error_handler();
109117
}
110118

111119
return array('file' => $file, 'valid' => true);

0 commit comments

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