Skip to content

Commit

Permalink
Set raw output when using --execute (#63)
Browse files Browse the repository at this point in the history
* Set raw output when using `--execute`

* Update tests.yaml

* Format

Co-authored-by: Deeka Wong <[email protected]>
  • Loading branch information
huangdijia and huangdijia committed Nov 10, 2022
1 parent 3aa107e commit 800d02b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Command/TinkerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ public function handle()
$this->getCasters()
);

if ($this->input->getOption('execute')) {
$config->setRawOutput(true);
}

$shell = new Shell($config);

$shell->addCommands($this->getCommands());
Expand Down
3 changes: 2 additions & 1 deletion src/TinkerCaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

use Exception;
use ReflectionException;
use ReflectionObject;
use Symfony\Component\VarDumper\Caster\Caster;

class TinkerCaster
Expand Down Expand Up @@ -161,7 +162,7 @@ public static function castModel($model)
*/
public static function castRedis($redis)
{
$refObject = new \ReflectionObject($redis);
$refObject = new ReflectionObject($redis);
$refProperty = $refObject->getProperty('poolName');
$refProperty->setAccessible(true);

Expand Down

0 comments on commit 800d02b

Please sign in to comment.