Skip to content

Commit 95fc215

Browse files
committed
fix dd
1 parent 0828484 commit 95fc215

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

index.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@
1111
exit(1);
1212
}
1313

14+
function dd(...$args)
15+
{
16+
if (count($args) === 1) {
17+
return $args[0];
18+
}
19+
20+
return $args;
21+
}
22+
1423
$loader = Loader::load($arguments[1]);
1524

1625
if ($loader === null) {

src/Loaders/BaseLoader.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@
33
namespace TweakPHP\Client\Loaders;
44

55
use Psy\Configuration;
6+
use Psy\VersionUpdater\Checker;
67
use TweakPHP\Client\OutputModifiers\CustomOutputModifier;
78
use TweakPHP\Client\Tinker;
89

910
abstract class BaseLoader implements LoaderInterface
1011
{
11-
protected $tinker;
12+
protected Tinker $tinker;
1213

1314
public function init()
1415
{
1516
$config = new Configuration([
16-
'updateCheck' => 'never',
1717
'configFile' => null,
1818
]);
19+
$config->setUpdateCheck(Checker::NEVER);
1920
if (class_exists('Illuminate\Support\Collection') && class_exists('Laravel\Tinker\TinkerCaster')) {
2021
$config->getPresenter()->addCasters([
2122
\Illuminate\Support\Collection::class => 'Laravel\Tinker\TinkerCaster::castCollection',
@@ -31,6 +32,7 @@ public function init()
3132
\Illuminate\Foundation\Application::class => 'Laravel\Tinker\TinkerCaster::castApplication',
3233
]);
3334
}
35+
$config->setRawOutput(true);
3436

3537
$this->tinker = new Tinker(new CustomOutputModifier(), $config);
3638
}

src/Tinker.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@
99

1010
class Tinker
1111
{
12-
/** @var BufferedOutput */
13-
protected $output;
12+
protected BufferedOutput $output;
1413

15-
/** @var Shell */
16-
protected $shell;
14+
protected Shell $shell;
1715

18-
/** @var OutputModifier */
19-
protected $outputModifier;
16+
protected OutputModifier $outputModifier;
2017

2118
public function __construct(OutputModifier $outputModifier, $config)
2219
{
@@ -65,7 +62,6 @@ public function removeComments(string $code): string
6562
if (in_array($id, [T_COMMENT, T_DOC_COMMENT, T_OPEN_TAG, T_CLOSE_TAG])) {
6663
continue;
6764
}
68-
6965
$result .= $text;
7066
} else {
7167
$result .= $token;

0 commit comments

Comments
 (0)