From 502e454a6902c51d6756d606061a1a9092946c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Wed, 2 Dec 2015 21:17:03 +0100 Subject: [PATCH] Fix PHPDoc ... --- .../dav/lib/systemtag/systemtagmappingnode.php | 5 ++++- apps/dav/lib/systemtag/systemtagnode.php | 3 +++ apps/dav/lib/systemtag/systemtagplugin.php | 18 ++++++++++-------- .../lib/systemtag/systemtagsbyidcollection.php | 1 - .../systemtagsobjectmappingcollection.php | 2 -- .../systemtagsobjecttypecollection.php | 4 ---- .../systemtagsrelationscollection.php | 3 +++ 7 files changed, 20 insertions(+), 16 deletions(-) diff --git a/apps/dav/lib/systemtag/systemtagmappingnode.php b/apps/dav/lib/systemtag/systemtagmappingnode.php index 97c1afc140..03088d734d 100644 --- a/apps/dav/lib/systemtag/systemtagmappingnode.php +++ b/apps/dav/lib/systemtag/systemtagmappingnode.php @@ -22,7 +22,6 @@ namespace OCA\DAV\SystemTag; use Sabre\DAV\Exception\NotFound; -use Sabre\DAV\Exception\MethodNotAllowed; use OCP\SystemTag\ISystemTag; use OCP\SystemTag\ISystemTagManager; @@ -53,6 +52,10 @@ class SystemTagMappingNode extends SystemTagNode { * Sets up the node, expects a full path name * * @param ISystemTag $tag system tag + * @param string $objectId + * @param string $objectType + * @param ISystemTagManager $tagManager + * @param ISystemTagObjectMapper $tagMapper */ public function __construct( ISystemTag $tag, diff --git a/apps/dav/lib/systemtag/systemtagnode.php b/apps/dav/lib/systemtag/systemtagnode.php index e425595352..b09a773793 100644 --- a/apps/dav/lib/systemtag/systemtagnode.php +++ b/apps/dav/lib/systemtag/systemtagnode.php @@ -21,6 +21,7 @@ namespace OCA\DAV\SystemTag; +use OCP\SystemTag\TagAlreadyExistsException; use Sabre\DAV\Exception\NotFound; use Sabre\DAV\Exception\MethodNotAllowed; use Sabre\DAV\Exception\Conflict; @@ -45,6 +46,7 @@ class SystemTagNode implements \Sabre\DAV\INode { * Sets up the node, expects a full path name * * @param ISystemTag $tag system tag + * @param ISystemTagManager $tagManager */ public function __construct(ISystemTag $tag, ISystemTagManager $tagManager) { $this->tag = $tag; @@ -84,6 +86,7 @@ class SystemTagNode implements \Sabre\DAV\INode { * @param string $name new tag name * @param bool $userVisible user visible * @param bool $userAssignable user assignable + * @throws Conflict */ public function update($name, $userVisible, $userAssignable) { try { diff --git a/apps/dav/lib/systemtag/systemtagplugin.php b/apps/dav/lib/systemtag/systemtagplugin.php index c213640964..d5591c2849 100644 --- a/apps/dav/lib/systemtag/systemtagplugin.php +++ b/apps/dav/lib/systemtag/systemtagplugin.php @@ -20,16 +20,18 @@ */ namespace OCA\DAV\SystemTag; +use Sabre\DAV\Exception\NotFound; use Sabre\DAV\PropFind; use Sabre\DAV\PropPatch; use Sabre\DAV\Exception\BadRequest; use Sabre\DAV\Exception\UnsupportedMediaType; use Sabre\DAV\Exception\Conflict; -use OCA\DAV\SystemTag\SystemTagNode; use OCP\SystemTag\ISystemTag; use OCP\SystemTag\ISystemTagManager; use OCP\SystemTag\TagAlreadyExistsException; +use Sabre\HTTP\RequestInterface; +use Sabre\HTTP\ResponseInterface; class SystemTagPlugin extends \Sabre\DAV\ServerPlugin { @@ -72,7 +74,7 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin { */ public function initialize(\Sabre\DAV\Server $server) { - $server->xmlNamespaces[self::NS_OWNCLOUD] = 'oc'; + $server->xml->namespaceMap[self::NS_OWNCLOUD] = 'oc'; $server->protectedProperties[] = self::ID_PROPERTYNAME; @@ -130,11 +132,11 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin { * * @param string $data * @param string $contentType content type of the data - * * @return ISystemTag newly created system tag * - * @throws UnsupportedMediaType if the content type is not supported * @throws BadRequest if a field was missing + * @throws Conflict + * @throws UnsupportedMediaType if the content type is not supported */ private function createTag($data, $contentType = 'application/json') { if ($contentType === 'application/json') { @@ -212,15 +214,15 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin { self::USERVISIBLE_PROPERTYNAME, self::USERASSIGNABLE_PROPERTYNAME, ], function($props) use ($path) { - $node = $this->tree->getNodeForPath($path); + $node = $this->server->tree->getNodeForPath($path); if (!($node instanceof SystemTagNode)) { return; } - $tag = $node->getTag(); + $tag = $node->getSystemTag(); $name = $tag->getName(); - $userVisible = $tag->getUserVisible(); - $userAssignable = $tag->getUserAssignable(); + $userVisible = $tag->isUserVisible(); + $userAssignable = $tag->isUserAssignable(); if (isset($props[self::DISPLAYNAME_PROPERTYNAME])) { $name = $props[self::DISPLAYNAME_PROPERTYNAME]; diff --git a/apps/dav/lib/systemtag/systemtagsbyidcollection.php b/apps/dav/lib/systemtag/systemtagsbyidcollection.php index 8643ffedd4..0164b9b0b3 100644 --- a/apps/dav/lib/systemtag/systemtagsbyidcollection.php +++ b/apps/dav/lib/systemtag/systemtagsbyidcollection.php @@ -29,7 +29,6 @@ use Sabre\DAV\ICollection; use OCP\SystemTag\ISystemTagManager; use OCP\SystemTag\ISystemTag; use OCP\SystemTag\TagNotFoundException; -use OC\SystemTag\SystemTag; class SystemTagsByIdCollection implements ICollection { diff --git a/apps/dav/lib/systemtag/systemtagsobjectmappingcollection.php b/apps/dav/lib/systemtag/systemtagsobjectmappingcollection.php index a0a71306f9..6ed959fd88 100644 --- a/apps/dav/lib/systemtag/systemtagsobjectmappingcollection.php +++ b/apps/dav/lib/systemtag/systemtagsobjectmappingcollection.php @@ -23,7 +23,6 @@ namespace OCA\DAV\SystemTag; use Sabre\DAV\Exception\Forbidden; use Sabre\DAV\Exception\NotFound; -use Sabre\DAV\Exception\MethodNotAllowed; use Sabre\DAV\Exception\BadRequest; use Sabre\DAV\ICollection; @@ -31,7 +30,6 @@ use OCP\SystemTag\ISystemTagManager; use OCP\SystemTag\ISystemTagObjectMapper; use OCP\SystemTag\ISystemTag; use OCP\SystemTag\TagNotFoundException; -use OC\SystemTag\SystemTag; /** * Collection containing tags by object id diff --git a/apps/dav/lib/systemtag/systemtagsobjecttypecollection.php b/apps/dav/lib/systemtag/systemtagsobjecttypecollection.php index c90e4fd2d8..8dee85ccd4 100644 --- a/apps/dav/lib/systemtag/systemtagsobjecttypecollection.php +++ b/apps/dav/lib/systemtag/systemtagsobjecttypecollection.php @@ -22,15 +22,11 @@ namespace OCA\DAV\SystemTag; use Sabre\DAV\Exception\Forbidden; -use Sabre\DAV\Exception\NotFound; use Sabre\DAV\Exception\MethodNotAllowed; use Sabre\DAV\ICollection; use OCP\SystemTag\ISystemTagManager; use OCP\SystemTag\ISystemTagObjectMapper; -use OCP\SystemTag\ISystemTag; -use OCP\SystemTag\TagNotFoundException; -use OC\SystemTag\SystemTag; /** * Collection containing object ids by object type diff --git a/apps/dav/lib/systemtag/systemtagsrelationscollection.php b/apps/dav/lib/systemtag/systemtagsrelationscollection.php index 4bcb6882a4..44069bca02 100644 --- a/apps/dav/lib/systemtag/systemtagsrelationscollection.php +++ b/apps/dav/lib/systemtag/systemtagsrelationscollection.php @@ -21,6 +21,9 @@ namespace OCA\DAV\SystemTag; +use OCP\SystemTag\ISystemTagManager; +use OCP\SystemTag\ISystemTagObjectMapper; +use Sabre\DAV\Exception\Forbidden; use Sabre\DAV\SimpleCollection; class SystemTagsRelationsCollection extends SimpleCollection {