@@ -33,13 +33,13 @@ discard block |
||
33 | 33 | |
34 | 34 | $collection = $this->collectionBuilder(); |
35 | 35 | $taskGenerator = $collection->taskGenDoc("TestedRoboTask.md"); |
36 | - $taskGenerator->filterClasses(function (\ReflectionClass $r) { |
|
36 | + $taskGenerator->filterClasses(function(\ReflectionClass $r) { |
|
37 | 37 | return !($r->isAbstract() || $r->isTrait()) && $r->implementsInterface('Robo\Contract\TaskInterface'); |
38 | 38 | })->prepend("# TestedRoboTask Tasks"); |
39 | 39 | $taskGenerator->docClass('TestedRoboTask'); |
40 | 40 | |
41 | 41 | $taskGenerator->filterMethods( |
42 | - function (\ReflectionMethod $m) { |
|
42 | + function(\ReflectionMethod $m) { |
|
43 | 43 | if ($m->isConstructor() || $m->isDestructor() || $m->isStatic()) { |
44 | 44 | return false; |
45 | 45 | } |
@@ -65,21 +65,21 @@ discard block |
||
65 | 65 | return !in_array($m->name, $undocumentedMethods) && $m->isPublic(); // methods are not documented |
66 | 66 | } |
67 | 67 | )->processClassSignature( |
68 | - function ($c) { |
|
68 | + function($c) { |
|
69 | 69 | return "## " . preg_replace('~Task$~', '', $c->getShortName()) . "\n"; |
70 | 70 | } |
71 | 71 | )->processClassDocBlock( |
72 | - function (\ReflectionClass $c, $doc) { |
|
72 | + function(\ReflectionClass $c, $doc) { |
|
73 | 73 | $doc = preg_replace('~@method .*?(.*?)\)~', '* `$1)` ', $doc); |
74 | - $doc = str_replace('\\'.$c->name, '', $doc); |
|
74 | + $doc = str_replace('\\' . $c->name, '', $doc); |
|
75 | 75 | return $doc; |
76 | 76 | } |
77 | 77 | )->processMethodSignature( |
78 | - function (\ReflectionMethod $m, $text) { |
|
78 | + function(\ReflectionMethod $m, $text) { |
|
79 | 79 | return str_replace('#### *public* ', '* `', $text) . '`'; |
80 | 80 | } |
81 | 81 | )->processMethodDocBlock( |
82 | - function (\ReflectionMethod $m, $text) { |
|
82 | + function(\ReflectionMethod $m, $text) { |
|
83 | 83 | |
84 | 84 | return $text ? ' ' . trim(strtok($text, "\n"), "\n") : ''; |
85 | 85 | } |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | { |
28 | 28 | // write lines with WriteToFile task |
29 | 29 | $result = $this->taskWriteToFile('blogpost.md') |
30 | - ->line('****') |
|
31 | - ->line('hello world') |
|
32 | - ->line('****') |
|
33 | - ->run(); |
|
30 | + ->line('****') |
|
31 | + ->line('hello world') |
|
32 | + ->line('****') |
|
33 | + ->run(); |
|
34 | 34 | $this->assertTrue($result->wasSuccessful()); |
35 | 35 | $this->assertFileExists('blogpost.md'); |
36 | 36 | $contents = file_get_contents('blogpost.md'); |
@@ -46,9 +46,9 @@ discard block |
||
46 | 46 | public function appendToFile() |
47 | 47 | { |
48 | 48 | $result = $this->taskWriteToFile('a.txt') |
49 | - ->append() |
|
50 | - ->line('hello world') |
|
51 | - ->run(); |
|
49 | + ->append() |
|
50 | + ->line('hello world') |
|
51 | + ->run(); |
|
52 | 52 | $this->assertTrue($result->wasSuccessful()); |
53 | 53 | $this->assertFileExists('a.txt'); |
54 | 54 | $contents = file_get_contents('a.txt'); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | public function testWouldChange() |
63 | 63 | { |
64 | 64 | $writeTask = $this->taskWriteToFile('a.txt') |
65 | - ->append(); |
|
65 | + ->append(); |
|
66 | 66 | $this->assertEquals(false, $writeTask->wouldChange(), "No changes to test file."); |
67 | 67 | $writeTask->line('hello world'); |
68 | 68 | $this->assertEquals(true, $writeTask->wouldChange(), "Test file would change."); |
@@ -90,15 +90,15 @@ discard block |
||
90 | 90 | { |
91 | 91 | // append lines with WriteToFile task, but only if pattern does not match |
92 | 92 | $result = $this->taskWriteToFile('blogpost.md') |
93 | - ->line('****') |
|
94 | - ->line('hello world') |
|
95 | - ->line('****') |
|
96 | - ->appendUnlessMatches('/hello/', 'Should not add this') |
|
97 | - ->appendUnlessMatches('/goodbye/', 'Should add this') |
|
98 | - ->appendIfMatches('/hello/', ' and should also add this') |
|
99 | - ->appendIfMatches('/goodbye/', ' but should not add this') |
|
100 | - ->appendIfMatches('/should/', '!') |
|
101 | - ->run(); |
|
93 | + ->line('****') |
|
94 | + ->line('hello world') |
|
95 | + ->line('****') |
|
96 | + ->appendUnlessMatches('/hello/', 'Should not add this') |
|
97 | + ->appendUnlessMatches('/goodbye/', 'Should add this') |
|
98 | + ->appendIfMatches('/hello/', ' and should also add this') |
|
99 | + ->appendIfMatches('/goodbye/', ' but should not add this') |
|
100 | + ->appendIfMatches('/should/', '!') |
|
101 | + ->run(); |
|
102 | 102 | $this->assertTrue($result->wasSuccessful()); |
103 | 103 | $this->assertFileExists('blogpost.md'); |
104 | 104 | $contents = file_get_contents('blogpost.md'); |