Skip to content

Commit f843b8a

Browse files
committed
formatting
1 parent 1b063b4 commit f843b8a

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

src/Console/DuskCommand.php

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -195,34 +195,6 @@ protected function setupDuskEnvironment()
195195
$this->setupSignalHandler();
196196
}
197197

198-
/**
199-
* Setup the SIGINT signal handler for CTRL+C exits.
200-
*
201-
* @return void
202-
*/
203-
protected function setupSignalHandler()
204-
{
205-
pcntl_async_signals(true);
206-
207-
pcntl_signal(SIGINT, function () {
208-
$this->teardownDuskEnviroment();
209-
});
210-
}
211-
212-
/**
213-
* Restore the original environment.
214-
*
215-
* @return void
216-
*/
217-
protected function teardownDuskEnviroment()
218-
{
219-
$this->removeConfiguration();
220-
221-
if (file_exists(base_path($this->duskFile())) && file_exists(base_path('.env.backup'))) {
222-
$this->restoreEnvironment();
223-
}
224-
}
225-
226198
/**
227199
* Backup the current environment file.
228200
*
@@ -235,26 +207,14 @@ protected function backupEnvironment()
235207
copy(base_path($this->duskFile()), base_path('.env'));
236208
}
237209

238-
/**
239-
* Restore the backed-up environment file.
240-
*
241-
* @return void
242-
*/
243-
protected function restoreEnvironment()
244-
{
245-
copy(base_path('.env.backup'), base_path('.env'));
246-
247-
unlink(base_path('.env.backup'));
248-
}
249-
250210
/**
251211
* Refresh the current environment variables.
252212
*
253213
* @return void
254214
*/
255215
protected function refreshEnvironment()
256216
{
257-
// BC fix to support Dotenv ^2.2
217+
// BC fix to support Dotenv ^2.2...
258218
if (! method_exists(Dotenv::class, 'create')) {
259219
(new Dotenv(base_path()))->overload();
260220

@@ -281,6 +241,34 @@ protected function writeConfiguration()
281241
$this->hasPhpUnitConfiguration = true;
282242
}
283243

244+
/**
245+
* Setup the SIGINT signal handler for CTRL+C exits.
246+
*
247+
* @return void
248+
*/
249+
protected function setupSignalHandler()
250+
{
251+
pcntl_async_signals(true);
252+
253+
pcntl_signal(SIGINT, function () {
254+
$this->teardownDuskEnviroment();
255+
});
256+
}
257+
258+
/**
259+
* Restore the original environment.
260+
*
261+
* @return void
262+
*/
263+
protected function teardownDuskEnviroment()
264+
{
265+
$this->removeConfiguration();
266+
267+
if (file_exists(base_path($this->duskFile())) && file_exists(base_path('.env.backup'))) {
268+
$this->restoreEnvironment();
269+
}
270+
}
271+
284272
/**
285273
* Remove the Dusk PHPUnit configuration.
286274
*
@@ -293,6 +281,18 @@ protected function removeConfiguration()
293281
}
294282
}
295283

284+
/**
285+
* Restore the backed-up environment file.
286+
*
287+
* @return void
288+
*/
289+
protected function restoreEnvironment()
290+
{
291+
copy(base_path('.env.backup'), base_path('.env'));
292+
293+
unlink(base_path('.env.backup'));
294+
}
295+
296296
/**
297297
* Get the name of the Dusk file for the environment.
298298
*

0 commit comments

Comments
 (0)