@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | function &foo($bar) |
15 | 15 | { |
16 | - $baz = function () {}; |
|
16 | + $baz = function() {}; |
|
17 | 17 | $a = true ? true : false; |
18 | 18 | $b = "{$a}"; |
19 | 19 | $c = "${b}"; |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Represents foo. |
|
4 | - */ |
|
3 | + * Represents foo. |
|
4 | + */ |
|
5 | 5 | class Foo |
6 | 6 | { |
7 | 7 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | function &foo($bar) |
13 | 13 | { |
14 | - $baz = function () {}; |
|
14 | + $baz = function() {}; |
|
15 | 15 | $a = true ? true : false; |
16 | 16 | $b = "{$a}"; |
17 | 17 | $c = "${b}"; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | $factory = new File_Iterator_Factory; |
36 | 36 | $iterator = $factory->getFileIterator( |
37 | - $paths, $suffixes, $prefixes, $exclude |
|
37 | + $paths, $suffixes, $prefixes, $exclude |
|
38 | 38 | ); |
39 | 39 | |
40 | 40 | $files = array(); |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | |
59 | 59 | if ($commonPath) { |
60 | 60 | return array( |
61 | - 'commonPath' => $this->getCommonPath($files), |
|
62 | - 'files' => $files |
|
61 | + 'commonPath' => $this->getCommonPath($files), |
|
62 | + 'files' => $files |
|
63 | 63 | ); |
64 | 64 | } else { |
65 | 65 | return $files; |
@@ -101,7 +101,7 @@ |
||
101 | 101 | |
102 | 102 | while (!$done) { |
103 | 103 | for ($i = 0; $i < $count; $i++) { |
104 | - if ($_files[$i][$j] != $_files[$i+1][$j]) { |
|
104 | + if ($_files[$i][$j] != $_files[$i + 1][$j]) { |
|
105 | 105 | $done = TRUE; |
106 | 106 | break; |
107 | 107 | } |
@@ -54,15 +54,15 @@ |
||
54 | 54 | foreach ($paths as $path) { |
55 | 55 | if (is_dir($path)) { |
56 | 56 | $iterator->append( |
57 | - new File_Iterator( |
|
57 | + new File_Iterator( |
|
58 | 58 | new RecursiveIteratorIterator( |
59 | - new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::FOLLOW_SYMLINKS) |
|
59 | + new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::FOLLOW_SYMLINKS) |
|
60 | 60 | ), |
61 | 61 | $suffixes, |
62 | 62 | $prefixes, |
63 | 63 | $exclude, |
64 | 64 | $path |
65 | - ) |
|
65 | + ) |
|
66 | 66 | ); |
67 | 67 | } |
68 | 68 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | else { |
70 | 70 | throw new InvalidArgumentException( |
71 | - 'Template file could not be loaded.' |
|
71 | + 'Template file could not be loaded.' |
|
72 | 72 | ); |
73 | 73 | } |
74 | 74 | } |
@@ -120,14 +120,14 @@ discard block |
||
120 | 120 | $error = error_get_last(); |
121 | 121 | |
122 | 122 | throw new RuntimeException( |
123 | - sprintf( |
|
123 | + sprintf( |
|
124 | 124 | 'Could not write to %s: %s', |
125 | 125 | $target, |
126 | 126 | substr( |
127 | - $error['message'], |
|
128 | - strpos($error['message'], ':') + 2 |
|
127 | + $error['message'], |
|
128 | + strpos($error['message'], ':') + 2 |
|
129 | + ) |
|
129 | 130 | ) |
130 | - ) |
|
131 | 131 | ); |
132 | 132 | } |
133 | 133 | } |
@@ -60,13 +60,9 @@ |
||
60 | 60 | |
61 | 61 | if (file_exists($file)) { |
62 | 62 | $this->template = file_get_contents($file); |
63 | - } |
|
64 | - |
|
65 | - else if (file_exists($distFile)) { |
|
63 | + } else if (file_exists($distFile)) { |
|
66 | 64 | $this->template = file_get_contents($distFile); |
67 | - } |
|
68 | - |
|
69 | - else { |
|
65 | + } else { |
|
70 | 66 | throw new InvalidArgumentException( |
71 | 67 | 'Template file could not be loaded.' |
72 | 68 | ); |
@@ -19,9 +19,9 @@ |
||
19 | 19 | * @var array |
20 | 20 | */ |
21 | 21 | private static $times = array( |
22 | - 'hour' => 3600000, |
|
23 | - 'minute' => 60000, |
|
24 | - 'second' => 1000 |
|
22 | + 'hour' => 3600000, |
|
23 | + 'minute' => 60000, |
|
24 | + 'second' => 1000 |
|
25 | 25 | ); |
26 | 26 | |
27 | 27 | /** |
@@ -62,40 +62,40 @@ |
||
62 | 62 | public function secondsProvider() |
63 | 63 | { |
64 | 64 | return array( |
65 | - array('0 ms', 0), |
|
66 | - array('1 ms', .001), |
|
67 | - array('10 ms', .01), |
|
68 | - array('100 ms', .1), |
|
69 | - array('999 ms', .999), |
|
70 | - array('1 second', .9999), |
|
71 | - array('1 second', 1), |
|
72 | - array('2 seconds', 2), |
|
73 | - array('59.9 seconds', 59.9), |
|
74 | - array('59.99 seconds', 59.99), |
|
75 | - array('59.99 seconds', 59.999), |
|
76 | - array('1 minute', 59.9999), |
|
77 | - array('59 seconds', 59.001), |
|
78 | - array('59.01 seconds', 59.01), |
|
79 | - array('1 minute', 60), |
|
80 | - array('1.01 minutes', 61), |
|
81 | - array('2 minutes', 120), |
|
82 | - array('2.01 minutes', 121), |
|
83 | - array('59.99 minutes', 3599.9), |
|
84 | - array('59.99 minutes', 3599.99), |
|
85 | - array('59.99 minutes', 3599.999), |
|
86 | - array('1 hour', 3599.9999), |
|
87 | - array('59.98 minutes', 3599.001), |
|
88 | - array('59.98 minutes', 3599.01), |
|
89 | - array('1 hour', 3600), |
|
90 | - array('1 hour', 3601), |
|
91 | - array('1 hour', 3601.9), |
|
92 | - array('1 hour', 3601.99), |
|
93 | - array('1 hour', 3601.999), |
|
94 | - array('1 hour', 3601.9999), |
|
95 | - array('1.01 hours', 3659.9999), |
|
96 | - array('1.01 hours', 3659.001), |
|
97 | - array('1.01 hours', 3659.01), |
|
98 | - array('2 hours', 7199.9999), |
|
65 | + array('0 ms', 0), |
|
66 | + array('1 ms', .001), |
|
67 | + array('10 ms', .01), |
|
68 | + array('100 ms', .1), |
|
69 | + array('999 ms', .999), |
|
70 | + array('1 second', .9999), |
|
71 | + array('1 second', 1), |
|
72 | + array('2 seconds', 2), |
|
73 | + array('59.9 seconds', 59.9), |
|
74 | + array('59.99 seconds', 59.99), |
|
75 | + array('59.99 seconds', 59.999), |
|
76 | + array('1 minute', 59.9999), |
|
77 | + array('59 seconds', 59.001), |
|
78 | + array('59.01 seconds', 59.01), |
|
79 | + array('1 minute', 60), |
|
80 | + array('1.01 minutes', 61), |
|
81 | + array('2 minutes', 120), |
|
82 | + array('2.01 minutes', 121), |
|
83 | + array('59.99 minutes', 3599.9), |
|
84 | + array('59.99 minutes', 3599.99), |
|
85 | + array('59.99 minutes', 3599.999), |
|
86 | + array('1 hour', 3599.9999), |
|
87 | + array('59.98 minutes', 3599.001), |
|
88 | + array('59.98 minutes', 3599.01), |
|
89 | + array('1 hour', 3600), |
|
90 | + array('1 hour', 3601), |
|
91 | + array('1 hour', 3601.9), |
|
92 | + array('1 hour', 3601.99), |
|
93 | + array('1 hour', 3601.999), |
|
94 | + array('1 hour', 3601.9999), |
|
95 | + array('1.01 hours', 3659.9999), |
|
96 | + array('1.01 hours', 3659.001), |
|
97 | + array('1.01 hours', 3659.01), |
|
98 | + array('2 hours', 7199.9999), |
|
99 | 99 | ); |
100 | 100 | } |
101 | 101 | } |
@@ -297,10 +297,10 @@ discard block |
||
297 | 297 | { |
298 | 298 | if ($this->includes === null) { |
299 | 299 | $this->includes = array( |
300 | - 'require_once' => array(), |
|
301 | - 'require' => array(), |
|
302 | - 'include_once' => array(), |
|
303 | - 'include' => array() |
|
300 | + 'require_once' => array(), |
|
301 | + 'require' => array(), |
|
302 | + 'include_once' => array(), |
|
303 | + 'include' => array() |
|
304 | 304 | ); |
305 | 305 | |
306 | 306 | foreach ($this->tokens as $token) { |
@@ -369,29 +369,29 @@ discard block |
||
369 | 369 | $interfaceEndLine = $token->getEndLine(); |
370 | 370 | |
371 | 371 | $this->interfaces[$interface] = array( |
372 | - 'methods' => array(), |
|
373 | - 'parent' => $token->getParent(), |
|
374 | - 'keywords' => $token->getKeywords(), |
|
375 | - 'docblock' => $token->getDocblock(), |
|
376 | - 'startLine' => $token->getLine(), |
|
377 | - 'endLine' => $interfaceEndLine, |
|
378 | - 'package' => $token->getPackage(), |
|
379 | - 'file' => $this->filename |
|
372 | + 'methods' => array(), |
|
373 | + 'parent' => $token->getParent(), |
|
374 | + 'keywords' => $token->getKeywords(), |
|
375 | + 'docblock' => $token->getDocblock(), |
|
376 | + 'startLine' => $token->getLine(), |
|
377 | + 'endLine' => $interfaceEndLine, |
|
378 | + 'package' => $token->getPackage(), |
|
379 | + 'file' => $this->filename |
|
380 | 380 | ); |
381 | 381 | break; |
382 | 382 | |
383 | 383 | case 'PHP_Token_CLASS': |
384 | 384 | case 'PHP_Token_TRAIT': |
385 | 385 | $tmp = array( |
386 | - 'methods' => array(), |
|
387 | - 'parent' => $token->getParent(), |
|
388 | - 'interfaces'=> $token->getInterfaces(), |
|
389 | - 'keywords' => $token->getKeywords(), |
|
390 | - 'docblock' => $token->getDocblock(), |
|
391 | - 'startLine' => $token->getLine(), |
|
392 | - 'endLine' => $token->getEndLine(), |
|
393 | - 'package' => $token->getPackage(), |
|
394 | - 'file' => $this->filename |
|
386 | + 'methods' => array(), |
|
387 | + 'parent' => $token->getParent(), |
|
388 | + 'interfaces'=> $token->getInterfaces(), |
|
389 | + 'keywords' => $token->getKeywords(), |
|
390 | + 'docblock' => $token->getDocblock(), |
|
391 | + 'startLine' => $token->getLine(), |
|
392 | + 'endLine' => $token->getEndLine(), |
|
393 | + 'package' => $token->getPackage(), |
|
394 | + 'file' => $this->filename |
|
395 | 395 | ); |
396 | 396 | |
397 | 397 | if ($token instanceof PHP_Token_CLASS) { |
@@ -411,14 +411,14 @@ discard block |
||
411 | 411 | case 'PHP_Token_FUNCTION': |
412 | 412 | $name = $token->getName(); |
413 | 413 | $tmp = array( |
414 | - 'docblock' => $token->getDocblock(), |
|
415 | - 'keywords' => $token->getKeywords(), |
|
416 | - 'visibility'=> $token->getVisibility(), |
|
417 | - 'signature' => $token->getSignature(), |
|
418 | - 'startLine' => $token->getLine(), |
|
419 | - 'endLine' => $token->getEndLine(), |
|
420 | - 'ccn' => $token->getCCN(), |
|
421 | - 'file' => $this->filename |
|
414 | + 'docblock' => $token->getDocblock(), |
|
415 | + 'keywords' => $token->getKeywords(), |
|
416 | + 'visibility'=> $token->getVisibility(), |
|
417 | + 'signature' => $token->getSignature(), |
|
418 | + 'startLine' => $token->getLine(), |
|
419 | + 'endLine' => $token->getEndLine(), |
|
420 | + 'ccn' => $token->getCCN(), |
|
421 | + 'file' => $this->filename |
|
422 | 422 | ); |
423 | 423 | |
424 | 424 | if (empty($class) && |
@@ -398,8 +398,8 @@ discard block |
||
398 | 398 | $class[] = $token->getName(); |
399 | 399 | $classEndLine[] = $token->getEndLine(); |
400 | 400 | |
401 | - if ($class[count($class)-1] != 'anonymous class') { |
|
402 | - $this->classes[$class[count($class)-1]] = $tmp; |
|
401 | + if ($class[count($class) - 1] != 'anonymous class') { |
|
402 | + $this->classes[$class[count($class) - 1]] = $tmp; |
|
403 | 403 | } |
404 | 404 | } else { |
405 | 405 | $trait = $token->getName(); |
@@ -431,11 +431,11 @@ discard block |
||
431 | 431 | $tmp['startLine'], |
432 | 432 | $tmp['endLine'] |
433 | 433 | ); |
434 | - } elseif (!empty($class) && $class[count($class)-1] != 'anonymous class') { |
|
435 | - $this->classes[$class[count($class)-1]]['methods'][$name] = $tmp; |
|
434 | + } elseif (!empty($class) && $class[count($class) - 1] != 'anonymous class') { |
|
435 | + $this->classes[$class[count($class) - 1]]['methods'][$name] = $tmp; |
|
436 | 436 | |
437 | 437 | $this->addFunctionToMap( |
438 | - $class[count($class)-1] . '::' . $name, |
|
438 | + $class[count($class) - 1] . '::' . $name, |
|
439 | 439 | $tmp['startLine'], |
440 | 440 | $tmp['endLine'] |
441 | 441 | ); |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | |
455 | 455 | case 'PHP_Token_CLOSE_CURLY': |
456 | 456 | if (!empty($classEndLine) && |
457 | - $classEndLine[count($classEndLine)-1] == $token->getLine()) { |
|
457 | + $classEndLine[count($classEndLine) - 1] == $token->getLine()) { |
|
458 | 458 | array_pop($classEndLine); |
459 | 459 | array_pop($class); |
460 | 460 | } elseif ($traitEndLine !== false && |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | $this->assertEquals(array(), $this->functions[0]->getArguments()); |
44 | 44 | |
45 | 45 | $this->assertEquals( |
46 | - array('$baz' => 'Baz'), $this->functions[1]->getArguments() |
|
46 | + array('$baz' => 'Baz'), $this->functions[1]->getArguments() |
|
47 | 47 | ); |
48 | 48 | |
49 | 49 | $this->assertEquals( |
50 | - array('$foobar' => 'Foobar'), $this->functions[2]->getArguments() |
|
50 | + array('$foobar' => 'Foobar'), $this->functions[2]->getArguments() |
|
51 | 51 | ); |
52 | 52 | |
53 | 53 | $this->assertEquals( |
54 | - array('$barfoo' => 'Barfoo'), $this->functions[3]->getArguments() |
|
54 | + array('$barfoo' => 'Barfoo'), $this->functions[3]->getArguments() |
|
55 | 55 | ); |
56 | 56 | |
57 | 57 | $this->assertEquals(array(), $this->functions[4]->getArguments()); |
@@ -103,13 +103,13 @@ discard block |
||
103 | 103 | $this->assertNull($this->functions[0]->getDocblock()); |
104 | 104 | |
105 | 105 | $this->assertEquals( |
106 | - "/**\n * @param Baz \$baz\n */", |
|
107 | - $this->functions[1]->getDocblock() |
|
106 | + "/**\n * @param Baz \$baz\n */", |
|
107 | + $this->functions[1]->getDocblock() |
|
108 | 108 | ); |
109 | 109 | |
110 | 110 | $this->assertEquals( |
111 | - "/**\n * @param Foobar \$foobar\n */", |
|
112 | - $this->functions[2]->getDocblock() |
|
111 | + "/**\n * @param Foobar \$foobar\n */", |
|
112 | + $this->functions[2]->getDocblock() |
|
113 | 113 | ); |
114 | 114 | |
115 | 115 | $this->assertNull($this->functions[3]->getDocblock()); |
@@ -124,23 +124,23 @@ discard block |
||
124 | 124 | $i = $ts->getInterfaces(); |
125 | 125 | |
126 | 126 | $this->assertEquals( |
127 | - 'foo($a, array $b, array $c = array())', |
|
128 | - $f['foo']['signature'] |
|
127 | + 'foo($a, array $b, array $c = array())', |
|
128 | + $f['foo']['signature'] |
|
129 | 129 | ); |
130 | 130 | |
131 | 131 | $this->assertEquals( |
132 | - 'm($a, array $b, array $c = array())', |
|
133 | - $c['c']['methods']['m']['signature'] |
|
132 | + 'm($a, array $b, array $c = array())', |
|
133 | + $c['c']['methods']['m']['signature'] |
|
134 | 134 | ); |
135 | 135 | |
136 | 136 | $this->assertEquals( |
137 | - 'm($a, array $b, array $c = array())', |
|
138 | - $c['a']['methods']['m']['signature'] |
|
137 | + 'm($a, array $b, array $c = array())', |
|
138 | + $c['a']['methods']['m']['signature'] |
|
139 | 139 | ); |
140 | 140 | |
141 | 141 | $this->assertEquals( |
142 | - 'm($a, array $b, array $c = array())', |
|
143 | - $i['i']['methods']['m']['signature'] |
|
142 | + 'm($a, array $b, array $c = array())', |
|
143 | + $i['i']['methods']['m']['signature'] |
|
144 | 144 | ); |
145 | 145 | } |
146 | 146 | } |