/* Decoded by unphp.net */ $columns) { foreach ($columns as $column => $messages) { $stackPtr = $file->getStackPtrForPosition($line, $column); if (!isset($stackPtr)) { continue; } $token = $file->getToken($stackPtr); foreach ($messages as $message) { // When fixable create a code action object according to the VS Code CodeAction schema. if ($message['fixable']) { $codeAction = array( 'title' => 'Fix ' . $message['source'], 'kind' => 'quickfix', // The index can be used to associate the code action in VS Code. 'diagnostic' => $diagnosticIndex ); $codeActions[] = $codeAction; } // Create a diagnostic object according to the VS Code Diagnostic schema. $diagnostic = array( 'code' => $message['source'], 'message' => $message['message'], 'range' => $token['vscode_range'], // Enum Values: DiagnosticSeverity.Error : DiagnosticSeverity.Warning 'severity' => strtolower($message['type']) === 'error' ? 0 : 1, 'source' => 'PHP_CodeSniffer' ); $diagnostics[$diagnosticIndex++] = $diagnostic; } } } echo json_encode( array( 'filename' => $report['filename'], 'diagnostics' => $diagnostics, 'codeActions' => $codeActions ), JSON_UNESCAPED_LINE_TERMINATORS ); // Ensure multiple files are separated by a comma. echo ','; return true; } } ?>