Completed
Push — master ( 04cf1c...b0b733 )
by Kacper
03:57
created
Language/Latex.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
                 new Rule(new RegexMatcher('/(\\\\\[.*?\\\\\])/s')),
42 42
                 new Rule(
43 43
                     new RegexMatcher(
44
-                        '/\\\begin{((?:' . implode('|', self::$mathEnvironments) . ')\*?)}(.*?)\\\end{\1}/s',
44
+                        '/\\\begin{((?:'.implode('|', self::$mathEnvironments).')\*?)}(.*?)\\\end{\1}/s',
45 45
                         [2 => Token::NAME]
46 46
                     )
47 47
                 )
Please login to merge, or discard this patch.
bin/Commands/HighlightCommand.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     {
36 36
         $this->setName('highlight')
37 37
             ->addArgument('path', InputArgument::REQUIRED | InputArgument::IS_ARRAY, 'File(s) to highlight')
38
-            ->addOption('normalize',  null, InputOption::VALUE_OPTIONAL, 'Normalize input to LF')
38
+            ->addOption('normalize', null, InputOption::VALUE_OPTIONAL, 'Normalize input to LF')
39 39
             ->addOption('language', 'l', InputOption::VALUE_OPTIONAL, 'Source Language to highlight, see <comment>list-languages</comment> command')
40 40
             ->addOption('format', 'f', InputOption::VALUE_OPTIONAL, 'Output format, see <comment>list-languages</comment> command', 'cli')
41 41
             ->addOption(
@@ -48,26 +48,26 @@  discard block
 block discarded – undo
48 48
 
49 49
     protected function execute(InputInterface $input, OutputInterface $output)
50 50
     {
51
-        if(!empty($input->getOption('debug')) && $output->getVerbosity() < OutputInterface::VERBOSITY_VERBOSE) {
51
+        if (!empty($input->getOption('debug')) && $output->getVerbosity() < OutputInterface::VERBOSITY_VERBOSE) {
52 52
             $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
53 53
         }
54 54
 
55 55
         $output->writeln($this->getApplication()->getLongVersion()."\n", Output::VERBOSITY_VERBOSE);
56 56
         $formatter = KeyLighter::get()->getFormatter($input->getOption('format')) ?: KeyLighter::get()->getDefaultFormatter();
57 57
 
58
-        foreach($input->getArgument('path') as $filename) {
58
+        foreach ($input->getArgument('path') as $filename) {
59 59
             $this->process($input, $output, $filename, $formatter);
60 60
         }
61 61
     }
62 62
 
63 63
     protected function content($path, $normalize = false)
64 64
     {
65
-        if(!($file = @fopen($path, 'r'))) {
65
+        if (!($file = @fopen($path, 'r'))) {
66 66
             return false;
67 67
         }
68 68
 
69 69
         $content = '';
70
-        while(!feof($file)) {
70
+        while (!feof($file)) {
71 71
             $content .= fgets($file);
72 72
         }
73 73
         fclose($file);
Please login to merge, or discard this patch.
Config/metadata.php 2 patches
Indentation   +241 added lines, -241 removed lines patch added patch discarded remove patch
@@ -1,206 +1,206 @@  discard block
 block discarded – undo
1 1
 <?php return array (
2
-  0 => 
3
-  array (
2
+    0 => 
3
+    array (
4 4
     0 => 'Kadet\\Highlighter\\Language\\C',
5 5
     'name' => 
6 6
     array (
7
-      0 => 'c',
7
+        0 => 'c',
8 8
     ),
9 9
     'mime' => 
10 10
     array (
11
-      0 => 'text/x-csrc',
12
-      1 => 'text/x-chdr',
11
+        0 => 'text/x-csrc',
12
+        1 => 'text/x-chdr',
13 13
     ),
14 14
     'extension' => 
15 15
     array (
16
-      0 => '*.c',
17
-      1 => '*.h',
18
-      2 => '*.idc',
16
+        0 => '*.c',
17
+        1 => '*.h',
18
+        2 => '*.idc',
19 19
     ),
20 20
     'standalone' => true,
21 21
     'injectable' => false,
22
-  ),
23
-  1 => 
24
-  array (
22
+    ),
23
+    1 => 
24
+    array (
25 25
     0 => 'Kadet\\Highlighter\\Language\\Cobol',
26 26
     'name' => 
27 27
     array (
28
-      0 => 'cobol',
28
+        0 => 'cobol',
29 29
     ),
30 30
     'mime' => 
31 31
     array (
32
-      0 => 'text/x-cobol',
32
+        0 => 'text/x-cobol',
33 33
     ),
34 34
     'extension' => 
35 35
     array (
36
-      0 => '*.cbl',
36
+        0 => '*.cbl',
37 37
     ),
38 38
     'standalone' => true,
39 39
     'injectable' => false,
40
-  ),
41
-  2 => 
42
-  array (
40
+    ),
41
+    2 => 
42
+    array (
43 43
     0 => 'Kadet\\Highlighter\\Language\\Cpp',
44 44
     'name' => 
45 45
     array (
46
-      0 => 'cpp',
47
-      1 => 'c++',
46
+        0 => 'cpp',
47
+        1 => 'c++',
48 48
     ),
49 49
     'mime' => 
50 50
     array (
51
-      0 => 'text/x-c++src',
52
-      1 => 'text/x-c++hdr',
51
+        0 => 'text/x-c++src',
52
+        1 => 'text/x-c++hdr',
53 53
     ),
54 54
     'extension' => 
55 55
     array (
56
-      0 => '*.cpp',
57
-      1 => '*.hpp',
58
-      2 => '*.hxx',
59
-      3 => '*.cxx',
60
-      4 => '*.cc',
61
-      5 => '*.hh',
56
+        0 => '*.cpp',
57
+        1 => '*.hpp',
58
+        2 => '*.hxx',
59
+        3 => '*.cxx',
60
+        4 => '*.cc',
61
+        5 => '*.hh',
62 62
     ),
63 63
     'standalone' => true,
64 64
     'injectable' => false,
65
-  ),
66
-  3 => 
67
-  array (
65
+    ),
66
+    3 => 
67
+    array (
68 68
     0 => 'Kadet\\Highlighter\\Language\\CSharp',
69 69
     'name' => 
70 70
     array (
71
-      0 => 'CSharp',
72
-      1 => 'C#',
71
+        0 => 'CSharp',
72
+        1 => 'C#',
73 73
     ),
74 74
     'mime' => 
75 75
     array (
76
-      0 => 'text/x-csharp',
76
+        0 => 'text/x-csharp',
77 77
     ),
78 78
     'extension' => 
79 79
     array (
80
-      0 => '*.cs',
80
+        0 => '*.cs',
81 81
     ),
82 82
     'standalone' => true,
83 83
     'injectable' => false,
84
-  ),
85
-  4 => 
86
-  array (
84
+    ),
85
+    4 => 
86
+    array (
87 87
     0 => 'Kadet\\Highlighter\\Language\\Css\\Less',
88 88
     'name' => 
89 89
     array (
90
-      0 => 'less',
90
+        0 => 'less',
91 91
     ),
92 92
     'mime' => 
93 93
     array (
94
-      0 => 'text/x-less',
94
+        0 => 'text/x-less',
95 95
     ),
96 96
     'extension' => 
97 97
     array (
98
-      0 => '*.less',
98
+        0 => '*.less',
99 99
     ),
100 100
     'standalone' => true,
101 101
     'injectable' => false,
102
-  ),
103
-  5 => 
104
-  array (
102
+    ),
103
+    5 => 
104
+    array (
105 105
     0 => 'Kadet\\Highlighter\\Language\\Css\\Sass',
106 106
     'name' => 
107 107
     array (
108
-      0 => 'sass',
108
+        0 => 'sass',
109 109
     ),
110 110
     'mime' => 
111 111
     array (
112
-      0 => 'text/x-sass',
112
+        0 => 'text/x-sass',
113 113
     ),
114 114
     'extension' => 
115 115
     array (
116
-      0 => '*.sass',
116
+        0 => '*.sass',
117 117
     ),
118 118
     'standalone' => true,
119 119
     'injectable' => false,
120
-  ),
121
-  6 => 
122
-  array (
120
+    ),
121
+    6 => 
122
+    array (
123 123
     0 => 'Kadet\\Highlighter\\Language\\Css\\Scss',
124 124
     'name' => 
125 125
     array (
126
-      0 => 'scss',
126
+        0 => 'scss',
127 127
     ),
128 128
     'mime' => 
129 129
     array (
130
-      0 => 'text/x-scss',
130
+        0 => 'text/x-scss',
131 131
     ),
132 132
     'extension' => 
133 133
     array (
134
-      0 => '*.scss',
134
+        0 => '*.scss',
135 135
     ),
136 136
     'standalone' => true,
137 137
     'injectable' => false,
138
-  ),
139
-  7 => 
140
-  array (
138
+    ),
139
+    7 => 
140
+    array (
141 141
     0 => 'Kadet\\Highlighter\\Language\\Css',
142 142
     'name' => 
143 143
     array (
144
-      0 => 'css',
144
+        0 => 'css',
145 145
     ),
146 146
     'mime' => 
147 147
     array (
148
-      0 => 'text/css',
148
+        0 => 'text/css',
149 149
     ),
150 150
     'extension' => 
151 151
     array (
152
-      0 => '*.css',
152
+        0 => '*.css',
153 153
     ),
154 154
     'standalone' => true,
155 155
     'injectable' => false,
156
-  ),
157
-  8 => 
158
-  array (
156
+    ),
157
+    8 => 
158
+    array (
159 159
     0 => 'Kadet\\Highlighter\\Language\\Go',
160 160
     'name' => 
161 161
     array (
162
-      0 => 'go',
163
-      1 => 'golang',
162
+        0 => 'go',
163
+        1 => 'golang',
164 164
     ),
165 165
     'mime' => 
166 166
     array (
167
-      0 => 'text/x-go',
168
-      1 => 'application/x-go',
169
-      2 => 'text/x-golang',
170
-      3 => 'application/x-golang',
167
+        0 => 'text/x-go',
168
+        1 => 'application/x-go',
169
+        2 => 'text/x-golang',
170
+        3 => 'application/x-golang',
171 171
     ),
172 172
     'extension' => 
173 173
     array (
174
-      0 => '*.go',
174
+        0 => '*.go',
175 175
     ),
176 176
     'standalone' => true,
177 177
     'injectable' => false,
178
-  ),
179
-  9 => 
180
-  array (
178
+    ),
179
+    9 => 
180
+    array (
181 181
     0 => 'Kadet\\Highlighter\\Language\\Html',
182 182
     'name' => 
183 183
     array (
184
-      0 => 'html',
184
+        0 => 'html',
185 185
     ),
186 186
     'mime' => 
187 187
     array (
188
-      0 => 'text/html',
188
+        0 => 'text/html',
189 189
     ),
190 190
     'extension' => 
191 191
     array (
192
-      0 => '*.html',
193
-      1 => '*.htm',
192
+        0 => '*.html',
193
+        1 => '*.htm',
194 194
     ),
195 195
     'standalone' => true,
196 196
     'injectable' => false,
197
-  ),
198
-  10 => 
199
-  array (
197
+    ),
198
+    10 => 
199
+    array (
200 200
     0 => 'Kadet\\Highlighter\\Language\\Http',
201 201
     'name' => 
202 202
     array (
203
-      0 => 'http',
203
+        0 => 'http',
204 204
     ),
205 205
     'mime' => 
206 206
     array (
@@ -210,382 +210,382 @@  discard block
 block discarded – undo
210 210
     ),
211 211
     'standalone' => true,
212 212
     'injectable' => false,
213
-  ),
214
-  11 => 
215
-  array (
213
+    ),
214
+    11 => 
215
+    array (
216 216
     0 => 'Kadet\\Highlighter\\Language\\Ini',
217 217
     'name' => 
218 218
     array (
219
-      0 => 'ini',
219
+        0 => 'ini',
220 220
     ),
221 221
     'mime' => 
222 222
     array (
223
-      0 => 'text/x-ini',
224
-      1 => 'text/inf',
223
+        0 => 'text/x-ini',
224
+        1 => 'text/inf',
225 225
     ),
226 226
     'extension' => 
227 227
     array (
228
-      0 => '*.ini',
229
-      1 => '*.cfg',
230
-      2 => '*.inf',
228
+        0 => '*.ini',
229
+        1 => '*.cfg',
230
+        2 => '*.inf',
231 231
     ),
232 232
     'standalone' => true,
233 233
     'injectable' => false,
234
-  ),
235
-  12 => 
236
-  array (
234
+    ),
235
+    12 => 
236
+    array (
237 237
     0 => 'Kadet\\Highlighter\\Language\\Java',
238 238
     'name' => 
239 239
     array (
240
-      0 => 'java',
240
+        0 => 'java',
241 241
     ),
242 242
     'mime' => 
243 243
     array (
244
-      0 => 'text/x-java',
244
+        0 => 'text/x-java',
245 245
     ),
246 246
     'extension' => 
247 247
     array (
248
-      0 => '*.java',
248
+        0 => '*.java',
249 249
     ),
250 250
     'standalone' => true,
251 251
     'injectable' => false,
252
-  ),
253
-  13 => 
254
-  array (
252
+    ),
253
+    13 => 
254
+    array (
255 255
     0 => 'Kadet\\Highlighter\\Language\\JavaScript',
256 256
     'name' => 
257 257
     array (
258
-      0 => 'js',
259
-      1 => 'jscript',
260
-      2 => 'javascript',
258
+        0 => 'js',
259
+        1 => 'jscript',
260
+        2 => 'javascript',
261 261
     ),
262 262
     'mime' => 
263 263
     array (
264
-      0 => 'application/javascript',
265
-      1 => 'application/x-javascript',
266
-      2 => 'text/x-javascript',
267
-      3 => 'text/javascript',
268
-      4 => 'application/json',
264
+        0 => 'application/javascript',
265
+        1 => 'application/x-javascript',
266
+        2 => 'text/x-javascript',
267
+        3 => 'text/javascript',
268
+        4 => 'application/json',
269 269
     ),
270 270
     'extension' => 
271 271
     array (
272
-      0 => '*.js',
273
-      1 => '*.jsx',
272
+        0 => '*.js',
273
+        1 => '*.jsx',
274 274
     ),
275 275
     'standalone' => true,
276 276
     'injectable' => false,
277
-  ),
278
-  14 => 
279
-  array (
277
+    ),
278
+    14 => 
279
+    array (
280 280
     0 => 'Kadet\\Highlighter\\Language\\Latex',
281 281
     'name' => 
282 282
     array (
283
-      0 => 'tex',
284
-      1 => 'latex',
283
+        0 => 'tex',
284
+        1 => 'latex',
285 285
     ),
286 286
     'mime' => 
287 287
     array (
288
-      0 => 'application/x-tex',
289
-      1 => 'application/x-latex',
288
+        0 => 'application/x-tex',
289
+        1 => 'application/x-latex',
290 290
     ),
291 291
     'extension' => 
292 292
     array (
293
-      0 => '*.tex',
294
-      1 => '*.aux',
295
-      2 => '*.toc',
293
+        0 => '*.tex',
294
+        1 => '*.aux',
295
+        2 => '*.toc',
296 296
     ),
297 297
     'standalone' => true,
298 298
     'injectable' => false,
299
-  ),
300
-  15 => 
301
-  array (
299
+    ),
300
+    15 => 
301
+    array (
302 302
     0 => 'Kadet\\Highlighter\\Language\\Markdown',
303 303
     'name' => 
304 304
     array (
305
-      0 => 'markdown',
306
-      1 => 'md',
305
+        0 => 'markdown',
306
+        1 => 'md',
307 307
     ),
308 308
     'mime' => 
309 309
     array (
310
-      0 => 'text/markdown',
310
+        0 => 'text/markdown',
311 311
     ),
312 312
     'extension' => 
313 313
     array (
314
-      0 => '*.markdown',
315
-      1 => '*.md',
314
+        0 => '*.markdown',
315
+        1 => '*.md',
316 316
     ),
317 317
     'standalone' => true,
318 318
     'injectable' => false,
319
-  ),
320
-  16 => 
321
-  array (
319
+    ),
320
+    16 => 
321
+    array (
322 322
     0 => 'Kadet\\Highlighter\\Language\\Perl',
323 323
     'name' => 
324 324
     array (
325
-      0 => 'perl',
325
+        0 => 'perl',
326 326
     ),
327 327
     'mime' => 
328 328
     array (
329
-      0 => 'text/x-perl',
330
-      1 => 'application/x-perl',
329
+        0 => 'text/x-perl',
330
+        1 => 'application/x-perl',
331 331
     ),
332 332
     'extension' => 
333 333
     array (
334
-      0 => '*.pl',
335
-      1 => '*.pm',
336
-      2 => '*.t',
334
+        0 => '*.pl',
335
+        1 => '*.pm',
336
+        2 => '*.t',
337 337
     ),
338 338
     'standalone' => true,
339 339
     'injectable' => false,
340
-  ),
341
-  17 => 
342
-  array (
340
+    ),
341
+    17 => 
342
+    array (
343 343
     0 => 'Kadet\\Highlighter\\Language\\Php',
344 344
     'name' => 
345 345
     array (
346
-      0 => 'php',
346
+        0 => 'php',
347 347
     ),
348 348
     'mime' => 
349 349
     array (
350
-      0 => 'text/x-php',
351
-      1 => 'application/x-php',
350
+        0 => 'text/x-php',
351
+        1 => 'application/x-php',
352 352
     ),
353 353
     'extension' => 
354 354
     array (
355
-      0 => '*.php',
356
-      1 => '*.phtml',
357
-      2 => '*.inc',
358
-      3 => '*.php?',
355
+        0 => '*.php',
356
+        1 => '*.phtml',
357
+        2 => '*.inc',
358
+        3 => '*.php?',
359 359
     ),
360 360
     'standalone' => true,
361 361
     'injectable' => true,
362
-  ),
363
-  18 => 
364
-  array (
362
+    ),
363
+    18 => 
364
+    array (
365 365
     0 => 'Kadet\\Highlighter\\Language\\PlainText',
366 366
     'name' => 
367 367
     array (
368
-      0 => 'plaintext',
369
-      1 => 'text',
370
-      2 => 'none',
368
+        0 => 'plaintext',
369
+        1 => 'text',
370
+        2 => 'none',
371 371
     ),
372 372
     'mime' => 
373 373
     array (
374
-      0 => 'text/plain',
374
+        0 => 'text/plain',
375 375
     ),
376 376
     'extension' => 
377 377
     array (
378 378
     ),
379 379
     'standalone' => true,
380 380
     'injectable' => false,
381
-  ),
382
-  19 => 
383
-  array (
381
+    ),
382
+    19 => 
383
+    array (
384 384
     0 => 'Kadet\\Highlighter\\Language\\PowerShell',
385 385
     'name' => 
386 386
     array (
387
-      0 => 'powershell',
388
-      1 => 'posh',
387
+        0 => 'powershell',
388
+        1 => 'posh',
389 389
     ),
390 390
     'mime' => 
391 391
     array (
392
-      0 => 'text/x-powershell',
393
-      1 => 'application/x-powershell',
392
+        0 => 'text/x-powershell',
393
+        1 => 'application/x-powershell',
394 394
     ),
395 395
     'extension' => 
396 396
     array (
397
-      0 => '*.ps1',
398
-      1 => '*.psm1',
399
-      2 => '*.psd1',
397
+        0 => '*.ps1',
398
+        1 => '*.psm1',
399
+        2 => '*.psd1',
400 400
     ),
401 401
     'standalone' => true,
402 402
     'injectable' => false,
403
-  ),
404
-  20 => 
405
-  array (
403
+    ),
404
+    20 => 
405
+    array (
406 406
     0 => 'Kadet\\Highlighter\\Language\\Python\\Django',
407 407
     'name' => 
408 408
     array (
409
-      0 => 'django',
410
-      1 => 'jinja',
409
+        0 => 'django',
410
+        1 => 'jinja',
411 411
     ),
412 412
     'mime' => 
413 413
     array (
414
-      0 => 'application/x-django-templating',
415
-      1 => 'application/x-jinja',
414
+        0 => 'application/x-django-templating',
415
+        1 => 'application/x-jinja',
416 416
     ),
417 417
     'extension' => 
418 418
     array (
419 419
     ),
420 420
     'standalone' => false,
421 421
     'injectable' => true,
422
-  ),
423
-  21 => 
424
-  array (
422
+    ),
423
+    21 => 
424
+    array (
425 425
     0 => 'Kadet\\Highlighter\\Language\\Python',
426 426
     'name' => 
427 427
     array (
428
-      0 => 'python',
429
-      1 => 'py',
428
+        0 => 'python',
429
+        1 => 'py',
430 430
     ),
431 431
     'mime' => 
432 432
     array (
433
-      0 => 'text/x-python',
434
-      1 => 'application/x-python',
433
+        0 => 'text/x-python',
434
+        1 => 'application/x-python',
435 435
     ),
436 436
     'extension' => 
437 437
     array (
438
-      0 => '*.py',
438
+        0 => '*.py',
439 439
     ),
440 440
     'standalone' => true,
441 441
     'injectable' => false,
442
-  ),
443
-  22 => 
444
-  array (
442
+    ),
443
+    22 => 
444
+    array (
445 445
     0 => 'Kadet\\Highlighter\\Language\\Ruby',
446 446
     'name' => 
447 447
     array (
448
-      0 => 'ruby',
448
+        0 => 'ruby',
449 449
     ),
450 450
     'mime' => 
451 451
     array (
452
-      0 => 'text/x-ruby',
453
-      1 => 'application/x-ruby',
452
+        0 => 'text/x-ruby',
453
+        1 => 'application/x-ruby',
454 454
     ),
455 455
     'extension' => 
456 456
     array (
457
-      0 => '*.rb',
458
-      1 => '*.rbw',
459
-      2 => 'Rakefile',
460
-      3 => '*.rake',
461
-      4 => '*.gemspec',
462
-      5 => '*.rbx',
463
-      6 => '*.duby',
464
-      7 => 'Gemfile',
457
+        0 => '*.rb',
458
+        1 => '*.rbw',
459
+        2 => 'Rakefile',
460
+        3 => '*.rake',
461
+        4 => '*.gemspec',
462
+        5 => '*.rbx',
463
+        6 => '*.duby',
464
+        7 => 'Gemfile',
465 465
     ),
466 466
     'standalone' => true,
467 467
     'injectable' => false,
468
-  ),
469
-  23 => 
470
-  array (
468
+    ),
469
+    23 => 
470
+    array (
471 471
     0 => 'Kadet\\Highlighter\\Language\\Shell',
472 472
     'name' => 
473 473
     array (
474
-      0 => 'shell',
475
-      1 => 'bash',
476
-      2 => 'zsh',
477
-      3 => 'sh',
474
+        0 => 'shell',
475
+        1 => 'bash',
476
+        2 => 'zsh',
477
+        3 => 'sh',
478 478
     ),
479 479
     'mime' => 
480 480
     array (
481
-      0 => 'text/x-shellscript',
482
-      1 => 'application/x-shellscript',
481
+        0 => 'text/x-shellscript',
482
+        1 => 'application/x-shellscript',
483 483
     ),
484 484
     'extension' => 
485 485
     array (
486
-      0 => '*.sh',
487
-      1 => '*.zsh',
488
-      2 => '*.bash',
489
-      3 => '*.ebuild',
490
-      4 => '*.eclass',
491
-      5 => '*.exheres-0',
492
-      6 => '*.exlib',
493
-      7 => '.bashrc',
494
-      8 => 'bashrc',
495
-      9 => '.bash_*',
496
-      10 => 'bash_*',
497
-      11 => 'PKGBUILD',
486
+        0 => '*.sh',
487
+        1 => '*.zsh',
488
+        2 => '*.bash',
489
+        3 => '*.ebuild',
490
+        4 => '*.eclass',
491
+        5 => '*.exheres-0',
492
+        6 => '*.exlib',
493
+        7 => '.bashrc',
494
+        8 => 'bashrc',
495
+        9 => '.bash_*',
496
+        10 => 'bash_*',
497
+        11 => 'PKGBUILD',
498 498
     ),
499 499
     'standalone' => true,
500 500
     'injectable' => false,
501
-  ),
502
-  24 => 
503
-  array (
501
+    ),
502
+    24 => 
503
+    array (
504 504
     0 => 'Kadet\\Highlighter\\Language\\Sql\\MySql',
505 505
     'name' => 
506 506
     array (
507
-      0 => 'mysql',
507
+        0 => 'mysql',
508 508
     ),
509 509
     'mime' => 
510 510
     array (
511
-      0 => 'text/x-mysql',
511
+        0 => 'text/x-mysql',
512 512
     ),
513 513
     'extension' => 
514 514
     array (
515 515
     ),
516 516
     'standalone' => true,
517 517
     'injectable' => false,
518
-  ),
519
-  25 => 
520
-  array (
518
+    ),
519
+    25 => 
520
+    array (
521 521
     0 => 'Kadet\\Highlighter\\Language\\Sql',
522 522
     'name' => 
523 523
     array (
524
-      0 => 'sql',
524
+        0 => 'sql',
525 525
     ),
526 526
     'mime' => 
527 527
     array (
528
-      0 => 'text/x-sql',
528
+        0 => 'text/x-sql',
529 529
     ),
530 530
     'extension' => 
531 531
     array (
532
-      0 => '*.sql',
532
+        0 => '*.sql',
533 533
     ),
534 534
     'standalone' => true,
535 535
     'injectable' => false,
536
-  ),
537
-  26 => 
538
-  array (
536
+    ),
537
+    26 => 
538
+    array (
539 539
     0 => 'Kadet\\Highlighter\\Language\\Twig',
540 540
     'name' => 
541 541
     array (
542
-      0 => 'twig',
542
+        0 => 'twig',
543 543
     ),
544 544
     'mime' => 
545 545
     array (
546
-      0 => 'text/x-twig',
546
+        0 => 'text/x-twig',
547 547
     ),
548 548
     'extension' => 
549 549
     array (
550
-      0 => '*.twig',
550
+        0 => '*.twig',
551 551
     ),
552 552
     'standalone' => false,
553 553
     'injectable' => true,
554
-  ),
555
-  27 => 
556
-  array (
554
+    ),
555
+    27 => 
556
+    array (
557 557
     0 => 'Kadet\\Highlighter\\Language\\Xaml',
558 558
     'name' => 
559 559
     array (
560
-      0 => 'xaml',
560
+        0 => 'xaml',
561 561
     ),
562 562
     'mime' => 
563 563
     array (
564 564
     ),
565 565
     'extension' => 
566 566
     array (
567
-      0 => '*.xaml',
567
+        0 => '*.xaml',
568 568
     ),
569 569
     'standalone' => true,
570 570
     'injectable' => false,
571
-  ),
572
-  28 => 
573
-  array (
571
+    ),
572
+    28 => 
573
+    array (
574 574
     0 => 'Kadet\\Highlighter\\Language\\Xml',
575 575
     'name' => 
576 576
     array (
577
-      0 => 'xml',
577
+        0 => 'xml',
578 578
     ),
579 579
     'mime' => 
580 580
     array (
581
-      0 => 'application/xml',
582
-      1 => 'text/xml',
581
+        0 => 'application/xml',
582
+        1 => 'text/xml',
583 583
     ),
584 584
     'extension' => 
585 585
     array (
586
-      0 => '*.xml',
586
+        0 => '*.xml',
587 587
     ),
588 588
     'standalone' => true,
589 589
     'injectable' => false,
590
-  ),
590
+    ),
591 591
 );
592 592
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@  discard block
 block discarded – undo
1
-<?php return array (
1
+<?php return array(
2 2
   0 => 
3
-  array (
3
+  array(
4 4
     0 => 'Kadet\\Highlighter\\Language\\C',
5 5
     'name' => 
6
-    array (
6
+    array(
7 7
       0 => 'c',
8 8
     ),
9 9
     'mime' => 
10
-    array (
10
+    array(
11 11
       0 => 'text/x-csrc',
12 12
       1 => 'text/x-chdr',
13 13
     ),
14 14
     'extension' => 
15
-    array (
15
+    array(
16 16
       0 => '*.c',
17 17
       1 => '*.h',
18 18
       2 => '*.idc',
@@ -21,38 +21,38 @@  discard block
 block discarded – undo
21 21
     'injectable' => false,
22 22
   ),
23 23
   1 => 
24
-  array (
24
+  array(
25 25
     0 => 'Kadet\\Highlighter\\Language\\Cobol',
26 26
     'name' => 
27
-    array (
27
+    array(
28 28
       0 => 'cobol',
29 29
     ),
30 30
     'mime' => 
31
-    array (
31
+    array(
32 32
       0 => 'text/x-cobol',
33 33
     ),
34 34
     'extension' => 
35
-    array (
35
+    array(
36 36
       0 => '*.cbl',
37 37
     ),
38 38
     'standalone' => true,
39 39
     'injectable' => false,
40 40
   ),
41 41
   2 => 
42
-  array (
42
+  array(
43 43
     0 => 'Kadet\\Highlighter\\Language\\Cpp',
44 44
     'name' => 
45
-    array (
45
+    array(
46 46
       0 => 'cpp',
47 47
       1 => 'c++',
48 48
     ),
49 49
     'mime' => 
50
-    array (
50
+    array(
51 51
       0 => 'text/x-c++src',
52 52
       1 => 'text/x-c++hdr',
53 53
     ),
54 54
     'extension' => 
55
-    array (
55
+    array(
56 56
       0 => '*.cpp',
57 57
       1 => '*.hpp',
58 58
       2 => '*.hxx',
@@ -64,131 +64,131 @@  discard block
 block discarded – undo
64 64
     'injectable' => false,
65 65
   ),
66 66
   3 => 
67
-  array (
67
+  array(
68 68
     0 => 'Kadet\\Highlighter\\Language\\CSharp',
69 69
     'name' => 
70
-    array (
70
+    array(
71 71
       0 => 'CSharp',
72 72
       1 => 'C#',
73 73
     ),
74 74
     'mime' => 
75
-    array (
75
+    array(
76 76
       0 => 'text/x-csharp',
77 77
     ),
78 78
     'extension' => 
79
-    array (
79
+    array(
80 80
       0 => '*.cs',
81 81
     ),
82 82
     'standalone' => true,
83 83
     'injectable' => false,
84 84
   ),
85 85
   4 => 
86
-  array (
86
+  array(
87 87
     0 => 'Kadet\\Highlighter\\Language\\Css\\Less',
88 88
     'name' => 
89
-    array (
89
+    array(
90 90
       0 => 'less',
91 91
     ),
92 92
     'mime' => 
93
-    array (
93
+    array(
94 94
       0 => 'text/x-less',
95 95
     ),
96 96
     'extension' => 
97
-    array (
97
+    array(
98 98
       0 => '*.less',
99 99
     ),
100 100
     'standalone' => true,
101 101
     'injectable' => false,
102 102
   ),
103 103
   5 => 
104
-  array (
104
+  array(
105 105
     0 => 'Kadet\\Highlighter\\Language\\Css\\Sass',
106 106
     'name' => 
107
-    array (
107
+    array(
108 108
       0 => 'sass',
109 109
     ),
110 110
     'mime' => 
111
-    array (
111
+    array(
112 112
       0 => 'text/x-sass',
113 113
     ),
114 114
     'extension' => 
115
-    array (
115
+    array(
116 116
       0 => '*.sass',
117 117
     ),
118 118
     'standalone' => true,
119 119
     'injectable' => false,
120 120
   ),
121 121
   6 => 
122
-  array (
122
+  array(
123 123
     0 => 'Kadet\\Highlighter\\Language\\Css\\Scss',
124 124
     'name' => 
125
-    array (
125
+    array(
126 126
       0 => 'scss',
127 127
     ),
128 128
     'mime' => 
129
-    array (
129
+    array(
130 130
       0 => 'text/x-scss',
131 131
     ),
132 132
     'extension' => 
133
-    array (
133
+    array(
134 134
       0 => '*.scss',
135 135
     ),
136 136
     'standalone' => true,
137 137
     'injectable' => false,
138 138
   ),
139 139
   7 => 
140
-  array (
140
+  array(
141 141
     0 => 'Kadet\\Highlighter\\Language\\Css',
142 142
     'name' => 
143
-    array (
143
+    array(
144 144
       0 => 'css',
145 145
     ),
146 146
     'mime' => 
147
-    array (
147
+    array(
148 148
       0 => 'text/css',
149 149
     ),
150 150
     'extension' => 
151
-    array (
151
+    array(
152 152
       0 => '*.css',
153 153
     ),
154 154
     'standalone' => true,
155 155
     'injectable' => false,
156 156
   ),
157 157
   8 => 
158
-  array (
158
+  array(
159 159
     0 => 'Kadet\\Highlighter\\Language\\Go',
160 160
     'name' => 
161
-    array (
161
+    array(
162 162
       0 => 'go',
163 163
       1 => 'golang',
164 164
     ),
165 165
     'mime' => 
166
-    array (
166
+    array(
167 167
       0 => 'text/x-go',
168 168
       1 => 'application/x-go',
169 169
       2 => 'text/x-golang',
170 170
       3 => 'application/x-golang',
171 171
     ),
172 172
     'extension' => 
173
-    array (
173
+    array(
174 174
       0 => '*.go',
175 175
     ),
176 176
     'standalone' => true,
177 177
     'injectable' => false,
178 178
   ),
179 179
   9 => 
180
-  array (
180
+  array(
181 181
     0 => 'Kadet\\Highlighter\\Language\\Html',
182 182
     'name' => 
183
-    array (
183
+    array(
184 184
       0 => 'html',
185 185
     ),
186 186
     'mime' => 
187
-    array (
187
+    array(
188 188
       0 => 'text/html',
189 189
     ),
190 190
     'extension' => 
191
-    array (
191
+    array(
192 192
       0 => '*.html',
193 193
       1 => '*.htm',
194 194
     ),
@@ -196,35 +196,35 @@  discard block
 block discarded – undo
196 196
     'injectable' => false,
197 197
   ),
198 198
   10 => 
199
-  array (
199
+  array(
200 200
     0 => 'Kadet\\Highlighter\\Language\\Http',
201 201
     'name' => 
202
-    array (
202
+    array(
203 203
       0 => 'http',
204 204
     ),
205 205
     'mime' => 
206
-    array (
206
+    array(
207 207
     ),
208 208
     'extension' => 
209
-    array (
209
+    array(
210 210
     ),
211 211
     'standalone' => true,
212 212
     'injectable' => false,
213 213
   ),
214 214
   11 => 
215
-  array (
215
+  array(
216 216
     0 => 'Kadet\\Highlighter\\Language\\Ini',
217 217
     'name' => 
218
-    array (
218
+    array(
219 219
       0 => 'ini',
220 220
     ),
221 221
     'mime' => 
222
-    array (
222
+    array(
223 223
       0 => 'text/x-ini',
224 224
       1 => 'text/inf',
225 225
     ),
226 226
     'extension' => 
227
-    array (
227
+    array(
228 228
       0 => '*.ini',
229 229
       1 => '*.cfg',
230 230
       2 => '*.inf',
@@ -233,34 +233,34 @@  discard block
 block discarded – undo
233 233
     'injectable' => false,
234 234
   ),
235 235
   12 => 
236
-  array (
236
+  array(
237 237
     0 => 'Kadet\\Highlighter\\Language\\Java',
238 238
     'name' => 
239
-    array (
239
+    array(
240 240
       0 => 'java',
241 241
     ),
242 242
     'mime' => 
243
-    array (
243
+    array(
244 244
       0 => 'text/x-java',
245 245
     ),
246 246
     'extension' => 
247
-    array (
247
+    array(
248 248
       0 => '*.java',
249 249
     ),
250 250
     'standalone' => true,
251 251
     'injectable' => false,
252 252
   ),
253 253
   13 => 
254
-  array (
254
+  array(
255 255
     0 => 'Kadet\\Highlighter\\Language\\JavaScript',
256 256
     'name' => 
257
-    array (
257
+    array(
258 258
       0 => 'js',
259 259
       1 => 'jscript',
260 260
       2 => 'javascript',
261 261
     ),
262 262
     'mime' => 
263
-    array (
263
+    array(
264 264
       0 => 'application/javascript',
265 265
       1 => 'application/x-javascript',
266 266
       2 => 'text/x-javascript',
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
       4 => 'application/json',
269 269
     ),
270 270
     'extension' => 
271
-    array (
271
+    array(
272 272
       0 => '*.js',
273 273
       1 => '*.jsx',
274 274
     ),
@@ -276,20 +276,20 @@  discard block
 block discarded – undo
276 276
     'injectable' => false,
277 277
   ),
278 278
   14 => 
279
-  array (
279
+  array(
280 280
     0 => 'Kadet\\Highlighter\\Language\\Latex',
281 281
     'name' => 
282
-    array (
282
+    array(
283 283
       0 => 'tex',
284 284
       1 => 'latex',
285 285
     ),
286 286
     'mime' => 
287
-    array (
287
+    array(
288 288
       0 => 'application/x-tex',
289 289
       1 => 'application/x-latex',
290 290
     ),
291 291
     'extension' => 
292
-    array (
292
+    array(
293 293
       0 => '*.tex',
294 294
       1 => '*.aux',
295 295
       2 => '*.toc',
@@ -298,19 +298,19 @@  discard block
 block discarded – undo
298 298
     'injectable' => false,
299 299
   ),
300 300
   15 => 
301
-  array (
301
+  array(
302 302
     0 => 'Kadet\\Highlighter\\Language\\Markdown',
303 303
     'name' => 
304
-    array (
304
+    array(
305 305
       0 => 'markdown',
306 306
       1 => 'md',
307 307
     ),
308 308
     'mime' => 
309
-    array (
309
+    array(
310 310
       0 => 'text/markdown',
311 311
     ),
312 312
     'extension' => 
313
-    array (
313
+    array(
314 314
       0 => '*.markdown',
315 315
       1 => '*.md',
316 316
     ),
@@ -318,19 +318,19 @@  discard block
 block discarded – undo
318 318
     'injectable' => false,
319 319
   ),
320 320
   16 => 
321
-  array (
321
+  array(
322 322
     0 => 'Kadet\\Highlighter\\Language\\Perl',
323 323
     'name' => 
324
-    array (
324
+    array(
325 325
       0 => 'perl',
326 326
     ),
327 327
     'mime' => 
328
-    array (
328
+    array(
329 329
       0 => 'text/x-perl',
330 330
       1 => 'application/x-perl',
331 331
     ),
332 332
     'extension' => 
333
-    array (
333
+    array(
334 334
       0 => '*.pl',
335 335
       1 => '*.pm',
336 336
       2 => '*.t',
@@ -339,19 +339,19 @@  discard block
 block discarded – undo
339 339
     'injectable' => false,
340 340
   ),
341 341
   17 => 
342
-  array (
342
+  array(
343 343
     0 => 'Kadet\\Highlighter\\Language\\Php',
344 344
     'name' => 
345
-    array (
345
+    array(
346 346
       0 => 'php',
347 347
     ),
348 348
     'mime' => 
349
-    array (
349
+    array(
350 350
       0 => 'text/x-php',
351 351
       1 => 'application/x-php',
352 352
     ),
353 353
     'extension' => 
354
-    array (
354
+    array(
355 355
       0 => '*.php',
356 356
       1 => '*.phtml',
357 357
       2 => '*.inc',
@@ -361,39 +361,39 @@  discard block
 block discarded – undo
361 361
     'injectable' => true,
362 362
   ),
363 363
   18 => 
364
-  array (
364
+  array(
365 365
     0 => 'Kadet\\Highlighter\\Language\\PlainText',
366 366
     'name' => 
367
-    array (
367
+    array(
368 368
       0 => 'plaintext',
369 369
       1 => 'text',
370 370
       2 => 'none',
371 371
     ),
372 372
     'mime' => 
373
-    array (
373
+    array(
374 374
       0 => 'text/plain',
375 375
     ),
376 376
     'extension' => 
377
-    array (
377
+    array(
378 378
     ),
379 379
     'standalone' => true,
380 380
     'injectable' => false,
381 381
   ),
382 382
   19 => 
383
-  array (
383
+  array(
384 384
     0 => 'Kadet\\Highlighter\\Language\\PowerShell',
385 385
     'name' => 
386
-    array (
386
+    array(
387 387
       0 => 'powershell',
388 388
       1 => 'posh',
389 389
     ),
390 390
     'mime' => 
391
-    array (
391
+    array(
392 392
       0 => 'text/x-powershell',
393 393
       1 => 'application/x-powershell',
394 394
     ),
395 395
     'extension' => 
396
-    array (
396
+    array(
397 397
       0 => '*.ps1',
398 398
       1 => '*.psm1',
399 399
       2 => '*.psd1',
@@ -402,58 +402,58 @@  discard block
 block discarded – undo
402 402
     'injectable' => false,
403 403
   ),
404 404
   20 => 
405
-  array (
405
+  array(
406 406
     0 => 'Kadet\\Highlighter\\Language\\Python\\Django',
407 407
     'name' => 
408
-    array (
408
+    array(
409 409
       0 => 'django',
410 410
       1 => 'jinja',
411 411
     ),
412 412
     'mime' => 
413
-    array (
413
+    array(
414 414
       0 => 'application/x-django-templating',
415 415
       1 => 'application/x-jinja',
416 416
     ),
417 417
     'extension' => 
418
-    array (
418
+    array(
419 419
     ),
420 420
     'standalone' => false,
421 421
     'injectable' => true,
422 422
   ),
423 423
   21 => 
424
-  array (
424
+  array(
425 425
     0 => 'Kadet\\Highlighter\\Language\\Python',
426 426
     'name' => 
427
-    array (
427
+    array(
428 428
       0 => 'python',
429 429
       1 => 'py',
430 430
     ),
431 431
     'mime' => 
432
-    array (
432
+    array(
433 433
       0 => 'text/x-python',
434 434
       1 => 'application/x-python',
435 435
     ),
436 436
     'extension' => 
437
-    array (
437
+    array(
438 438
       0 => '*.py',
439 439
     ),
440 440
     'standalone' => true,
441 441
     'injectable' => false,
442 442
   ),
443 443
   22 => 
444
-  array (
444
+  array(
445 445
     0 => 'Kadet\\Highlighter\\Language\\Ruby',
446 446
     'name' => 
447
-    array (
447
+    array(
448 448
       0 => 'ruby',
449 449
     ),
450 450
     'mime' => 
451
-    array (
451
+    array(
452 452
       0 => 'text/x-ruby',
453 453
       1 => 'application/x-ruby',
454 454
     ),
455 455
     'extension' => 
456
-    array (
456
+    array(
457 457
       0 => '*.rb',
458 458
       1 => '*.rbw',
459 459
       2 => 'Rakefile',
@@ -467,22 +467,22 @@  discard block
 block discarded – undo
467 467
     'injectable' => false,
468 468
   ),
469 469
   23 => 
470
-  array (
470
+  array(
471 471
     0 => 'Kadet\\Highlighter\\Language\\Shell',
472 472
     'name' => 
473
-    array (
473
+    array(
474 474
       0 => 'shell',
475 475
       1 => 'bash',
476 476
       2 => 'zsh',
477 477
       3 => 'sh',
478 478
     ),
479 479
     'mime' => 
480
-    array (
480
+    array(
481 481
       0 => 'text/x-shellscript',
482 482
       1 => 'application/x-shellscript',
483 483
     ),
484 484
     'extension' => 
485
-    array (
485
+    array(
486 486
       0 => '*.sh',
487 487
       1 => '*.zsh',
488 488
       2 => '*.bash',
@@ -500,89 +500,89 @@  discard block
 block discarded – undo
500 500
     'injectable' => false,
501 501
   ),
502 502
   24 => 
503
-  array (
503
+  array(
504 504
     0 => 'Kadet\\Highlighter\\Language\\Sql\\MySql',
505 505
     'name' => 
506
-    array (
506
+    array(
507 507
       0 => 'mysql',
508 508
     ),
509 509
     'mime' => 
510
-    array (
510
+    array(
511 511
       0 => 'text/x-mysql',
512 512
     ),
513 513
     'extension' => 
514
-    array (
514
+    array(
515 515
     ),
516 516
     'standalone' => true,
517 517
     'injectable' => false,
518 518
   ),
519 519
   25 => 
520
-  array (
520
+  array(
521 521
     0 => 'Kadet\\Highlighter\\Language\\Sql',
522 522
     'name' => 
523
-    array (
523
+    array(
524 524
       0 => 'sql',
525 525
     ),
526 526
     'mime' => 
527
-    array (
527
+    array(
528 528
       0 => 'text/x-sql',
529 529
     ),
530 530
     'extension' => 
531
-    array (
531
+    array(
532 532
       0 => '*.sql',
533 533
     ),
534 534
     'standalone' => true,
535 535
     'injectable' => false,
536 536
   ),
537 537
   26 => 
538
-  array (
538
+  array(
539 539
     0 => 'Kadet\\Highlighter\\Language\\Twig',
540 540
     'name' => 
541
-    array (
541
+    array(
542 542
       0 => 'twig',
543 543
     ),
544 544
     'mime' => 
545
-    array (
545
+    array(
546 546
       0 => 'text/x-twig',
547 547
     ),
548 548
     'extension' => 
549
-    array (
549
+    array(
550 550
       0 => '*.twig',
551 551
     ),
552 552
     'standalone' => false,
553 553
     'injectable' => true,
554 554
   ),
555 555
   27 => 
556
-  array (
556
+  array(
557 557
     0 => 'Kadet\\Highlighter\\Language\\Xaml',
558 558
     'name' => 
559
-    array (
559
+    array(
560 560
       0 => 'xaml',
561 561
     ),
562 562
     'mime' => 
563
-    array (
563
+    array(
564 564
     ),
565 565
     'extension' => 
566
-    array (
566
+    array(
567 567
       0 => '*.xaml',
568 568
     ),
569 569
     'standalone' => true,
570 570
     'injectable' => false,
571 571
   ),
572 572
   28 => 
573
-  array (
573
+  array(
574 574
     0 => 'Kadet\\Highlighter\\Language\\Xml',
575 575
     'name' => 
576
-    array (
576
+    array(
577 577
       0 => 'xml',
578 578
     ),
579 579
     'mime' => 
580
-    array (
580
+    array(
581 581
       0 => 'application/xml',
582 582
       1 => 'text/xml',
583 583
     ),
584 584
     'extension' => 
585
-    array (
585
+    array(
586 586
       0 => '*.xml',
587 587
     ),
588 588
     'standalone' => true,
Please login to merge, or discard this patch.
bin/Commands/Test/RegenerateCommand.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -99,6 +99,9 @@
 block discarded – undo
99 99
             || $input->hasParameterOption('-r');
100 100
     }
101 101
 
102
+    /**
103
+     * @param string $filename
104
+     */
102 105
     private function regenerate(InputInterface $input, $filename) {
103 106
         $filename = str_replace(DIRECTORY_SEPARATOR, '/', $filename);
104 107
         $patterns = $input->getArgument('files');
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         /** @var \SplFileInfo $file */
60 60
         foreach ($iterator as $file) {
61 61
             $pathname = substr($file->getPathname(), strlen($this->_input) + 1);
62
-            if(!$this->regenerate($input, $pathname)) {
62
+            if (!$this->regenerate($input, $pathname)) {
63 63
                 continue;
64 64
             }
65 65
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             if ($this->review($input, $output, $tokens, $reviewer)) {
72 72
                 $result = StringHelper::normalize($this->_formatter->format($tokens));
73 73
 
74
-                if(!file_exists($this->_output.'/'.dirname($pathname))) {
74
+                if (!file_exists($this->_output.'/'.dirname($pathname))) {
75 75
                     mkdir($this->_output.'/'.dirname($pathname), true);
76 76
                 }
77 77
 
@@ -103,12 +103,12 @@  discard block
 block discarded – undo
103 103
         $filename = str_replace(DIRECTORY_SEPARATOR, '/', $filename);
104 104
         $patterns = $input->getArgument('files');
105 105
 
106
-        foreach($patterns as $pattern) {
107
-            if($input->getOption('new') && file_exists("{$this->_output}/$filename.tkn")) {
106
+        foreach ($patterns as $pattern) {
107
+            if ($input->getOption('new') && file_exists("{$this->_output}/$filename.tkn")) {
108 108
                 continue;
109 109
             }
110 110
 
111
-            if(fnmatch($pattern, $filename)) {
111
+            if (fnmatch($pattern, $filename)) {
112 112
                 return true;
113 113
             }
114 114
         }
Please login to merge, or discard this patch.
bin/Commands/Benchmark/AnalyzeCommand.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -16,9 +16,7 @@
 block discarded – undo
16 16
 namespace Kadet\Highlighter\bin\Commands\Benchmark;
17 17
 
18 18
 
19
-use Kadet\Highlighter\Formatter\FormatterInterface;
20 19
 use Kadet\Highlighter\KeyLighter;
21
-use Kadet\Highlighter\Language\Language;
22 20
 use Symfony\Component\Console\Command\Command;
23 21
 use Symfony\Component\Console\Helper\Table;
24 22
 use Symfony\Component\Console\Helper\TableCell;
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             $this->separator($file, $table);
50 50
 
51 51
             foreach ($data['times'] as $set => $times) {
52
-                $result = array_map(function ($time) use ($data, $input) {
52
+                $result = array_map(function($time) use ($data, $input) {
53 53
                     return $input->getOption('relative') ? $data['size'] / $time : $time * 1000;
54 54
                 }, $times);
55 55
 
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
             }
64 64
 
65 65
             foreach ($data['memory'] as $set => $memory) {
66
-                $result = array_map(function ($memory) use ($data, $input) {
67
-                    $bytes = $input->getOption('relative') ? $memory/$data['size'] : $memory;
66
+                $result = array_map(function($memory) use ($data, $input) {
67
+                    $bytes = $input->getOption('relative') ? $memory / $data['size'] : $memory;
68 68
                     return $this->formatBytes($bytes, (bool)$input->getOption('relative'));
69 69
                 }, $memory);
70 70
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         }, ARRAY_FILTER_USE_KEY);
82 82
 
83 83
         $max = max(array_map('strlen', array_keys($summary)));
84
-        foreach($summary as $name => $set) {
84
+        foreach ($summary as $name => $set) {
85 85
             $output->writeln(sprintf(
86 86
                 "<comment>%s</comment> %s %s",
87 87
                 str_pad($name, $max, ' ', STR_PAD_LEFT),
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     {
131 131
         $mean = array_sum($result) / count($result);
132 132
 
133
-        return sqrt(array_sum(array_map(function ($result) use ($mean) {
133
+        return sqrt(array_sum(array_map(function($result) use ($mean) {
134 134
             return pow($result - $mean, 2);
135 135
         }, $result)) / count($result));
136 136
     }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
         $bytes /= (1 << (10 * $pow));
146 146
 
147
-        return $this->format($bytes);//.$units[$pow].($relative ? '/byte' : '');
147
+        return $this->format($bytes); //.$units[$pow].($relative ? '/byte' : '');
148 148
     }
149 149
 
150 150
     protected function configure()
Please login to merge, or discard this patch.
bin/Commands/Benchmark/RunCommand.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -110,6 +110,9 @@  discard block
 block discarded – undo
110 110
         ;
111 111
     }
112 112
 
113
+    /**
114
+     * @param string $source
115
+     */
113 116
     protected function benchmark($source, Language $language, FormatterInterface $formatter, $geshi = null)
114 117
     {
115 118
         gc_collect_cycles(); // force garbage collector
@@ -161,6 +164,9 @@  discard block
 block discarded – undo
161 164
         ];
162 165
     }
163 166
 
167
+    /**
168
+     * @param string $source
169
+     */
164 170
     protected function geshi($source, $language)
165 171
     {
166 172
         $geshi = microtime(true);
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     protected function execute(InputInterface $input, OutputInterface $output)
33 33
     {
34
-        $dir = __DIR__ . 'BenchmarkCommand.php/' .static::DIRECTORY;
34
+        $dir = __DIR__.'BenchmarkCommand.php/'.static::DIRECTORY;
35 35
         $iterator = new \RecursiveIteratorIterator(
36 36
             new \RecursiveDirectoryIterator(
37 37
                 $dir,
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
 
69 69
             $times  = [];
70 70
             $memory = [];
71
-            for($i = $input->getOption('times'); $i > 0; $i--) {
71
+            for ($i = $input->getOption('times'); $i > 0; $i--) {
72 72
                 $result = $this->benchmark($source, $language, $formatter);
73 73
                 $times  = array_merge_recursive($times, $result['times']);
74 74
                 $memory = array_merge_recursive($memory, $result['memory']);
75 75
 
76
-                if($input->getOption('geshi') && class_exists('GeSHi')) {
76
+                if ($input->getOption('geshi') && class_exists('GeSHi')) {
77 77
                     $times['geshi'][] = $this->geshi($source, $file->getExtension());
78 78
                 }
79 79
             }
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
     {
173 173
         $result = json_encode($results, $input->getOption('pretty') ? JSON_PRETTY_PRINT : 0);
174 174
 
175
-        if($input->hasArgument('output')) {
175
+        if ($input->hasArgument('output')) {
176 176
             file_put_contents($input->getArgument('output'), $result);
177 177
         } else {
178 178
             $output->write($result);
Please login to merge, or discard this patch.