Aggiornato Composer
This commit is contained in:
@@ -52,6 +52,10 @@ class TinkerCommand extends Command
|
||||
$this->getCasters()
|
||||
);
|
||||
|
||||
if ($this->option('execute')) {
|
||||
$config->setRawOutput(true);
|
||||
}
|
||||
|
||||
$shell = new Shell($config);
|
||||
$shell->addCommands($this->getCommands());
|
||||
$shell->setIncludes($this->argument('include'));
|
||||
@@ -127,6 +131,10 @@ class TinkerCommand extends Command
|
||||
$casters['Illuminate\Database\Eloquent\Model'] = 'Laravel\Tinker\TinkerCaster::castModel';
|
||||
}
|
||||
|
||||
if (class_exists('Illuminate\Process\ProcessResult')) {
|
||||
$casters['Illuminate\Process\ProcessResult'] = 'Laravel\Tinker\TinkerCaster::castProcessResult';
|
||||
}
|
||||
|
||||
if (class_exists('Illuminate\Foundation\Application')) {
|
||||
$casters['Illuminate\Foundation\Application'] = 'Laravel\Tinker\TinkerCaster::castApplication';
|
||||
}
|
||||
|
||||
18
vendor/laravel/tinker/src/TinkerCaster.php
vendored
18
vendor/laravel/tinker/src/TinkerCaster.php
vendored
@@ -94,6 +94,22 @@ class TinkerCaster
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array representing the properties of a process result.
|
||||
*
|
||||
* @param \Illuminate\Process\ProcessResult $result
|
||||
* @return array
|
||||
*/
|
||||
public static function castProcessResult($result)
|
||||
{
|
||||
return [
|
||||
Caster::PREFIX_VIRTUAL.'output' => $result->output(),
|
||||
Caster::PREFIX_VIRTUAL.'errorOutput' => $result->errorOutput(),
|
||||
Caster::PREFIX_VIRTUAL.'exitCode' => $result->exitCode(),
|
||||
Caster::PREFIX_VIRTUAL.'successful' => $result->successful(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array representing the properties of a model.
|
||||
*
|
||||
@@ -113,7 +129,7 @@ class TinkerCaster
|
||||
$hidden = array_flip($model->getHidden());
|
||||
|
||||
$appends = (function () {
|
||||
return array_combine($this->appends, $this->appends);
|
||||
return array_combine($this->appends, $this->appends); // @phpstan-ignore-line
|
||||
})->bindTo($model, $model)();
|
||||
|
||||
foreach ($appends as $appended) {
|
||||
|
||||
@@ -20,7 +20,7 @@ class TinkerServiceProvider extends ServiceProvider implements DeferrableProvide
|
||||
$source = realpath($raw = __DIR__.'/../config/tinker.php') ?: $raw;
|
||||
|
||||
if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {
|
||||
$this->publishes([$source => config_path('tinker.php')]);
|
||||
$this->publishes([$source => $this->app->configPath('tinker.php')]);
|
||||
} elseif ($this->app instanceof LumenApplication) {
|
||||
$this->app->configure('tinker');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user