Skip to content
This repository was archived by the owner on Jan 9, 2024. It is now read-only.

Commit 87fe2ba

Browse files
authored
Apply fixes from StyleCI (#1)
1 parent dd7a018 commit 87fe2ba

File tree

9 files changed

+22
-24
lines changed

9 files changed

+22
-24
lines changed

config/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
* The host to use when listening for debug server connections.
66
*/
77
'host' => 'tcp://127.0.0.1:9914',
8-
];
8+
];

src/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function __construct($host)
1515

1616
public function write(array $namedParameters): bool
1717
{
18-
if (!$this->socket = $this->socket ?: $this->createSocket()) {
18+
if (! $this->socket = $this->socket ?: $this->createSocket()) {
1919
return false;
2020
}
2121

@@ -56,4 +56,4 @@ private function createSocket()
5656
restore_error_handler();
5757
}
5858
}
59-
}
59+
}

src/Console/TinkerServerCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected function createWarningFormatter()
3434
protected function createPsyShell()
3535
{
3636
$config = new Configuration([
37-
'updateCheck' => 'never'
37+
'updateCheck' => 'never',
3838
]);
3939

4040
$config->getPresenter()->addCasters(
@@ -61,6 +61,7 @@ protected function getCasters()
6161
if (class_exists('Illuminate\Foundation\Application')) {
6262
$casters['Illuminate\Foundation\Application'] = 'Laravel\Tinker\TinkerCaster::castApplication';
6363
}
64+
6465
return $casters;
6566
}
66-
}
67+
}

src/LaravelTinkerServerServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace BeyondCode\LaravelTinkerServer;
44

5-
use BeyondCode\LaravelTinkerServer\Console\TinkerServerCommand;
65
use Illuminate\Support\ServiceProvider;
6+
use BeyondCode\LaravelTinkerServer\Console\TinkerServerCommand;
77

88
class LaravelTinkerServerServiceProvider extends ServiceProvider
99
{
@@ -19,7 +19,7 @@ public function boot()
1919

2020
// Registering package commands.
2121
$this->commands([
22-
TinkerServerCommand::class
22+
TinkerServerCommand::class,
2323
]);
2424
}
2525
}

src/Server.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace BeyondCode\LaravelTinkerServer;
44

5-
use Clue\React\Stdio\Stdio;
65
use Psy\Shell;
6+
use Clue\React\Stdio\Stdio;
77
use React\EventLoop\Factory;
88
use React\EventLoop\LoopInterface;
99
use React\Socket\ConnectionInterface;
@@ -69,7 +69,6 @@ protected function createSocketServer()
6969

7070
$this->output->write($this->shellOutput->fetch());
7171
});
72-
7372
});
7473
});
7574
}
@@ -87,12 +86,12 @@ protected function createStdio()
8786

8887
$this->executeCode($line);
8988

90-
$this->output->write(PHP_EOL . $this->shellOutput->fetch());
89+
$this->output->write(PHP_EOL.$this->shellOutput->fetch());
9190
});
9291
}
9392

9493
protected function executeCode($code)
9594
{
9695
(new ExecutionClosure($this->shell, $code))->execute();
9796
}
98-
}
97+
}

src/Shell/ExecutionClosure.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
namespace BeyondCode\LaravelTinkerServer\Shell;
44

5+
use Psy\Shell;
56
use Psy\Exception\BreakException;
67
use Psy\Exception\ErrorException;
7-
use Psy\Exception\FatalErrorException;
88
use Psy\Exception\ThrowUpException;
99
use Psy\Exception\TypeErrorException;
1010
use Psy\ExecutionClosure as BaseExecutionClosure;
11-
use Psy\Shell;
1211

1312
class ExecutionClosure extends BaseExecutionClosure
1413
{
@@ -27,7 +26,6 @@ public function __construct(Shell $__psysh__, $__line__)
2726

2827
// Evaluate the current code buffer
2928
$_ = eval($__psysh__->onExecute($__psysh__->flushCode() ?: ExecutionClosure::NOOP_INPUT));
30-
3129
} catch (\Throwable $_e) {
3230
// Clean up on our way out.
3331
\restore_error_handler();
@@ -65,4 +63,4 @@ public function __construct(Shell $__psysh__, $__line__)
6563
return $_;
6664
});
6765
}
68-
}
66+
}

src/helpers.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
if (!function_exists('tinker')) {
3+
if (! function_exists('tinker')) {
44
function tinker(...$args)
55
{
66
/*
@@ -24,7 +24,7 @@ function tinker(...$args)
2424
})->map(function ($carry, $index) {
2525
return strpos($carry, '$') === 0
2626
? str_after($carry, '$')
27-
: 'temp' . $index;
27+
: 'temp'.$index;
2828
// ["post", "temp1"]
2929
})
3030
->combine($args)->all();
@@ -37,11 +37,11 @@ function tinker(...$args)
3737
}
3838
}
3939

40-
if (!function_exists('td')) {
40+
if (! function_exists('td')) {
4141
function td(...$args)
4242
{
4343
tinker($args);
4444

4545
die(1);
4646
}
47-
}
47+
}

tests/ConnectionTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace BeyondCode\LaravelTinkerServer\Tests;
44

5-
use BeyondCode\LaravelTinkerServer\Connection;
65
use PHPUnit\Framework\TestCase;
7-
use Symfony\Component\Process\Exception\ProcessTimedOutException;
8-
use Symfony\Component\Process\PhpProcess;
96
use Symfony\Component\Process\Process;
7+
use Symfony\Component\Process\PhpProcess;
8+
use BeyondCode\LaravelTinkerServer\Connection;
9+
use Symfony\Component\Process\Exception\ProcessTimedOutException;
1010

1111
class ConnectionTest extends TestCase
1212
{
@@ -67,4 +67,4 @@ protected function getServerProcess(): Process
6767

6868
return $process->setTimeout(3);
6969
}
70-
}
70+
}

tests/fixtures/server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
$output = new ConsoleOutput();
1414

1515
$config = new Configuration([
16-
'updateCheck' => 'never'
16+
'updateCheck' => 'never',
1717
]);
1818

1919
$shell = new \Psy\Shell($config);

0 commit comments

Comments
 (0)