Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitf0d27ae

Browse files
committed
report deprecations when linting YAML files
1 parent4a5f22b commitf0d27ae

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines 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
privatefunctionvalidate($content,$file =null)
104104
{
105+
set_error_handler(function ($level,$message,$file,$line) {
106+
if (E_USER_DEPRECATED ===$level) {
107+
thrownewParseException($message,$line);
108+
}
109+
});
110+
105111
try {
106112
$this->getParser()->parse($content);
107113
}catch (ParseException$e) {
108114
returnarray('file' =>$file,'valid' =>false,'message' =>$e->getMessage());
115+
}finally {
116+
restore_error_handler();
109117
}
110118

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp