Completed
Pull Request — master (#10)
by Amine
01:38
created
examples/RepeatCommand.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
     protected function init ()
8 8
     {
9 9
         $this->name('Repeat')
10
-             ->version('1.0.0')
11
-             ->description('Repeats a word a number of times')
12
-             ->syntax('word: string, count: (number: 3)')
13
-             ->options(['--upper'])
14
-             ->describe('word', 'The word to repeat')
15
-             ->describe('count', 'The number of times to repeat the word')
16
-             ->describe('--upper', 'Converts the result to uppercase');
10
+                ->version('1.0.0')
11
+                ->description('Repeats a word a number of times')
12
+                ->syntax('word: string, count: (number: 3)')
13
+                ->options(['--upper'])
14
+                ->describe('word', 'The word to repeat')
15
+                ->describe('count', 'The number of times to repeat the word')
16
+                ->describe('--upper', 'Converts the result to uppercase');
17 17
     }
18 18
 
19 19
     protected function execute()
Please login to merge, or discard this patch.
examples/RenderCommand.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,12 +7,12 @@
 block discarded – undo
7 7
     protected function init ()
8 8
     {
9 9
         $this->name('Render')
10
-             ->version('1.0.0')
11
-             ->description('Renders the hello template.')
12
-             ->syntax('name: (string:You)')
13
-             ->describe('name', 'Your name.')
14
-             ->templatesPath(TEMPLATES_PATH);
15
-             // this points to /tests/resources/templates
10
+                ->version('1.0.0')
11
+                ->description('Renders the hello template.')
12
+                ->syntax('name: (string:You)')
13
+                ->describe('name', 'Your name.')
14
+                ->templatesPath(TEMPLATES_PATH);
15
+                // this points to /tests/resources/templates
16 16
     }
17 17
 
18 18
     protected function execute()
Please login to merge, or discard this patch.
examples/ListCommand.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@
 block discarded – undo
7 7
     protected function init ()
8 8
     {
9 9
         $this->name('List')
10
-             ->version('1.0.0-alpha')
11
-             ->description('Lists files and directories in the current directory.');
10
+                ->version('1.0.0-alpha')
11
+                ->description('Lists files and directories in the current directory.');
12 12
     }
13 13
 
14 14
     protected function execute()
Please login to merge, or discard this patch.
examples/tests/ListCommandTest.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,16 +9,16 @@
 block discarded – undo
9 9
     public function test_it_list_files_and_directories()
10 10
     {
11 11
         $this->havingFile('demo.txt', 'Some text here!')
12
-             ->havingFile('doc.pdf')
13
-             ->havingDir('src')
14
-             ->command(new ListCommand)
15
-             ->printsExactly('demo.txt<br>doc.pdf<br>src<br>');
12
+                ->havingFile('doc.pdf')
13
+                ->havingDir('src')
14
+                ->command(new ListCommand)
15
+                ->printsExactly('demo.txt<br>doc.pdf<br>src<br>');
16 16
     }
17 17
 
18 18
     public function test_it_prints_nothing_when_no_files()
19 19
     {
20 20
         $this->command(new ListCommand)
21
-             ->printsExactly('');
21
+                ->printsExactly('');
22 22
     }
23 23
 
24 24
 }
Please login to merge, or discard this patch.
examples/tests/HelloWorldTest.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,15 +9,15 @@
 block discarded – undo
9 9
     public function test_it_prints_hello_world()
10 10
     {
11 11
         $this->withStdin("Amine\n")
12
-             ->command(new HelloWorld)
13
-             ->prints("Your name:")
14
-             ->prints("Hello Amine<br>");
12
+                ->command(new HelloWorld)
13
+                ->prints("Your name:")
14
+                ->prints("Hello Amine<br>");
15 15
     }
16 16
 
17 17
     public function test_it_shows_hello_world_version()
18 18
     {
19 19
         $this->command(new HelloWorld, ['--version'])
20
-             ->printsExactly("<info>Hello World</info> version <info>1.0.0-alpha</info><br>");
20
+                ->printsExactly("<info>Hello World</info> version <info>1.0.0-alpha</info><br>");
21 21
     }
22 22
 
23 23
 }
Please login to merge, or discard this patch.
examples/tests/RenderCommandTest.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,12 +9,12 @@
 block discarded – undo
9 9
     public function test_it_renders_the_template()
10 10
     {
11 11
         $this->command(new RenderCommand)
12
-             ->printsExactly("Hello You<br>");
12
+                ->printsExactly("Hello You<br>");
13 13
     }
