From aa1a0a15eaaa39f2a5fee7d14760312428f39430 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 30 Nov 2015 10:12:15 +0100 Subject: [PATCH] Fix use statements --- lib/private/systemtag/systemtag.php | 4 ++-- lib/private/systemtag/systemtagmanager.php | 19 +++++++-------- .../systemtag/systemtagobjectmapper.php | 23 +++++++++++-------- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/lib/private/systemtag/systemtag.php b/lib/private/systemtag/systemtag.php index b79cc33cfb..8f4f7090b2 100644 --- a/lib/private/systemtag/systemtag.php +++ b/lib/private/systemtag/systemtag.php @@ -21,9 +21,9 @@ namespace OC\SystemTag; -use \OCP\IDBConnection; +use OCP\SystemTag\ISystemTag; -class SystemTag implements \OCP\SystemTag\ISystemTag { +class SystemTag implements ISystemTag { /** * @var string diff --git a/lib/private/systemtag/systemtagmanager.php b/lib/private/systemtag/systemtagmanager.php index e307825ecf..95b9a61ca3 100644 --- a/lib/private/systemtag/systemtagmanager.php +++ b/lib/private/systemtag/systemtagmanager.php @@ -21,13 +21,14 @@ namespace OC\SystemTag; -use \OCP\IDBConnection; -use \OCP\SystemTag\TagNotFoundException; -use \OCP\SystemTag\TagAlreadyExistsException; +use Doctrine\DBAL\Connection; +use Doctrine\DBAL\Exception\UniqueConstraintViolationException; +use OCP\IDBConnection; +use OCP\SystemTag\ISystemTagManager; +use OCP\SystemTag\TagAlreadyExistsException; +use OCP\SystemTag\TagNotFoundException; -use \Doctrine\DBAL\Exception\UniqueConstraintViolationException; - -class SystemTagManager implements \OCP\SystemTag\ISystemTagManager { +class SystemTagManager implements ISystemTagManager { const TAG_TABLE = 'systemtag'; @@ -83,7 +84,7 @@ class SystemTagManager implements \OCP\SystemTag\ISystemTagManager { ->addOrderBy('name', 'ASC') ->addOrderBy('visibility', 'ASC') ->addOrderBy('editable', 'ASC') - ->setParameter('tagids', $tagIds, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY); + ->setParameter('tagids', $tagIds, Connection::PARAM_INT_ARRAY); $result = $query->execute(); while ($row = $result->fetch()) { @@ -243,13 +244,13 @@ class SystemTagManager implements \OCP\SystemTag\ISystemTagManager { $query = $this->connection->getQueryBuilder(); $query->delete(SystemTagObjectMapper::RELATION_TABLE) ->where($query->expr()->in('systemtagid', $query->createParameter('tagids'))) - ->setParameter('tagids', $tagIds, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY) + ->setParameter('tagids', $tagIds, Connection::PARAM_INT_ARRAY) ->execute(); $query = $this->connection->getQueryBuilder(); $query->delete(self::TAG_TABLE) ->where($query->expr()->in('id', $query->createParameter('tagids'))) - ->setParameter('tagids', $tagIds, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY); + ->setParameter('tagids', $tagIds, Connection::PARAM_INT_ARRAY); if ($query->execute() === 0) { throw new TagNotFoundException( diff --git a/lib/private/systemtag/systemtagobjectmapper.php b/lib/private/systemtag/systemtagobjectmapper.php index a4782b0644..d82898a29c 100644 --- a/lib/private/systemtag/systemtagobjectmapper.php +++ b/lib/private/systemtag/systemtagobjectmapper.php @@ -21,12 +21,15 @@ namespace OC\SystemTag; -use \OCP\SystemTag\ISystemTagManager; -use \OCP\IDBConnection; -use \OCP\SystemTag\TagNotFoundException; -use \Doctrine\DBAL\Exception\UniqueConstraintViolationException; +use Doctrine\DBAL\Connection; +use Doctrine\DBAL\Exception\UniqueConstraintViolationException; +use OCP\IDBConnection; +use OCP\SystemTag\ISystemTag; +use OCP\SystemTag\ISystemTagManager; +use OCP\SystemTag\ISystemTagObjectMapper; +use OCP\SystemTag\TagNotFoundException; -class SystemTagObjectMapper implements \OCP\SystemTag\ISystemTagObjectMapper { +class SystemTagObjectMapper implements ISystemTagObjectMapper { const RELATION_TABLE = 'systemtag_object_mapping'; @@ -64,7 +67,7 @@ class SystemTagObjectMapper implements \OCP\SystemTag\ISystemTagObjectMapper { ->from(self::RELATION_TABLE) ->where($query->expr()->in('objectid', $query->createParameter('objectids'))) ->andWhere($query->expr()->eq('objecttype', $query->createParameter('objecttype'))) - ->setParameter('objectids', $objIds, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY) + ->setParameter('objectids', $objIds, Connection::PARAM_INT_ARRAY) ->setParameter('objecttype', $objectType) ->addOrderBy('objectid', 'ASC') ->addOrderBy('systemtagid', 'ASC'); @@ -100,7 +103,7 @@ class SystemTagObjectMapper implements \OCP\SystemTag\ISystemTagObjectMapper { ->from(self::RELATION_TABLE) ->where($query->expr()->in('systemtagid', $query->createParameter('tagids'))) ->andWhere($query->expr()->eq('objecttype', $query->createParameter('objecttype'))) - ->setParameter('tagids', $tagIds, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY) + ->setParameter('tagids', $tagIds, Connection::PARAM_INT_ARRAY) ->setParameter('objecttype', $objectType); $objectIds = []; @@ -158,7 +161,7 @@ class SystemTagObjectMapper implements \OCP\SystemTag\ISystemTagObjectMapper { ->andWhere($query->expr()->in('systemtagid', $query->createParameter('tagids'))) ->setParameter('objectid', $objId) ->setParameter('objecttype', $objectType) - ->setParameter('tagids', $tagIds, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY) + ->setParameter('tagids', $tagIds, Connection::PARAM_INT_ARRAY) ->execute(); } @@ -174,7 +177,7 @@ class SystemTagObjectMapper implements \OCP\SystemTag\ISystemTagObjectMapper { ->where($query->expr()->in('objectid', $query->createParameter('objectids'))) ->andWhere($query->expr()->eq('objecttype', $query->createParameter('objecttype'))) ->andWhere($query->expr()->eq('systemtagid', $query->createParameter('tagid'))) - ->setParameter('objectids', $objIds, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY) + ->setParameter('objectids', $objIds, Connection::PARAM_INT_ARRAY) ->setParameter('tagid', $tagId) ->setParameter('objecttype', $objectType) ->setMaxResults(1); @@ -201,7 +204,7 @@ class SystemTagObjectMapper implements \OCP\SystemTag\ISystemTagObjectMapper { if (count($tags) !== count($tagIds)) { // at least one tag missing, bail out $foundTagIds = array_map( - function($tag) { + function(ISystemTag $tag) { return $tag->getId(); }, $tags