Skip to content

Commit 0602f67

Browse files
author
Иван Сабиров
committed
Внесены правки в соответствии с замечаниями ментора
1 parent 2985c4e commit 0602f67

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PHP-package to find difference between two files.
88
## Installation
99

1010
With Composer:
11-
`composer global require sabirivan/gendiff:dev-master`
11+
`composer global require sabirivan/gendiff:^1.2`
1212

1313
## Input and output data
1414

src/formatters/json.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
function runJsonRender($ast)
66
{
7-
$result = json_encode($ast, JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK);
8-
$result = trim($result, "[]");
9-
$result = "{{$result}}";
7+
$decodeJson = json_encode($ast, JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK);
8+
$result = "{" . trim($decodeJson, "[]") . "}";
109
return $result;
1110
}

src/renderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ function render($pathToFile1, $pathToFile2, $format)
1515
$data1 = getData($pathToFile1);
1616
$data2 = getData($pathToFile2);
1717
$ast = build($data1, $data2);
18-
$renderedAst = chooseRender($ast, $format);
19-
return $renderedAst;
18+
$renderedResult = chooseRender($ast, $format);
19+
return $renderedResult;
2020
}
2121

2222
function getData($pathToFile)

src/runner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function run()
2121
DOC;
2222

2323
try {
24-
$args = \Docopt::handle($doc, array("version" => "GenDiff 1.1"));
24+
$args = \Docopt::handle($doc, array("version" => "GenDiff 1.2"));
2525
$diff = render($args["<firstFile>"], $args["<secondFile>"], $args["--format"]);
2626
print_r($diff);
2727
} catch (\Exception $e) {

0 commit comments

Comments
 (0)