Aggiornato Composer

This commit is contained in:
Paolo A
2024-05-17 12:24:19 +00:00
parent 4ac62108b5
commit ec201d75b2
2238 changed files with 38684 additions and 59785 deletions

View File

@@ -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';
}

View File

@@ -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) {

View File

@@ -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');
}