Passed
Push — master ( 5e9e4e...a80842 )
by Caen
14:29
created
packages/publications/src/Commands/ValidatePublicationsCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     {
66 66
         $this->timeStart = microtime(true);
67 67
 
68
-        if (! $this->option('json')) {
68
+        if (!$this->option('json')) {
69 69
             $this->title('Validating publications!');
70 70
         }
71 71
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $name = $this->argument('publicationType');
100 100
 
101 101
         if (filled($name)) {
102
-            if (! $publicationTypes->has($name)) {
102
+            if (!$publicationTypes->has($name)) {
103 103
                 throw new InvalidArgumentException("Publication type [$name] does not exist");
104 104
             }
105 105
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
     protected function getMessageTypesInResult(array $results): array
183 183
     {
184
-        return array_map(function (string $result): string {
184
+        return array_map(function(string $result): string {
185 185
             return explode(':', $result)[0];
186 186
         }, array_values($results));
187 187
     }
Please login to merge, or discard this patch.
packages/publications/src/Commands/ValidatePublicationTypesCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     {
46 46
         $timeStart = microtime(true);
47 47
 
48
-        if (! $this->option('json')) {
48
+        if (!$this->option('json')) {
49 49
             $this->title('Validating publication schemas!');
50 50
         }
51 51
 
Please login to merge, or discard this patch.
packages/publications/tests/Feature/SeedPublicationCommandTest.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
     public function test_can_seed_publications_using_arguments()
41 41
     {
42 42
         $this->artisan('seed:publications test-publication 1')
43
-             ->expectsOutputToContain('Seeding new publications!')
44
-             ->assertExitCode(0);
43
+                ->expectsOutputToContain('Seeding new publications!')
44
+                ->assertExitCode(0);
45 45
 
46 46
         $this->assertPublicationsCreated();
47 47
     }
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
     public function test_can_seed_multiple_publications()
50 50
     {
51 51
         $this->artisan('seed:publications test-publication 2')
52
-             ->expectsOutputToContain('Seeding new publications!')
53
-             ->expectsOutputToContain('2 publications for Test Publication created!')
54
-             ->assertExitCode(0);
52
+                ->expectsOutputToContain('Seeding new publications!')
53
+                ->expectsOutputToContain('2 publications for Test Publication created!')
54
+                ->assertExitCode(0);
55 55
 
56 56
         $this->assertPublicationsCreated(2);
57 57
     }
@@ -59,12 +59,12 @@  discard block
 block discarded – undo
59 59
     public function test_command_asks_to_confirm_before_creating_many_publications()
60 60
     {
61 61
         $this->artisan('seed:publications')
62
-             ->expectsOutputToContain('Seeding new publications!')
63
-             ->expectsQuestion('Which publication type would you like to seed?', 'test-publication')
64
-             ->expectsQuestion('How many publications would you like to generate', 10000)
65
-             ->expectsOutputToContain('Warning: Generating a large number of publications may take a while. Expected time: 10 seconds.')
66
-             ->expectsConfirmation('Are you sure you want to continue?', false)
67
-             ->assertExitCode(130);
62
+                ->expectsOutputToContain('Seeding new publications!')
63
+                ->expectsQuestion('Which publication type would you like to seed?', 'test-publication')
64
+                ->expectsQuestion('How many publications would you like to generate', 10000)
65
+                ->expectsOutputToContain('Warning: Generating a large number of publications may take a while. Expected time: 10 seconds.')
66
+                ->expectsConfirmation('Are you sure you want to continue?', false)
67
+                ->assertExitCode(130);
68 68
 
69 69
         $this->assertPublicationsCreated(0);
70 70
     }
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
     public function test_command_asks_to_confirm_before_creating_many_publications_when_using_arguments()
73 73
     {
74 74
         $this->artisan('seed:publications test-publication 10000')
75
-             ->expectsOutputToContain('Seeding new publications!')
76
-             ->expectsOutputToContain('Warning: Generating a large number of publications may take a while. Expected time: 10 seconds.')
77
-             ->expectsConfirmation('Are you sure you want to continue?', false)
78
-             ->assertExitCode(130);
75
+                ->expectsOutputToContain('Seeding new publications!')
76
+                ->expectsOutputToContain('Warning: Generating a large number of publications may take a while. Expected time: 10 seconds.')
77
+                ->expectsConfirmation('Are you sure you want to continue?', false)
78
+                ->assertExitCode(130);
79 79
 
80 80
         $this->assertPublicationsCreated(0);
81 81
     }
Please login to merge, or discard this patch.
packages/publications/tests/Feature/ValidatingCommandTest.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
         $command = new ValidationTestCommand();
28 28
         $output = Mockery::mock(OutputStyle::class);
29 29
 
30
-        $output->shouldReceive('ask')->once()->withArgs(function (string $question) {
30
+        $output->shouldReceive('ask')->once()->withArgs(function(string $question) {
31 31
             return $question === 'What is your name?';
32 32
         })->andReturn('Jane Doe');
33 33
 
34
-        $output->shouldReceive('writeln')->once()->withArgs(function (string $message) {
34
+        $output->shouldReceive('writeln')->once()->withArgs(function(string $message) {
35 35
             return $message === 'Hello Jane Doe!';
36 36
         });
37 37
 
@@ -44,15 +44,15 @@  discard block
 block discarded – undo
44 44
         $command = new ValidationTestCommand();
45 45
         $output = Mockery::mock(OutputStyle::class);
46 46
 
47
-        $output->shouldReceive('ask')->times(2)->withArgs(function (string $question) {
47
+        $output->shouldReceive('ask')->times(2)->withArgs(function(string $question) {
48 48
             return $question === 'What is your name?';
49 49
         })->andReturn('', 'Jane Doe');
50 50
 
51
-        $output->shouldReceive('writeln')->times(1)->withArgs(function (string $message) {
51
+        $output->shouldReceive('writeln')->times(1)->withArgs(function(string $message) {
52 52
             return $message === '<error>The name field is required.</error>';
53 53
         });
54 54
 
55
-        $output->shouldReceive('writeln')->once()->withArgs(function (string $message) {
55
+        $output->shouldReceive('writeln')->once()->withArgs(function(string $message) {
56 56
             return $message === 'Hello Jane Doe!';
57 57
         });
58 58
 
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
         $command = new ValidationTestCommand();
66 66
         $output = Mockery::mock(OutputStyle::class);
67 67
 
68
-        $output->shouldReceive('ask')->times(30)->withArgs(function (string $question) {
68
+        $output->shouldReceive('ask')->times(30)->withArgs(function(string $question) {
69 69
             return $question === 'What is your name?';
70 70
         })->andReturn('');
71 71
 
72
-        $output->shouldReceive('writeln')->times(30)->withArgs(function (string $message) {
72
+        $output->shouldReceive('writeln')->times(30)->withArgs(function(string $message) {
73 73
             return $message === '<error>The name field is required.</error>';
74 74
         });
75 75
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         $command->setOutput($output);
80 80
         $command->handle();
81 81
 
82
-        $output->shouldNotReceive('writeln')->once()->withArgs(function (string $message) {
82
+        $output->shouldNotReceive('writeln')->once()->withArgs(function(string $message) {
83 83
             return str_starts_with($message, 'Hello');
84 84
         });
85 85
     }
@@ -88,17 +88,17 @@  discard block
 block discarded – undo
88 88
     {
89 89
         $inputs = [];
90 90
         $command = new DynamicValidatingTestCommand();
91
-        $command->closure = function (ValidatingCommand $command) use (&$inputs) {
91
+        $command->closure = function(ValidatingCommand $command) use (&$inputs) {
92 92
             $inputs[] = $command->askWithValidation('true', 'True?', ['boolean']);
93 93
             $inputs[] = $command->askWithValidation('false', 'False?', ['boolean']);
94 94
         };
95 95
         $output = Mockery::mock(OutputStyle::class);
96 96
 
97
-        $output->shouldReceive('ask')->once()->withArgs(function (string $question) {
97
+        $output->shouldReceive('ask')->once()->withArgs(function(string $question) {
98 98
             return $question === 'True?';
99 99
         })->andReturn('true');
100 100
 
101
-        $output->shouldReceive('ask')->once()->withArgs(function (string $question) {
101
+        $output->shouldReceive('ask')->once()->withArgs(function(string $question) {
102 102
             return $question === 'False?';
103 103
         })->andReturn('false');
104 104
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         $output->shouldReceive('writeln')->once();
118 118
 
119 119
         $validator = Validator::spy();
120
-        $validator->shouldReceive('make')->once()->withArgs(function (array $data, array $rules) {
120
+        $validator->shouldReceive('make')->once()->withArgs(function(array $data, array $rules) {
121 121
             return $data === ['name' => 'Jane Doe']
122 122
                 && $rules === ['name' => ['required']];
123 123
         })->andReturn($validator);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         $command = new ReloadableChoiceTestCommand();
133 133
         $output = Mockery::mock(OutputStyle::class);
134 134
 
135
-        $output->shouldReceive('askQuestion')->once()->withArgs(function (ChoiceQuestion $question) {
135
+        $output->shouldReceive('askQuestion')->once()->withArgs(function(ChoiceQuestion $question) {
136 136
             return $this->assertEqualsAsBoolean(new ChoiceQuestion('Select an option', [
137 137
                 '<fg=bright-blue>[Reload options]</>',
138 138
                 'foo',
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             ], null), $question);
142 142
         })->andReturn('foo');
143 143
 
144
-        $output->shouldReceive('writeln')->once()->withArgs(function (string $message) {
144
+        $output->shouldReceive('writeln')->once()->withArgs(function(string $message) {
145 145
             return $message === 'You selected foo';
146 146
         });
147 147
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
         $command = new ReloadableChoiceTestCommand();
155 155
         $output = Mockery::mock(OutputStyle::class);
156 156
 
157
-        $output->shouldReceive('askQuestion')->once()->withArgs(function (ChoiceQuestion $question) {
157
+        $output->shouldReceive('askQuestion')->once()->withArgs(function(ChoiceQuestion $question) {
158 158
             return $this->assertEqualsAsBoolean(new ChoiceQuestion('Select an option', [
159 159
                 '<fg=bright-blue>[Reload options]</>',
160 160
                 'foo',
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             ], null), $question);
164 164
         })->andReturn('<fg=bright-blue>[Reload options]</>');
165 165
 
166
-        $output->shouldReceive('askQuestion')->once()->withArgs(function (ChoiceQuestion $question) {
166
+        $output->shouldReceive('askQuestion')->once()->withArgs(function(ChoiceQuestion $question) {
167 167
             return $this->assertEqualsAsBoolean(new ChoiceQuestion('Select an option', [
168 168
                 '<fg=bright-blue>[Reload options]</>',
169 169
                 'bar',
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
             ], null), $question);
173 173
         })->andReturn('qux');
174 174
 
175
-        $output->shouldReceive('writeln')->once()->withArgs(function (string $message) {
175
+        $output->shouldReceive('writeln')->once()->withArgs(function(string $message) {
176 176
             return $message === 'You selected qux';
177 177
         });
178 178
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 
210 210
     public function handle(): int
211 211
     {
212
-        $selection = $this->reloadableChoice(function () {
212
+        $selection = $this->reloadableChoice(function() {
213 213
             if ($this->isFirstRun) {
214 214
                 $this->isFirstRun = false;
215 215
 
Please login to merge, or discard this patch.
packages/publications/tests/Feature/MakePublicationTypeCommandTest.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -185,8 +185,8 @@
 block discarded – undo
185 185
         $this->file('test-publication/foo');
186 186
 
187 187
         $this->artisan('make:publicationType "Test Publication"')
188
-             ->expectsOutput('Error: Storage path [test-publication] already exists')
189
-             ->assertExitCode(1);
188
+                ->expectsOutput('Error: Storage path [test-publication] already exists')
189
+                ->assertExitCode(1);
190 190
     }
191 191
 
192 192
     public function testWithTagFieldInput()
Please login to merge, or discard this patch.
packages/publications/tests/Feature/InputStreamHandlerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
     {
90 90
         $command = new TestCommand;
91 91
         $output = Mockery::mock(OutputStyle::class);
92
-        $output->shouldReceive('writeln')->once()->withArgs(function (string $message) use ($expected) {
92
+        $output->shouldReceive('writeln')->once()->withArgs(function(string $message) use ($expected) {
93 93
             return $message === json_encode($expected);
94 94
         });
95 95
         $command->setOutput($output);
Please login to merge, or discard this patch.
packages/publications/tests/Feature/ValidatePublicationsCommandTest.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
 ');
76 76
 
77 77
         $this->artisan('validate:publications', ['--verbose' => true])
78
-             ->expectsOutputToContain('Validated 1 publication types, 1 publications, 1 fields')
79
-             ->expectsOutput('Found 0 Warnings')
80
-             ->expectsOutput('Found 0 Errors')
81
-             ->assertExitCode(0);
78
+                ->expectsOutputToContain('Validated 1 publication types, 1 publications, 1 fields')
79
+                ->expectsOutput('Found 0 Warnings')
80
+                ->expectsOutput('Found 0 Errors')
81
+                ->assertExitCode(0);
82 82
     }
83 83
 
84 84
     public function testWithInvalidPublication()
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
 ');
93 93
 
94 94
         $this->artisan('validate:publications')
95
-             ->expectsOutputToContain('Validated 1 publication types, 1 publications, 1 fields')
96
-             ->expectsOutput('Found 0 Warnings')
97
-             ->expectsOutput('Found 1 Errors')
98
-             ->assertExitCode(1);
95
+                ->expectsOutputToContain('Validated 1 publication types, 1 publications, 1 fields')
96
+                ->expectsOutput('Found 0 Warnings')
97
+                ->expectsOutput('Found 1 Errors')
98
+                ->assertExitCode(1);
99 99
     }
100 100
 
101 101
     public function testWithWarnedPublication()
Please login to merge, or discard this patch.