Skip to content

Commit 3a1c258

Browse files
committed
Code reformatting and minor optimization, Typo fixes
1 parent c017af5 commit 3a1c258

File tree

8 files changed

+30
-26
lines changed

8 files changed

+30
-26
lines changed

example/example.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
use jblond\Autoloader;
34
use jblond\Diff;
45
use jblond\Diff\Renderer\Html\Inline;

example/styles.css

+21-19
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
body {
2-
background: #FFFFFF;
3-
font-family: Arial;
4-
font-size: 12px;
2+
background: #FFFFFF;
3+
font-family: Arial, serif;
4+
font-size: 12px;
55
}
66

77
pre {
8-
width: 100%;
8+
width: 100%;
99
overflow: auto;
1010
}
1111

@@ -14,18 +14,18 @@ pre {
1414
*/
1515

1616
.Differences {
17-
width: 100%;
18-
border-collapse: collapse;
19-
border-spacing: 0;
20-
empty-cells: show;
17+
width: 100%;
18+
border-collapse: collapse;
19+
border-spacing: 0;
20+
empty-cells: show;
2121
}
2222

2323
.Differences thead th {
24-
text-align: left;
25-
border-bottom: 1px solid #000000;
26-
background: #AAAAAA;
27-
color: #000000;
28-
padding: 4px;
24+
text-align: left;
25+
border-bottom: 1px solid #000000;
26+
background: #AAAAAA;
27+
color: #000000;
28+
padding: 4px;
2929
}
3030

3131
.Differences tbody th {
@@ -39,9 +39,9 @@ pre {
3939
}
4040

4141
.Differences td {
42-
padding: 1px 2px;
43-
font-family: Consolas, monospace;
44-
font-size: 13px;
42+
padding: 1px 2px;
43+
font-family: Consolas, monospace;
44+
font-size: 13px;
4545
}
4646

4747
.Differences .Skipped {
@@ -129,11 +129,13 @@ pre {
129129
.DifferencesUnified .ChangeReplace .Left:first-child:before {
130130
content: "\250C \00a0";
131131
}
132+
132133
.DifferencesUnified .ChangeReplace .Left:before {
133134
content: "\251C \00a0";
134135
}
136+
135137
.DifferencesUnified .ChangeReplace .Left {
136-
background: #fe9;
138+
background: #FFEE99;
137139
}
138140

139141
/* Line in new replaced line in old */
@@ -159,7 +161,7 @@ pre {
159161
background: #99EE99;
160162
}
161163

162-
/* Chararcter removed from line in old */
164+
/* Character removed from line in old */
163165
.DifferencesUnified .ChangeReplace del {
164-
background: #EE9999;
166+
background: #EE9999;
165167
}

lib/Autoloader.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Autoloader
2222
/**
2323
* Constructor.
2424
*
25-
* A function is registered as an __autoload() implementation to include and evaluate the class file whan this class
25+
* A function is registered as an __autoload() implementation to include and evaluate the class file when this class
2626
* is called.
2727
*/
2828
public function __construct()

lib/jblond/Diff/Renderer/Html/HtmlArray.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ private function getChangeExtent(string $oldString, string $newString): array
216216
* This involves replacing tab characters with spaces, making the HTML safe for output by ensuring that double
217217
* spaces are replaced with &nbsp; etc.
218218
*
219-
* @param array $lines Array of strings to format.
219+
* @param array $strings Array of strings to format.
220220
*
221221
* @return array Array of formatted strings.
222222
*/

lib/jblond/Diff/Renderer/Html/Inline.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function generateTableRowsDelete(array $change): string
136136
}
137137

138138
/**
139-
* Generates a string representation of table rows showing partialy modified text.
139+
* Generates a string representation of table rows showing partially modified text.
140140
*
141141
* @param array $change Contains the op-codes about the changes between two blocks of text.
142142
*

lib/jblond/Diff/Renderer/Html/SideBySide.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function generateTableRowsDelete(array &$change): string
136136
}
137137

138138
/**
139-
* Generates a string representation of table rows showing partialy modified text.
139+
* Generates a string representation of table rows showing partially modified text.
140140
*
141141
* @param array $change Contains the op-codes about the changes between two blocks of text.
142142
*

tests/Diff/Renderer/Html/HtmlArrayTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Tests\Diff\Renderer\Html;
66

7+
use jblond\Diff;
78
use PHPUnit\Framework\TestCase;
89
use jblond\Diff\Renderer\Html\HtmlArray;
910

@@ -32,7 +33,7 @@ public function __construct($name = null, array $data = [], $dataName = '')
3233
public function testRenderSimpleDelete()
3334
{
3435
$htmlRenderer = new HtmlArray();
35-
$htmlRenderer->diff = new \jblond\Diff(
36+
$htmlRenderer->diff = new Diff(
3637
array('a'),
3738
array()
3839
);
@@ -62,7 +63,7 @@ public function testRenderSimpleDelete()
6263
public function testRenderFixesSpaces()
6364
{
6465
$htmlRenderer = new HtmlArray();
65-
$htmlRenderer->diff = new \jblond\Diff(
66+
$htmlRenderer->diff = new Diff(
6667
array(' a'),
6768
array('a')
6869
);

tests/Diff/Renderer/Text/TextRenderersTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/**
1313
* Class TextRendererTest
1414
*
15-
* PHPunit tests to verify the output of the text renderers hasn't change by code changes.
15+
* PHPUnit tests to verify the output of the text renderers hasn't change by code changes.
1616
*
1717
* @package Tests\Diff\Renderer\Text
1818
*/

0 commit comments

Comments
 (0)