归一化2结果数据json表

时间:2019-05-11 09:36:22

标签: php arrays json symfony4

我使用json-decode将数据转换为json表, 我的问题是我有2个结果json表,并且我尝试将其标准化以获取标准化格式的单个结果,是否知道如何标准化我的数据

结果1

“ PEAR.Commenting.ClassComment.MissingCategoryTag”,                     “严重程度”:5                     “ type”:“ ERROR”,                     “线”:14                     “列”:2                     “可修复”:false                 }

{
    "endPosition": { "character": 63, "line": 69, "position": 1565 },
    "failure": "comment must start with a space",
    "name": "/home/ke/Front-Analyse/e2e/src/account/register/register.po.ts",
    "ruleName": "comment-format",
    "ruleSeverity": "ERROR",
    "startPosition": { "character": 10, "line": 69, "position": 1512 }
},
{
    "endPosition": { "character": 15, "line": 10, "position": 388 },
    "failure": "Identifier 'newUser' is never reassigned; use 'const' instead of 'let'.",
    "fix": { "innerStart": 377, "innerLength": 3, "innerText": "const" },
    "name": "/home/ke/Front-Analyse/e2e/src/account/register/register.e2e-spec.ts",
    "ruleName": "prefer-const",
    "ruleSeverity": "ERROR",
    "startPosition": { "character": 8, "line": 10, "position": 381 }
},
{
    "endPosition": { "character": 20, "line": 19, "position": 610 },
    "failure": "Identifier 'existantUser' is never reassigned; use 'const' instead of 'let'.",
    "fix": { "innerStart": 594, "innerLength": 3, "innerText": "const" },
    "name": "/home/ke/Front-Analyse/e2e/src/account/register/register.e2e-spec.ts",
    "ruleName": "prefer-const",
    "ruleSeverity": "ERROR",
    "startPosition": { "character": 8, "line": 19, "position": 598 }
},

结果2

    "filePath": "/home/ke/NODEEE/app.js",
    "messages": [
        {
            "ruleId": "no-undef",
            "severity": 2,
            "message": "'require' is not defined.",
            "line": 1,
            "column": 19,
            "nodeType": "Identifier",
            "messageId": "undef",
            "endLine": 1,
            "endColumn": 26
        },
        {
            "ruleId": "no-undef",
            "severity": 2,
            "message": "'require' is not defined.",
            "line": 2,
            "column": 15,
            "nodeType": "Identifier",
            "messageId": "undef",
            "endLine": 2,
            "endColumn": 22
        },
        {
            "ruleId": "no-undef",
            "severity": 2,
            "message": "'require' is not defined.",
            "line": 3,
            "column": 12,
            "nodeType": "Identifier",
            "messageId": "undef",
            "endLine": 3,
            "endColumn": 19
        },

Array

(     [总计] =>数组         (             [错误] => 2             [警告] => 0             [固定] => 0         )

[files] => Array
    (
        [/home/ke/Test-Code/CODE.php] => Array
            (
                [errors] => 2
                [warnings] => 0
                [messages] => Array
                    (
                        [0] => Array
                            (
                                [message] => Missing file doc comment
                                [source] => PEAR.Commenting.FileComment.Missing
                                [severity] => 5
                                [type] => ERROR
                                [line] => 2
                                [column] => 1
                                [fixable] => 
                            )

                        [1] => Array
                            (
                                [message] => Expected "for (...) {\n"; found "for (...)\n{\n"
                                [source] => PEAR.ControlStructures.ControlSignature.Found
                                [severity] => 5
                                [type] => ERROR
                                [line] => 12
                                [column] => 1
                                [fixable] => 
                            )

                    )

            )

    )

0 个答案:

没有答案