@@ -33,53 +33,53 @@ |
||
33 | 33 | namespace OC\Files\Storage; |
34 | 34 | |
35 | 35 | class CommonTest extends \OC\Files\Storage\Common { |
36 | - /** |
|
37 | - * underlying local storage used for missing functions |
|
38 | - * @var \OC\Files\Storage\Local |
|
39 | - */ |
|
40 | - private $storage; |
|
36 | + /** |
|
37 | + * underlying local storage used for missing functions |
|
38 | + * @var \OC\Files\Storage\Local |
|
39 | + */ |
|
40 | + private $storage; |
|
41 | 41 | |
42 | - public function __construct($params) { |
|
43 | - $this->storage = new \OC\Files\Storage\Local($params); |
|
44 | - } |
|
42 | + public function __construct($params) { |
|
43 | + $this->storage = new \OC\Files\Storage\Local($params); |
|
44 | + } |
|
45 | 45 | |
46 | - public function getId() { |
|
47 | - return 'test::'.$this->storage->getId(); |
|
48 | - } |
|
49 | - public function mkdir($path) { |
|
50 | - return $this->storage->mkdir($path); |
|
51 | - } |
|
52 | - public function rmdir($path) { |
|
53 | - return $this->storage->rmdir($path); |
|
54 | - } |
|
55 | - public function opendir($path) { |
|
56 | - return $this->storage->opendir($path); |
|
57 | - } |
|
58 | - public function stat($path) { |
|
59 | - return $this->storage->stat($path); |
|
60 | - } |
|
61 | - public function filetype($path) { |
|
62 | - return @$this->storage->filetype($path); |
|
63 | - } |
|
64 | - public function isReadable($path) { |
|
65 | - return $this->storage->isReadable($path); |
|
66 | - } |
|
67 | - public function isUpdatable($path) { |
|
68 | - return $this->storage->isUpdatable($path); |
|
69 | - } |
|
70 | - public function file_exists($path) { |
|
71 | - return $this->storage->file_exists($path); |
|
72 | - } |
|
73 | - public function unlink($path) { |
|
74 | - return $this->storage->unlink($path); |
|
75 | - } |
|
76 | - public function fopen($path, $mode) { |
|
77 | - return $this->storage->fopen($path, $mode); |
|
78 | - } |
|
79 | - public function free_space($path) { |
|
80 | - return $this->storage->free_space($path); |
|
81 | - } |
|
82 | - public function touch($path, $mtime = null) { |
|
83 | - return $this->storage->touch($path, $mtime); |
|
84 | - } |
|
46 | + public function getId() { |
|
47 | + return 'test::'.$this->storage->getId(); |
|
48 | + } |
|
49 | + public function mkdir($path) { |
|
50 | + return $this->storage->mkdir($path); |
|
51 | + } |
|
52 | + public function rmdir($path) { |
|
53 | + return $this->storage->rmdir($path); |
|
54 | + } |
|
55 | + public function opendir($path) { |
|
56 | + return $this->storage->opendir($path); |
|
57 | + } |
|
58 | + public function stat($path) { |
|
59 | + return $this->storage->stat($path); |
|
60 | + } |
|
61 | + public function filetype($path) { |
|
62 | + return @$this->storage->filetype($path); |
|
63 | + } |
|
64 | + public function isReadable($path) { |
|
65 | + return $this->storage->isReadable($path); |
|
66 | + } |
|
67 | + public function isUpdatable($path) { |
|
68 | + return $this->storage->isUpdatable($path); |
|
69 | + } |
|
70 | + public function file_exists($path) { |
|
71 | + return $this->storage->file_exists($path); |
|
72 | + } |
|
73 | + public function unlink($path) { |
|
74 | + return $this->storage->unlink($path); |
|
75 | + } |
|
76 | + public function fopen($path, $mode) { |
|
77 | + return $this->storage->fopen($path, $mode); |
|
78 | + } |
|
79 | + public function free_space($path) { |
|
80 | + return $this->storage->free_space($path); |
|
81 | + } |
|
82 | + public function touch($path, $mtime = null) { |
|
83 | + return $this->storage->touch($path, $mtime); |
|
84 | + } |
|
85 | 85 | } |
@@ -29,20 +29,20 @@ |
||
29 | 29 | * local storage backend in temporary folder for testing purpose |
30 | 30 | */ |
31 | 31 | class Temporary extends Local { |
32 | - public function __construct($arguments = null) { |
|
33 | - parent::__construct(['datadir' => \OC::$server->getTempManager()->getTemporaryFolder()]); |
|
34 | - } |
|
32 | + public function __construct($arguments = null) { |
|
33 | + parent::__construct(['datadir' => \OC::$server->getTempManager()->getTemporaryFolder()]); |
|
34 | + } |
|
35 | 35 | |
36 | - public function cleanUp() { |
|
37 | - \OC_Helper::rmdirr($this->datadir); |
|
38 | - } |
|
36 | + public function cleanUp() { |
|
37 | + \OC_Helper::rmdirr($this->datadir); |
|
38 | + } |
|
39 | 39 | |
40 | - public function __destruct() { |
|
41 | - parent::__destruct(); |
|
42 | - $this->cleanUp(); |
|
43 | - } |
|
40 | + public function __destruct() { |
|
41 | + parent::__destruct(); |
|
42 | + $this->cleanUp(); |
|
43 | + } |
|
44 | 44 | |
45 | - public function getDataDir() { |
|
46 | - return $this->datadir; |
|
47 | - } |
|
45 | + public function getDataDir() { |
|
46 | + return $this->datadir; |
|
47 | + } |
|
48 | 48 | } |
@@ -50,7 +50,7 @@ |
||
50 | 50 | public function __construct($arguments) { |
51 | 51 | $this->user = $arguments['user']; |
52 | 52 | $datadir = $this->user->getHome(); |
53 | - $this->id = 'home::' . $this->user->getUID(); |
|
53 | + $this->id = 'home::'.$this->user->getUID(); |
|
54 | 54 | |
55 | 55 | parent::__construct(['datadir' => $datadir]); |
56 | 56 | } |
@@ -33,80 +33,80 @@ |
||
33 | 33 | * Specialized version of Local storage for home directory usage |
34 | 34 | */ |
35 | 35 | class Home extends Local implements \OCP\Files\IHomeStorage { |
36 | - /** |
|
37 | - * @var string |
|
38 | - */ |
|
39 | - protected $id; |
|
36 | + /** |
|
37 | + * @var string |
|
38 | + */ |
|
39 | + protected $id; |
|
40 | 40 | |
41 | - /** |
|
42 | - * @var \OC\User\User $user |
|
43 | - */ |
|
44 | - protected $user; |
|
41 | + /** |
|
42 | + * @var \OC\User\User $user |
|
43 | + */ |
|
44 | + protected $user; |
|
45 | 45 | |
46 | - /** |
|
47 | - * Construct a Home storage instance |
|
48 | - * |
|
49 | - * @param array $arguments array with "user" containing the |
|
50 | - * storage owner |
|
51 | - */ |
|
52 | - public function __construct($arguments) { |
|
53 | - $this->user = $arguments['user']; |
|
54 | - $datadir = $this->user->getHome(); |
|
55 | - $this->id = 'home::' . $this->user->getUID(); |
|
46 | + /** |
|
47 | + * Construct a Home storage instance |
|
48 | + * |
|
49 | + * @param array $arguments array with "user" containing the |
|
50 | + * storage owner |
|
51 | + */ |
|
52 | + public function __construct($arguments) { |
|
53 | + $this->user = $arguments['user']; |
|
54 | + $datadir = $this->user->getHome(); |
|
55 | + $this->id = 'home::' . $this->user->getUID(); |
|
56 | 56 | |
57 | - parent::__construct(['datadir' => $datadir]); |
|
58 | - } |
|
57 | + parent::__construct(['datadir' => $datadir]); |
|
58 | + } |
|
59 | 59 | |
60 | - public function getId() { |
|
61 | - return $this->id; |
|
62 | - } |
|
60 | + public function getId() { |
|
61 | + return $this->id; |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @return \OC\Files\Cache\HomeCache |
|
66 | - */ |
|
67 | - public function getCache($path = '', $storage = null) { |
|
68 | - if (!$storage) { |
|
69 | - $storage = $this; |
|
70 | - } |
|
71 | - if (!isset($this->cache)) { |
|
72 | - $this->cache = new \OC\Files\Cache\HomeCache($storage); |
|
73 | - } |
|
74 | - return $this->cache; |
|
75 | - } |
|
64 | + /** |
|
65 | + * @return \OC\Files\Cache\HomeCache |
|
66 | + */ |
|
67 | + public function getCache($path = '', $storage = null) { |
|
68 | + if (!$storage) { |
|
69 | + $storage = $this; |
|
70 | + } |
|
71 | + if (!isset($this->cache)) { |
|
72 | + $this->cache = new \OC\Files\Cache\HomeCache($storage); |
|
73 | + } |
|
74 | + return $this->cache; |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * get a propagator instance for the cache |
|
79 | - * |
|
80 | - * @param \OC\Files\Storage\Storage (optional) the storage to pass to the watcher |
|
81 | - * @return \OC\Files\Cache\Propagator |
|
82 | - */ |
|
83 | - public function getPropagator($storage = null) { |
|
84 | - if (!$storage) { |
|
85 | - $storage = $this; |
|
86 | - } |
|
87 | - if (!isset($this->propagator)) { |
|
88 | - $this->propagator = new HomePropagator($storage, \OC::$server->getDatabaseConnection()); |
|
89 | - } |
|
90 | - return $this->propagator; |
|
91 | - } |
|
77 | + /** |
|
78 | + * get a propagator instance for the cache |
|
79 | + * |
|
80 | + * @param \OC\Files\Storage\Storage (optional) the storage to pass to the watcher |
|
81 | + * @return \OC\Files\Cache\Propagator |
|
82 | + */ |
|
83 | + public function getPropagator($storage = null) { |
|
84 | + if (!$storage) { |
|
85 | + $storage = $this; |
|
86 | + } |
|
87 | + if (!isset($this->propagator)) { |
|
88 | + $this->propagator = new HomePropagator($storage, \OC::$server->getDatabaseConnection()); |
|
89 | + } |
|
90 | + return $this->propagator; |
|
91 | + } |
|
92 | 92 | |
93 | 93 | |
94 | - /** |
|
95 | - * Returns the owner of this home storage |
|
96 | - * |
|
97 | - * @return \OC\User\User owner of this home storage |
|
98 | - */ |
|
99 | - public function getUser() { |
|
100 | - return $this->user; |
|
101 | - } |
|
94 | + /** |
|
95 | + * Returns the owner of this home storage |
|
96 | + * |
|
97 | + * @return \OC\User\User owner of this home storage |
|
98 | + */ |
|
99 | + public function getUser() { |
|
100 | + return $this->user; |
|
101 | + } |
|
102 | 102 | |
103 | - /** |
|
104 | - * get the owner of a path |
|
105 | - * |
|
106 | - * @param string $path The path to get the owner |
|
107 | - * @return string uid or false |
|
108 | - */ |
|
109 | - public function getOwner($path) { |
|
110 | - return $this->user->getUID(); |
|
111 | - } |
|
103 | + /** |
|
104 | + * get the owner of a path |
|
105 | + * |
|
106 | + * @param string $path The path to get the owner |
|
107 | + * @return string uid or false |
|
108 | + */ |
|
109 | + public function getOwner($path) { |
|
110 | + return $this->user->getUID(); |
|
111 | + } |
|
112 | 112 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | public function getDirectoryListing() { |
50 | 50 | $listing = $this->folder->getDirectoryListing(); |
51 | 51 | |
52 | - $fileListing = array_map(function (Node $file) { |
|
52 | + $fileListing = array_map(function(Node $file) { |
|
53 | 53 | if ($file instanceof File) { |
54 | 54 | return new SimpleFile($file); |
55 | 55 | } |
@@ -32,62 +32,62 @@ |
||
32 | 32 | |
33 | 33 | class SimpleFolder implements ISimpleFolder { |
34 | 34 | |
35 | - /** @var Folder */ |
|
36 | - private $folder; |
|
37 | - |
|
38 | - /** |
|
39 | - * Folder constructor. |
|
40 | - * |
|
41 | - * @param Folder $folder |
|
42 | - */ |
|
43 | - public function __construct(Folder $folder) { |
|
44 | - $this->folder = $folder; |
|
45 | - } |
|
46 | - |
|
47 | - public function getName() { |
|
48 | - return $this->folder->getName(); |
|
49 | - } |
|
50 | - |
|
51 | - public function getDirectoryListing() { |
|
52 | - $listing = $this->folder->getDirectoryListing(); |
|
53 | - |
|
54 | - $fileListing = array_map(function (Node $file) { |
|
55 | - if ($file instanceof File) { |
|
56 | - return new SimpleFile($file); |
|
57 | - } |
|
58 | - return null; |
|
59 | - }, $listing); |
|
60 | - |
|
61 | - $fileListing = array_filter($fileListing); |
|
62 | - |
|
63 | - return array_values($fileListing); |
|
64 | - } |
|
65 | - |
|
66 | - public function delete() { |
|
67 | - $this->folder->delete(); |
|
68 | - } |
|
69 | - |
|
70 | - public function fileExists($name) { |
|
71 | - return $this->folder->nodeExists($name); |
|
72 | - } |
|
73 | - |
|
74 | - public function getFile($name) { |
|
75 | - $file = $this->folder->get($name); |
|
76 | - |
|
77 | - if (!($file instanceof File)) { |
|
78 | - throw new NotFoundException(); |
|
79 | - } |
|
80 | - |
|
81 | - return new SimpleFile($file); |
|
82 | - } |
|
83 | - |
|
84 | - public function newFile($name, $content = null) { |
|
85 | - if ($content === null) { |
|
86 | - // delay creating the file until it's written to |
|
87 | - return new NewSimpleFile($this->folder, $name); |
|
88 | - } else { |
|
89 | - $file = $this->folder->newFile($name, $content); |
|
90 | - return new SimpleFile($file); |
|
91 | - } |
|
92 | - } |
|
35 | + /** @var Folder */ |
|
36 | + private $folder; |
|
37 | + |
|
38 | + /** |
|
39 | + * Folder constructor. |
|
40 | + * |
|
41 | + * @param Folder $folder |
|
42 | + */ |
|
43 | + public function __construct(Folder $folder) { |
|
44 | + $this->folder = $folder; |
|
45 | + } |
|
46 | + |
|
47 | + public function getName() { |
|
48 | + return $this->folder->getName(); |
|
49 | + } |
|
50 | + |
|
51 | + public function getDirectoryListing() { |
|
52 | + $listing = $this->folder->getDirectoryListing(); |
|
53 | + |
|
54 | + $fileListing = array_map(function (Node $file) { |
|
55 | + if ($file instanceof File) { |
|
56 | + return new SimpleFile($file); |
|
57 | + } |
|
58 | + return null; |
|
59 | + }, $listing); |
|
60 | + |
|
61 | + $fileListing = array_filter($fileListing); |
|
62 | + |
|
63 | + return array_values($fileListing); |
|
64 | + } |
|
65 | + |
|
66 | + public function delete() { |
|
67 | + $this->folder->delete(); |
|
68 | + } |
|
69 | + |
|
70 | + public function fileExists($name) { |
|
71 | + return $this->folder->nodeExists($name); |
|
72 | + } |
|
73 | + |
|
74 | + public function getFile($name) { |
|
75 | + $file = $this->folder->get($name); |
|
76 | + |
|
77 | + if (!($file instanceof File)) { |
|
78 | + throw new NotFoundException(); |
|
79 | + } |
|
80 | + |
|
81 | + return new SimpleFile($file); |
|
82 | + } |
|
83 | + |
|
84 | + public function newFile($name, $content = null) { |
|
85 | + if ($content === null) { |
|
86 | + // delay creating the file until it's written to |
|
87 | + return new NewSimpleFile($this->folder, $name); |
|
88 | + } else { |
|
89 | + $file = $this->folder->newFile($name, $content); |
|
90 | + return new SimpleFile($file); |
|
91 | + } |
|
92 | + } |
|
93 | 93 | } |
@@ -33,70 +33,70 @@ |
||
33 | 33 | * usage: resource \OC\Files\Stream\Quota::wrap($stream, $limit) |
34 | 34 | */ |
35 | 35 | class Quota extends Wrapper { |
36 | - /** |
|
37 | - * @var int $limit |
|
38 | - */ |
|
39 | - private $limit; |
|
36 | + /** |
|
37 | + * @var int $limit |
|
38 | + */ |
|
39 | + private $limit; |
|
40 | 40 | |
41 | - /** |
|
42 | - * @param resource $stream |
|
43 | - * @param int $limit |
|
44 | - * @return resource |
|
45 | - */ |
|
46 | - public static function wrap($stream, $limit) { |
|
47 | - $context = stream_context_create([ |
|
48 | - 'quota' => [ |
|
49 | - 'source' => $stream, |
|
50 | - 'limit' => $limit |
|
51 | - ] |
|
52 | - ]); |
|
53 | - return Wrapper::wrapSource($stream, $context, 'quota', self::class); |
|
54 | - } |
|
41 | + /** |
|
42 | + * @param resource $stream |
|
43 | + * @param int $limit |
|
44 | + * @return resource |
|
45 | + */ |
|
46 | + public static function wrap($stream, $limit) { |
|
47 | + $context = stream_context_create([ |
|
48 | + 'quota' => [ |
|
49 | + 'source' => $stream, |
|
50 | + 'limit' => $limit |
|
51 | + ] |
|
52 | + ]); |
|
53 | + return Wrapper::wrapSource($stream, $context, 'quota', self::class); |
|
54 | + } |
|
55 | 55 | |
56 | - public function stream_open($path, $mode, $options, &$opened_path) { |
|
57 | - $context = $this->loadContext('quota'); |
|
58 | - $this->source = $context['source']; |
|
59 | - $this->limit = $context['limit']; |
|
56 | + public function stream_open($path, $mode, $options, &$opened_path) { |
|
57 | + $context = $this->loadContext('quota'); |
|
58 | + $this->source = $context['source']; |
|
59 | + $this->limit = $context['limit']; |
|
60 | 60 | |
61 | - return true; |
|
62 | - } |
|
61 | + return true; |
|
62 | + } |
|
63 | 63 | |
64 | - public function dir_opendir($path, $options) { |
|
65 | - return false; |
|
66 | - } |
|
64 | + public function dir_opendir($path, $options) { |
|
65 | + return false; |
|
66 | + } |
|
67 | 67 | |
68 | - public function stream_seek($offset, $whence = SEEK_SET) { |
|
69 | - if ($whence === SEEK_END) { |
|
70 | - // go to the end to find out last position's offset |
|
71 | - $oldOffset = $this->stream_tell(); |
|
72 | - if (fseek($this->source, 0, $whence) !== 0) { |
|
73 | - return false; |
|
74 | - } |
|
75 | - $whence = SEEK_SET; |
|
76 | - $offset = $this->stream_tell() + $offset; |
|
77 | - $this->limit += $oldOffset - $offset; |
|
78 | - } elseif ($whence === SEEK_SET) { |
|
79 | - $this->limit += $this->stream_tell() - $offset; |
|
80 | - } else { |
|
81 | - $this->limit -= $offset; |
|
82 | - } |
|
83 | - // this wrapper needs to return "true" for success. |
|
84 | - // the fseek call itself returns 0 on succeess |
|
85 | - return fseek($this->source, $offset, $whence) === 0; |
|
86 | - } |
|
68 | + public function stream_seek($offset, $whence = SEEK_SET) { |
|
69 | + if ($whence === SEEK_END) { |
|
70 | + // go to the end to find out last position's offset |
|
71 | + $oldOffset = $this->stream_tell(); |
|
72 | + if (fseek($this->source, 0, $whence) !== 0) { |
|
73 | + return false; |
|
74 | + } |
|
75 | + $whence = SEEK_SET; |
|
76 | + $offset = $this->stream_tell() + $offset; |
|
77 | + $this->limit += $oldOffset - $offset; |
|
78 | + } elseif ($whence === SEEK_SET) { |
|
79 | + $this->limit += $this->stream_tell() - $offset; |
|
80 | + } else { |
|
81 | + $this->limit -= $offset; |
|
82 | + } |
|
83 | + // this wrapper needs to return "true" for success. |
|
84 | + // the fseek call itself returns 0 on succeess |
|
85 | + return fseek($this->source, $offset, $whence) === 0; |
|
86 | + } |
|
87 | 87 | |
88 | - public function stream_read($count) { |
|
89 | - $this->limit -= $count; |
|
90 | - return fread($this->source, $count); |
|
91 | - } |
|
88 | + public function stream_read($count) { |
|
89 | + $this->limit -= $count; |
|
90 | + return fread($this->source, $count); |
|
91 | + } |
|
92 | 92 | |
93 | - public function stream_write($data) { |
|
94 | - $size = strlen($data); |
|
95 | - if ($size > $this->limit) { |
|
96 | - $data = substr($data, 0, $this->limit); |
|
97 | - $size = $this->limit; |
|
98 | - } |
|
99 | - $this->limit -= $size; |
|
100 | - return fwrite($this->source, $data); |
|
101 | - } |
|
93 | + public function stream_write($data) { |
|
94 | + $size = strlen($data); |
|
95 | + if ($size > $this->limit) { |
|
96 | + $data = substr($data, 0, $this->limit); |
|
97 | + $size = $this->limit; |
|
98 | + } |
|
99 | + $this->limit -= $size; |
|
100 | + return fwrite($this->source, $data); |
|
101 | + } |
|
102 | 102 | } |
@@ -28,40 +28,40 @@ |
||
28 | 28 | |
29 | 29 | class HomeObjectStoreStorage extends ObjectStoreStorage implements \OCP\Files\IHomeStorage { |
30 | 30 | |
31 | - /** |
|
32 | - * The home user storage requires a user object to create a unique storage id |
|
33 | - * @param array $params |
|
34 | - */ |
|
35 | - public function __construct($params) { |
|
36 | - if (! isset($params['user']) || ! $params['user'] instanceof User) { |
|
37 | - throw new \Exception('missing user object in parameters'); |
|
38 | - } |
|
39 | - $this->user = $params['user']; |
|
40 | - parent::__construct($params); |
|
41 | - } |
|
31 | + /** |
|
32 | + * The home user storage requires a user object to create a unique storage id |
|
33 | + * @param array $params |
|
34 | + */ |
|
35 | + public function __construct($params) { |
|
36 | + if (! isset($params['user']) || ! $params['user'] instanceof User) { |
|
37 | + throw new \Exception('missing user object in parameters'); |
|
38 | + } |
|
39 | + $this->user = $params['user']; |
|
40 | + parent::__construct($params); |
|
41 | + } |
|
42 | 42 | |
43 | - public function getId() { |
|
44 | - return 'object::user:' . $this->user->getUID(); |
|
45 | - } |
|
43 | + public function getId() { |
|
44 | + return 'object::user:' . $this->user->getUID(); |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * get the owner of a path |
|
49 | - * |
|
50 | - * @param string $path The path to get the owner |
|
51 | - * @return false|string uid |
|
52 | - */ |
|
53 | - public function getOwner($path) { |
|
54 | - if (is_object($this->user)) { |
|
55 | - return $this->user->getUID(); |
|
56 | - } |
|
57 | - return false; |
|
58 | - } |
|
47 | + /** |
|
48 | + * get the owner of a path |
|
49 | + * |
|
50 | + * @param string $path The path to get the owner |
|
51 | + * @return false|string uid |
|
52 | + */ |
|
53 | + public function getOwner($path) { |
|
54 | + if (is_object($this->user)) { |
|
55 | + return $this->user->getUID(); |
|
56 | + } |
|
57 | + return false; |
|
58 | + } |
|
59 | 59 | |
60 | - /** |
|
61 | - * @param string $path, optional |
|
62 | - * @return \OC\User\User |
|
63 | - */ |
|
64 | - public function getUser($path = null) { |
|
65 | - return $this->user; |
|
66 | - } |
|
60 | + /** |
|
61 | + * @param string $path, optional |
|
62 | + * @return \OC\User\User |
|
63 | + */ |
|
64 | + public function getUser($path = null) { |
|
65 | + return $this->user; |
|
66 | + } |
|
67 | 67 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @param array $params |
34 | 34 | */ |
35 | 35 | public function __construct($params) { |
36 | - if (! isset($params['user']) || ! $params['user'] instanceof User) { |
|
36 | + if (!isset($params['user']) || !$params['user'] instanceof User) { |
|
37 | 37 | throw new \Exception('missing user object in parameters'); |
38 | 38 | } |
39 | 39 | $this->user = $params['user']; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | public function getId() { |
44 | - return 'object::user:' . $this->user->getUID(); |
|
44 | + return 'object::user:'.$this->user->getUID(); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -24,17 +24,17 @@ |
||
24 | 24 | namespace OC\DB; |
25 | 25 | |
26 | 26 | class MigrationException extends \Exception { |
27 | - private $table; |
|
27 | + private $table; |
|
28 | 28 | |
29 | - public function __construct($table, $message) { |
|
30 | - $this->table = $table; |
|
31 | - parent::__construct($message); |
|
32 | - } |
|
29 | + public function __construct($table, $message) { |
|
30 | + $this->table = $table; |
|
31 | + parent::__construct($message); |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * @return string |
|
36 | - */ |
|
37 | - public function getTable() { |
|
38 | - return $this->table; |
|
39 | - } |
|
34 | + /** |
|
35 | + * @return string |
|
36 | + */ |
|
37 | + public function getTable() { |
|
38 | + return $this->table; |
|
39 | + } |
|
40 | 40 | } |
@@ -25,68 +25,68 @@ |
||
25 | 25 | use OCP\DB\QueryBuilder\ICompositeExpression; |
26 | 26 | |
27 | 27 | class CompositeExpression implements ICompositeExpression, \Countable { |
28 | - /** @var \Doctrine\DBAL\Query\Expression\CompositeExpression */ |
|
29 | - protected $compositeExpression; |
|
28 | + /** @var \Doctrine\DBAL\Query\Expression\CompositeExpression */ |
|
29 | + protected $compositeExpression; |
|
30 | 30 | |
31 | - /** |
|
32 | - * Constructor. |
|
33 | - * |
|
34 | - * @param \Doctrine\DBAL\Query\Expression\CompositeExpression $compositeExpression |
|
35 | - */ |
|
36 | - public function __construct(\Doctrine\DBAL\Query\Expression\CompositeExpression $compositeExpression) { |
|
37 | - $this->compositeExpression = $compositeExpression; |
|
38 | - } |
|
31 | + /** |
|
32 | + * Constructor. |
|
33 | + * |
|
34 | + * @param \Doctrine\DBAL\Query\Expression\CompositeExpression $compositeExpression |
|
35 | + */ |
|
36 | + public function __construct(\Doctrine\DBAL\Query\Expression\CompositeExpression $compositeExpression) { |
|
37 | + $this->compositeExpression = $compositeExpression; |
|
38 | + } |
|
39 | 39 | |
40 | - /** |
|
41 | - * Adds multiple parts to composite expression. |
|
42 | - * |
|
43 | - * @param array $parts |
|
44 | - * |
|
45 | - * @return \OCP\DB\QueryBuilder\ICompositeExpression |
|
46 | - */ |
|
47 | - public function addMultiple(array $parts = []) { |
|
48 | - $this->compositeExpression->addMultiple($parts); |
|
40 | + /** |
|
41 | + * Adds multiple parts to composite expression. |
|
42 | + * |
|
43 | + * @param array $parts |
|
44 | + * |
|
45 | + * @return \OCP\DB\QueryBuilder\ICompositeExpression |
|
46 | + */ |
|
47 | + public function addMultiple(array $parts = []) { |
|
48 | + $this->compositeExpression->addMultiple($parts); |
|
49 | 49 | |
50 | - return $this; |
|
51 | - } |
|
50 | + return $this; |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * Adds an expression to composite expression. |
|
55 | - * |
|
56 | - * @param mixed $part |
|
57 | - * |
|
58 | - * @return \OCP\DB\QueryBuilder\ICompositeExpression |
|
59 | - */ |
|
60 | - public function add($part) { |
|
61 | - $this->compositeExpression->add($part); |
|
53 | + /** |
|
54 | + * Adds an expression to composite expression. |
|
55 | + * |
|
56 | + * @param mixed $part |
|
57 | + * |
|
58 | + * @return \OCP\DB\QueryBuilder\ICompositeExpression |
|
59 | + */ |
|
60 | + public function add($part) { |
|
61 | + $this->compositeExpression->add($part); |
|
62 | 62 | |
63 | - return $this; |
|
64 | - } |
|
63 | + return $this; |
|
64 | + } |
|
65 | 65 | |
66 | - /** |
|
67 | - * Retrieves the amount of expressions on composite expression. |
|
68 | - * |
|
69 | - * @return integer |
|
70 | - */ |
|
71 | - public function count() { |
|
72 | - return $this->compositeExpression->count(); |
|
73 | - } |
|
66 | + /** |
|
67 | + * Retrieves the amount of expressions on composite expression. |
|
68 | + * |
|
69 | + * @return integer |
|
70 | + */ |
|
71 | + public function count() { |
|
72 | + return $this->compositeExpression->count(); |
|
73 | + } |
|
74 | 74 | |
75 | - /** |
|
76 | - * Returns the type of this composite expression (AND/OR). |
|
77 | - * |
|
78 | - * @return string |
|
79 | - */ |
|
80 | - public function getType() { |
|
81 | - return $this->compositeExpression->getType(); |
|
82 | - } |
|
75 | + /** |
|
76 | + * Returns the type of this composite expression (AND/OR). |
|
77 | + * |
|
78 | + * @return string |
|
79 | + */ |
|
80 | + public function getType() { |
|
81 | + return $this->compositeExpression->getType(); |
|
82 | + } |
|
83 | 83 | |
84 | - /** |
|
85 | - * Retrieves the string representation of this composite expression. |
|
86 | - * |
|
87 | - * @return string |
|
88 | - */ |
|
89 | - public function __toString() { |
|
90 | - return (string) $this->compositeExpression; |
|
91 | - } |
|
84 | + /** |
|
85 | + * Retrieves the string representation of this composite expression. |
|
86 | + * |
|
87 | + * @return string |
|
88 | + */ |
|
89 | + public function __toString() { |
|
90 | + return (string) $this->compositeExpression; |
|
91 | + } |
|
92 | 92 | } |
@@ -25,17 +25,17 @@ |
||
25 | 25 | use OCP\DB\QueryBuilder\ILiteral; |
26 | 26 | |
27 | 27 | class Literal implements ILiteral { |
28 | - /** @var mixed */ |
|
29 | - protected $literal; |
|
28 | + /** @var mixed */ |
|
29 | + protected $literal; |
|
30 | 30 | |
31 | - public function __construct($literal) { |
|
32 | - $this->literal = $literal; |
|
33 | - } |
|
31 | + public function __construct($literal) { |
|
32 | + $this->literal = $literal; |
|
33 | + } |
|
34 | 34 | |
35 | - /** |
|
36 | - * @return string |
|
37 | - */ |
|
38 | - public function __toString() { |
|
39 | - return (string) $this->literal; |
|
40 | - } |
|
35 | + /** |
|
36 | + * @return string |
|
37 | + */ |
|
38 | + public function __toString() { |
|
39 | + return (string) $this->literal; |
|
40 | + } |
|
41 | 41 | } |