Browse Source

Remove deprecated calls in Cake\Shell

Anthony GRASSIOT 9 years ago
parent
commit
9422f62e47

+ 1 - 1
src/Shell/CommandListShell.php

@@ -139,7 +139,7 @@ class CommandListShell extends Shell
     {
         $parser = parent::getOptionParser();
 
-        $parser->description(
+        $parser->setDescription(
             'Get the list of available shells for this CakePHP application.'
         )->addOption('xml', [
             'help' => 'Get the listing as XML.',

+ 2 - 2
src/Shell/CompletionShell.php

@@ -116,7 +116,7 @@ class CompletionShell extends Shell
     {
         $parser = parent::getOptionParser();
 
-        $parser->description(
+        $parser->setDescription(
             'Used by shells like bash to autocomplete command name, options and arguments'
         )->addSubcommand('commands', [
             'help' => 'Output a list of available commands',
@@ -151,7 +151,7 @@ class CompletionShell extends Shell
             ]
         ])->addSubcommand('fuzzy', [
             'help' => 'Guess autocomplete'
-        ])->epilog([
+        ])->setEpilog([
             'This command is not intended to be called manually',
         ]);
 

+ 1 - 1
src/Shell/I18nShell.php

@@ -147,7 +147,7 @@ class I18nShell extends Shell
             ]
         ];
 
-        $parser->description(
+        $parser->setDescription(
             'I18n Shell generates .pot files(s) with translations.'
         )->addSubcommand('extract', [
             'help' => 'Extract the po translations from your application',

+ 3 - 3
src/Shell/OrmCacheShell.php

@@ -71,7 +71,7 @@ class OrmCacheShell extends Shell
         if (empty($name)) {
             $tables = $schema->listTables();
         }
-        $configName = $schema->cacheMetadata();
+        $configName = $schema->getCacheMetadata();
 
         foreach ($tables as $table) {
             $this->_io->verbose(sprintf(
@@ -102,7 +102,7 @@ class OrmCacheShell extends Shell
                 'as it does not implement a "schemaCollection()" method.',
                 $this->params['connection']
             );
-            $this->error($msg);
+            $this->abort($msg);
 
             return false;
         }
@@ -112,7 +112,7 @@ class OrmCacheShell extends Shell
             $source->cacheMetadata(true);
         }
 
-        return $source->schemaCollection();
+        return $source->getSchemaCollection();
     }
 
     /**

+ 1 - 1
src/Shell/RoutesShell.php

@@ -109,7 +109,7 @@ class RoutesShell extends Shell
     public function getOptionParser()
     {
         $parser = parent::getOptionParser();
-        $parser->description(
+        $parser->setDescription(
             'Get the list of routes connected in this application. ' .
             'This tool also lets you test URL generation and URL parsing.'
         )->addSubcommand('check', [

+ 1 - 1
src/Shell/ServerShell.php

@@ -150,7 +150,7 @@ class ServerShell extends Shell
     {
         $parser = parent::getOptionParser();
 
-        $parser->description([
+        $parser->setDescription([
             'PHP Built-in Server for CakePHP',
             '<warning>[WARN] Don\'t use this in a production environment</warning>',
         ])->addOption('host', [