diff --git a/composer.json b/composer.json index 7301514ccaca..92f71ddb098a 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,6 @@ "mtdowling/cron-expression": "~1.0", "nesbot/carbon": "~1.20", "paragonie/random_compat": "~1.4|~2.0", - "psy/psysh": "0.7.*|0.8.*", "ramsey/uuid": "~3.0", "swiftmailer/swiftmailer": "~5.1", "symfony/console": "~3.2", @@ -105,6 +104,7 @@ "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.4).", "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", "guzzlehttp/guzzle": "Required to use the Mailgun and Mandrill mail drivers and the ping methods on schedules (~5.3|~6.0).", + "laravel/tinker": "Required to use the tinker console command (~1.0).", "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).", "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).", "pda/pheanstalk": "Required to use the beanstalk queue driver (~3.0).", diff --git a/src/Illuminate/Foundation/Console/IlluminateCaster.php b/src/Illuminate/Foundation/Console/IlluminateCaster.php deleted file mode 100644 index 3db75e6fd883..000000000000 --- a/src/Illuminate/Foundation/Console/IlluminateCaster.php +++ /dev/null @@ -1,98 +0,0 @@ -$property(); - - if (! is_null($val)) { - $results[Caster::PREFIX_VIRTUAL.$property] = $val; - } - } catch (Exception $e) { - // - } - } - - return $results; - } - - /** - * Get an array representing the properties of a collection. - * - * @param \Illuminate\Support\Collection $collection - * @return array - */ - public static function castCollection(Collection $collection) - { - return [ - Caster::PREFIX_VIRTUAL.'all' => $collection->all(), - ]; - } - - /** - * Get an array representing the properties of a model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return array - */ - public static function castModel(Model $model) - { - $attributes = array_merge( - $model->getAttributes(), $model->getRelations() - ); - - $visible = array_flip( - $model->getVisible() ?: array_diff(array_keys($attributes), $model->getHidden()) - ); - - $results = []; - - foreach (array_intersect_key($attributes, $visible) as $key => $value) { - $results[(isset($visible[$key]) ? Caster::PREFIX_VIRTUAL : Caster::PREFIX_PROTECTED).$key] = $value; - } - - return $results; - } -} diff --git a/src/Illuminate/Foundation/Console/TinkerCommand.php b/src/Illuminate/Foundation/Console/TinkerCommand.php deleted file mode 100644 index 68c48ae94192..000000000000 --- a/src/Illuminate/Foundation/Console/TinkerCommand.php +++ /dev/null @@ -1,100 +0,0 @@ -getApplication()->setCatchExceptions(false); - - $config = new Configuration; - - $config->getPresenter()->addCasters( - $this->getCasters() - ); - - $shell = new Shell($config); - $shell->addCommands($this->getCommands()); - $shell->setIncludes($this->argument('include')); - - $shell->run(); - } - - /** - * Get artisan commands to pass through to PsySH. - * - * @return array - */ - protected function getCommands() - { - $commands = []; - - foreach ($this->getApplication()->all() as $name => $command) { - if (in_array($name, $this->commandWhitelist)) { - $commands[] = $command; - } - } - - return $commands; - } - - /** - * Get an array of Laravel tailored casters. - * - * @return array - */ - protected function getCasters() - { - return [ - 'Illuminate\Foundation\Application' => 'Illuminate\Foundation\Console\IlluminateCaster::castApplication', - 'Illuminate\Support\Collection' => 'Illuminate\Foundation\Console\IlluminateCaster::castCollection', - 'Illuminate\Database\Eloquent\Model' => 'Illuminate\Foundation\Console\IlluminateCaster::castModel', - ]; - } - - /** - * Get the console command arguments. - * - * @return array - */ - protected function getArguments() - { - return [ - ['include', InputArgument::IS_ARRAY, 'Include file(s) before starting tinker'], - ]; - } -} diff --git a/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php b/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php index 0b3aa20ed933..bfbe4febf10f 100755 --- a/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php +++ b/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php @@ -10,7 +10,6 @@ use Illuminate\Auth\Console\ClearResetsCommand; use Illuminate\Cache\Console\CacheTableCommand; use Illuminate\Foundation\Console\ServeCommand; -use Illuminate\Foundation\Console\TinkerCommand; use Illuminate\Queue\Console\FailedTableCommand; use Illuminate\Foundation\Console\AppNameCommand; use Illuminate\Foundation\Console\JobMakeCommand; @@ -105,7 +104,6 @@ class ArtisanServiceProvider extends ServiceProvider 'ScheduleFinish' => 'Illuminate\Console\Scheduling\ScheduleFinishCommand', 'ScheduleRun' => 'Illuminate\Console\Scheduling\ScheduleRunCommand', 'StorageLink' => 'command.storage.link', - 'Tinker' => 'command.tinker', 'Up' => 'command.up', 'ViewClear' => 'command.view.clear', ]; @@ -797,18 +795,6 @@ protected function registerTestMakeCommand() }); } - /** - * Register the command. - * - * @return void - */ - protected function registerTinkerCommand() - { - $this->app->singleton('command.tinker', function () { - return new TinkerCommand; - }); - } - /** * Register the command. *