From b6fdfe0df79b6340c4fac8521f39fede75df5be0 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Tue, 17 Mar 2015 09:06:21 +0100 Subject: [PATCH] Tweak abstracts --- src/Console/MetaCommand.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Console/MetaCommand.php b/src/Console/MetaCommand.php index f6b8324..23e29bb 100644 --- a/src/Console/MetaCommand.php +++ b/src/Console/MetaCommand.php @@ -66,11 +66,8 @@ class MetaCommand extends Command { */ public function fire() { - $filename = $this->option('filename'); - $bindings = array(); - - foreach ($this->laravel->getBindings() as $abstract => $options) { + foreach ($this->getAbstracts() as $abstract) { try { $concrete = $this->laravel->make($abstract); if (is_object($concrete)) { @@ -86,6 +83,7 @@ class MetaCommand extends Command { 'methods' => $this->methods, ))->render(); + $filename = $this->option('filename'); $written = $this->files->put($filename, $content); if ($written !== false) { @@ -94,6 +92,16 @@ class MetaCommand extends Command { $this->error("The meta file could not be created at $filename"); } } + + /** + * Get a list of abstracts from the Laravel Application. + * + * @return array + */ + protected function getAbstracts() + { + return array_keys($this->laravel->getBindings()); + } /** * Get the console command options.