14 14
 
15 15
     public function test_it_renders_with_custom_name()
16 16
     {
17 17
         $this->command(new RenderCommand, ['Foo'])
18
-             ->printsExactly("Hello Foo<br>");
18
+                ->printsExactly("Hello Foo<br>");
19 19
     }
20 20
 }
Please login to merge, or discard this patch.
examples/HelloWorld.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@
 block discarded – undo
7 7
     protected function init ()
8 8
     {
9 9
         $this->name('Hello World')
10
-             ->version('1.0.0-alpha')
11
-             ->description('Shows a "Hello World" message');
10
+                ->version('1.0.0-alpha')
11
+                ->description('Shows a "Hello World" message');
12 12
     }
13 13
 
14 14
     protected function execute()
Please login to merge, or discard this patch.
examples/tests/RepeatCommandTest.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -9,54 +9,54 @@
 block discarded – undo
9 9
     public function test_it_repeats_word_three_times()
10 10
     {
11 11
         $this->command(new RepeatCommand, ['foo'])
12
-             ->argsEqual((object) [
12
+                ->argsEqual((object) [
13 13
                 'word' => 'foo',
14 14
                 'count' => 3
15
-             ])
16
-             ->optionsEqual([
15
+                ])
16
+                ->optionsEqual([
17 17
                 '--upper' => false
18
-             ])
19
-             ->printsExactly("foofoofoo<br>");
18
+                ])
19
+                ->printsExactly("foofoofoo<br>");
20 20
     }
21 21
 
22 22
     public function test_it_repeats_word_n_times()
23 23
     {
24 24
         $this->command(new RepeatCommand, ['bar', '5'])
25
-             ->argsEqual((object) [
25
+                ->argsEqual((object) [
26 26
                 'word' => 'bar',
27 27
                 'count' => 5
28
-             ])
29
-             ->optionsEqual([
28
+                ])
29
+                ->optionsEqual([
30 30
                 '--upper' => false
31
-             ])
32
-             ->printsExactly("barbarbarbarbar<br>");
31
+                ])
32
+                ->printsExactly("barbarbarbarbar<br>");
33 33
     }
34 34
 
35 35
     public function test_it_repeats_word_n_times_uppercase()
36 36
     {
37 37
         $this->command(new RepeatCommand, ['bar', '5', '--upper'])
38
-             ->argsEqual((object) [
39
-               'word' => 'bar',
40
-               'count' => 5
41
-             ])
42
-             ->optionsEqual([
43
-               '--upper' => true
44
-             ])
45
-             ->printsExactly("BARBARBARBARBAR<br>");
38
+                ->argsEqual((object) [
39
+                'word' => 'bar',
40
+                'count' => 5
41
+                ])
42
+                ->optionsEqual([
43
+                '--upper' => true
44
+                ])
45
+                ->printsExactly("BARBARBARBARBAR<br>");
46 46
     }
47 47
 
48 48
     public function test_it_runs_interatively()
49 49
     {
50 50
         $this->withStdin("Yo\n\n\n")
51
-             ->command(new RepeatCommand, ['-i'])
52
-             ->argsEqual((object) [
53
-               'word' => 'Yo',
54
-               'count' => 3
55
-             ])
56
-             ->optionsEqual([
57
-               '--upper' => false
58
-             ])
59
-             ->prints("YoYoYo<br>");
51
+                ->command(new RepeatCommand, ['-i'])
52
+                ->argsEqual((object) [
53
+                'word' => 'Yo',
54
+                'count' => 3
55
+                ])
56
+                ->optionsEqual([
57
+                '--upper' => false
58
+                ])
59
+                ->prints("YoYoYo<br>");
60 60
     }
61 61
 
62 62
 }
Please login to merge, or discard this patch.
src/Commands/InteractiveCommand.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     protected function init()
27 27
     {
28 28
         $this->name('Interactive')
29
-             ->description('Reads the command arguments and options interactively.');
29
+                ->description('Reads the command arguments and options interactively.');
30 30
         $this->helper = SyntaxHelper::instance();
31 31
         $this->confirmSyntax = S::optional(S::boolean(), false);
32 32
     }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         $description = $this->parent->describe($name);
99 99
         $this->console->out(
100 100
             "<success>{$name}</success> <warn>{$text}</warn>"
101
-          . " {$description} <warn>{$default}</warn><br>"
101
+            . " {$description} <warn>{$default}</warn><br>"
102 102
         );
103 103
     }
104 104
 
Please login to merge, or discard this patch.