[Pkg-owncloud-commits] [owncloud] 32/153: Type hinting.

David Prévot taffit at moszumanska.debian.org
Tue May 27 03:05:31 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 01141e1520bb10c0fe915f1e86d5814004b57277
Author: Andreas Fischer <bantu at owncloud.com>
Date:   Mon Mar 31 21:07:48 2014 +0200

    Type hinting.
---
 core/command/db/converttype.php | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/core/command/db/converttype.php b/core/command/db/converttype.php
index 464a5db..c38270d 100644
--- a/core/command/db/converttype.php
+++ b/core/command/db/converttype.php
@@ -9,6 +9,10 @@
 
 namespace OC\Core\Command\Db;
 
+use OC\Config;
+use OC\DB\Connection;
+use OC\DB\ConnectionFactory;
+
 use Symfony\Component\Console\Command\Command;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
@@ -30,7 +34,7 @@ class ConvertType extends Command {
 	 * @param \OC\Config $config
 	 * @param \OC\DB\ConnectionFactory $connectionFactory
 	 */
-	public function __construct($config, $connectionFactory) {
+	public function __construct(Config $config, ConnectionFactory $connectionFactory) {
 		$this->config = $config;
 		$this->connectionFactory = $connectionFactory;
 		parent::__construct();
@@ -139,7 +143,7 @@ class ConvertType extends Command {
 		$this->convertDB($fromDB, $toDB, $tables, $input, $output);
 	}
 
-	private function getToDBConnection($input, $output) {
+	private function getToDBConnection(InputInterface $input, OutputInterface $output) {
 		$type = $input->getArgument('type');
 		$connectionParams = array(
 			'host' => $input->getArgument('hostname'),
@@ -154,12 +158,12 @@ class ConvertType extends Command {
 		return $this->connectionFactory->getConnection($type, $connectionParams);
 	}
 
-	private function getTables($db) {
+	private function getTables(Connection $db) {
 		$schemaManager = $db->getSchemaManager();
 		return $schemaManager->listTableNames();
 	}
 
-	private function copyTable($fromDB, $toDB, $table, $output) {
+	private function copyTable(Connection $fromDB, Connection $toDB, $table, OutputInterface $output) {
 		$progress = $this->getHelperSet()->get('progress');
 		$query = 'SELECT COUNT(*) FROM '.$table;
 		$count = $fromDB->fetchColumn($query);
@@ -178,7 +182,7 @@ class ConvertType extends Command {
 		$progress->finish();
 	}
 
-	private function convertDB($fromDB, $toDB, $tables, $input, $output) {
+	private function convertDB(Connection $fromDB, Connection $toDB, array $tables, InputInterface $input, OutputInterface $output) {
 		$this->config->setValue('maintenance', true);
 		$type = $input->getArgument('type');
 		try {
@@ -209,7 +213,7 @@ class ConvertType extends Command {
 		$this->config->setValue('maintenance', false);
 	}
 
-	private function saveDBInfo($input) {
+	private function saveDBInfo(InputInterface $input) {
 		$type = $input->getArgument('type');
 		$username = $input->getArgument('username');
 		$dbhost = $input->getArgument('hostname');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list