Merge pull request #4701 from nextcloud/enforce-type

Enforce type hints in dav app
This commit is contained in:
Roeland Jago Douma 2017-05-05 15:33:35 +02:00 committed by GitHub
commit 57275e9944
2 changed files with 6 additions and 2 deletions

View File

@ -30,9 +30,11 @@
*/ */
namespace OCA\DAV\Connector\Sabre; namespace OCA\DAV\Connector\Sabre;
use OC\Files\View;
use OCA\DAV\Connector\Sabre\Exception\Forbidden; use OCA\DAV\Connector\Sabre\Exception\Forbidden;
use OCA\DAV\Connector\Sabre\Exception\InvalidPath; use OCA\DAV\Connector\Sabre\Exception\InvalidPath;
use OCA\DAV\Connector\Sabre\Exception\FileLocked; use OCA\DAV\Connector\Sabre\Exception\FileLocked;
use OCP\Files\FileInfo;
use OCP\Files\ForbiddenException; use OCP\Files\ForbiddenException;
use OCP\Files\InvalidPathException; use OCP\Files\InvalidPathException;
use OCP\Files\StorageNotAvailableException; use OCP\Files\StorageNotAvailableException;
@ -76,7 +78,7 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node
* @param ObjectTree|null $tree * @param ObjectTree|null $tree
* @param \OCP\Share\IManager $shareManager * @param \OCP\Share\IManager $shareManager
*/ */
public function __construct($view, $info, $tree = null, $shareManager = null) { public function __construct(View $view, FileInfo $info, $tree = null, $shareManager = null) {
parent::__construct($view, $info, $shareManager); parent::__construct($view, $info, $shareManager);
$this->tree = $tree; $this->tree = $tree;
} }

View File

@ -34,7 +34,9 @@
namespace OCA\DAV\Connector\Sabre; namespace OCA\DAV\Connector\Sabre;
use OC\Files\Mount\MoveableMount; use OC\Files\Mount\MoveableMount;
use OC\Files\View;
use OCA\DAV\Connector\Sabre\Exception\InvalidPath; use OCA\DAV\Connector\Sabre\Exception\InvalidPath;
use OCP\Files\FileInfo;
use OCP\Share\Exceptions\ShareNotFound; use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IManager; use OCP\Share\IManager;
@ -77,7 +79,7 @@ abstract class Node implements \Sabre\DAV\INode {
* @param \OCP\Files\FileInfo $info * @param \OCP\Files\FileInfo $info
* @param IManager $shareManager * @param IManager $shareManager
*/ */
public function __construct($view, $info, IManager $shareManager = null) { public function __construct(View $view, FileInfo $info, IManager $shareManager = null) {
$this->fileView = $view; $this->fileView = $view;
$this->path = $this->fileView->getRelativePath($info->getPath()); $this->path = $this->fileView->getRelativePath($info->getPath());
$this->info = $info; $this->info = $info;