File tree Expand file tree Collapse file tree 5 files changed +24
-53
lines changed Expand file tree Collapse file tree 5 files changed +24
-53
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,10 @@ composer.phar
11
11
# composer.lock
12
12
13
13
# ## Eclipse ###
14
- .metadata
15
14
bin /
16
15
tmp /
17
16
* .tmp
18
17
* .bak
19
- * .swp
20
18
* ~.nib
21
19
local.properties
22
20
.settings /
@@ -29,14 +27,6 @@ local.properties
29
27
# Locally stored "Eclipse launch configurations"
30
28
* .launch
31
29
32
- # PyDev specific (Python IDE for Eclipse)
33
- * .pydevproject
34
-
35
- # CDT-specific (C/C++ Development Tooling)
36
- .cproject
37
-
38
- # CDT- autotools
39
- .autotools
40
30
41
31
# Java annotation processor (APT)
42
32
.factorypath
@@ -79,31 +69,7 @@ local.properties
79
69
80
70
.sts4-cache /
81
71
82
- # ## Windows ###
83
- # Windows thumbnail cache files
84
- Thumbs.db
85
- Thumbs.db:encryptable
86
- ehthumbs.db
87
- ehthumbs_vista.db
88
-
89
- # Dump file
90
- * .stackdump
91
-
92
- # Folder config file
93
- [Dd ]esktop.ini
94
-
95
- # Recycle Bin used on file shares
96
- $RECYCLE.BIN /
97
-
98
- # Windows Installer files
99
- * .cab
100
- * .msi
101
- * .msix
102
- * .msm
103
- * .msp
104
72
105
- # Windows shortcuts
106
- * .lnk
107
73
108
74
# End of https://www.gitignore.io/api/windows,eclipse,composer
109
75
/composer.lock
Original file line number Diff line number Diff line change 5
5
namespace jblond ;
6
6
7
7
use InvalidArgumentException ;
8
+ use jblond \Diff \Renderer \Html \Inline ;
9
+ use jblond \Diff \Renderer \Html \SideBySide ;
10
+ use jblond \Diff \Renderer \Html \Unified as UnifiedHtml ;
11
+ use jblond \Diff \Renderer \Text \Context ;
12
+ use jblond \Diff \Renderer \Text \Unified ;
8
13
use jblond \Diff \SequenceMatcher ;
9
14
use OutOfRangeException ;
10
15
@@ -158,7 +163,8 @@ public function getVersion2(): array
158
163
/**
159
164
* Render a diff-view using a rendering class and get its results.
160
165
*
161
- * @param object $renderer An instance of the rendering object, used for generating the diff-view.
166
+ * @param object|Context|Unified|UnifiedHtml|Inline|SideBySide $renderer An instance of the rendering object,
167
+ * used for generating the diff-view.
162
168
*
163
169
* @return mixed The generated diff-view. The type of the return value depends on the applied rendereder.
164
170
*/
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ class HtmlArray extends RendererAbstract
45
45
* This method is called by the renderers which extends this class.
46
46
*
47
47
* @param array $changes Contains the op-codes about the differences between "old and "new".
48
- * @param object $htmlRenderer Renderer which extends this class.
48
+ * @param object|Inline|SideBySide|Unified $htmlRenderer Renderer which extends this class.
49
49
*
50
50
* @return string HTML representation of the differences.
51
51
*/
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ public function generateTableRowsReplace(array $changes): string
166
166
{
167
167
$ html = '' ;
168
168
169
- //TODO: Is below comparison result ever false?
169
+ // Is below comparison result ever false?
170
170
if (count ($ changes ['base ' ]['lines ' ]) >= count ($ changes ['changed ' ]['lines ' ])) {
171
171
foreach ($ changes ['base ' ]['lines ' ] as $ lineNo => $ line ) {
172
172
$ fromLine = $ changes ['base ' ]['offset ' ] + $ lineNo + 1 ;
Original file line number Diff line number Diff line change @@ -53,22 +53,21 @@ public function render(): string
53
53
"\n " ,
54
54
$ this ->diff ->getArrayRange ($ this ->diff ->getVersion1 (), $ i1 , $ i2 )
55
55
) . "\n" ;
56
- } else {
57
- if ($ tag == 'replace ' || $ tag == 'delete ' ) {
58
- $ diff .= '- ' .
59
- implode (
60
- "\n- " ,
61
- $ this ->diff ->getArrayRange ($ this ->diff ->getVersion1 (), $ i1 , $ i2 )
62
- ) . "\n" ;
63
- }
64
-
65
- if ($ tag == 'replace ' || $ tag == 'insert ' ) {
66
- $ diff .= '+ ' .
67
- implode (
68
- "\n+ " ,
69
- $ this ->diff ->getArrayRange ($ this ->diff ->getVersion2 (), $ j1 , $ j2 )
70
- ) . "\n" ;
71
- }
56
+ continue ;
57
+ }
58
+ if ($ tag == 'replace ' || $ tag == 'delete ' ) {
59
+ $ diff .= '- ' .
60
+ implode (
61
+ "\n- " ,
62
+ $ this ->diff ->getArrayRange ($ this ->diff ->getVersion1 (), $ i1 , $ i2 )
63
+ ) . "\n" ;
64
+ }
65
+ if ($ tag == 'replace ' || $ tag == 'insert ' ) {
66
+ $ diff .= '+ ' .
67
+ implode (
68
+ "\n+ " ,
69
+ $ this ->diff ->getArrayRange ($ this ->diff ->getVersion2 (), $ j1 , $ j2 )
70
+ ) . "\n" ;
72
71
}
73
72
}
74
73
}
You can’t perform that action at this time.
0 commit comments