mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
Merge pull request #5847 from nextcloud/make-phan-config-more-strict-2
Phan fixes
This commit is contained in:
commit
2b895e0c60
145 changed files with 402 additions and 317 deletions
|
|
@ -20,9 +20,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
use \OCA\Comments\AppInfo\Application;
|
||||
|
||||
$application = new Application();
|
||||
$application->registerRoutes($this, ['routes' => [
|
||||
['name' => 'Notifications#view', 'url' => '/notifications/view/{id}', 'verb' => 'GET'],
|
||||
]]);
|
||||
return [
|
||||
'routes' => [
|
||||
['name' => 'Notifications#view', 'url' => '/notifications/view/{id}', 'verb' => 'GET'],
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class Listener {
|
|||
|
||||
// Get all mount point owners
|
||||
$cache = $this->mountCollection->getMountCache();
|
||||
$mounts = $cache->getMountsForFileId($event->getComment()->getObjectId());
|
||||
$mounts = $cache->getMountsForFileId((int)$event->getComment()->getObjectId());
|
||||
if (empty($mounts)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -93,7 +93,7 @@ class Listener {
|
|||
foreach ($mounts as $mount) {
|
||||
$owner = $mount->getUser()->getUID();
|
||||
$ownerFolder = $this->rootFolder->getUserFolder($owner);
|
||||
$nodes = $ownerFolder->getById($event->getComment()->getObjectId());
|
||||
$nodes = $ownerFolder->getById((int)$event->getComment()->getObjectId());
|
||||
if (!empty($nodes)) {
|
||||
/** @var Node $node */
|
||||
$node = array_shift($nodes);
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ class Provider implements IProvider {
|
|||
trim($subjectParameters[1], '/'),
|
||||
]))
|
||||
->setRichSubject($this->l->t('You commented on {file}'), [
|
||||
'file' => $this->generateFileParameter($event->getObjectId(), $subjectParameters[1]),
|
||||
'file' => $this->generateFileParameter((int)$event->getObjectId(), $subjectParameters[1]),
|
||||
]);
|
||||
} else {
|
||||
$author = $this->generateUserParameter($subjectParameters[0]);
|
||||
|
|
@ -157,7 +157,7 @@ class Provider implements IProvider {
|
|||
]))
|
||||
->setRichSubject($this->l->t('{author} commented on {file}'), [
|
||||
'author' => $author,
|
||||
'file' => $this->generateFileParameter($event->getObjectId(), $subjectParameters[1]),
|
||||
'file' => $this->generateFileParameter((int)$event->getObjectId(), $subjectParameters[1]),
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -173,7 +173,7 @@ class Provider implements IProvider {
|
|||
protected function parseMessage(IEvent $event) {
|
||||
$messageParameters = $event->getMessageParameters();
|
||||
try {
|
||||
$comment = $this->commentsManager->get((int) $messageParameters[0]);
|
||||
$comment = $this->commentsManager->get((string) $messageParameters[0]);
|
||||
$message = $comment->getMessage();
|
||||
$message = str_replace("\n", '<br />', str_replace(['<', '>'], ['<', '>'], $message));
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class Notifications extends Controller {
|
|||
if($comment->getObjectType() !== 'files') {
|
||||
return new NotFoundResponse();
|
||||
}
|
||||
$files = $this->folder->getById($comment->getObjectId());
|
||||
$files = $this->folder->getById((int)$comment->getObjectId());
|
||||
if(count($files) === 0) {
|
||||
$this->markProcessed($comment);
|
||||
return new NotFoundResponse();
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class Notifier implements INotifier {
|
|||
throw new \InvalidArgumentException('Unsupported comment object');
|
||||
}
|
||||
$userFolder = $this->rootFolder->getUserFolder($notification->getUser());
|
||||
$nodes = $userFolder->getById($parameters[1]);
|
||||
$nodes = $userFolder->getById((int)$parameters[1]);
|
||||
if(empty($nodes)) {
|
||||
throw new \InvalidArgumentException('Cannot resolve file id to Node instance');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,32 +168,32 @@ class Calendar extends Base {
|
|||
case self::SUBJECT_UNSHARE_USER . '_self':
|
||||
return [
|
||||
'actor' => $this->generateUserParameter($parameters[0]),
|
||||
'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]),
|
||||
'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]),
|
||||
];
|
||||
case self::SUBJECT_SHARE_USER . '_you':
|
||||
case self::SUBJECT_UNSHARE_USER . '_you':
|
||||
return [
|
||||
'user' => $this->generateUserParameter($parameters[0]),
|
||||
'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]),
|
||||
'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]),
|
||||
];
|
||||
case self::SUBJECT_SHARE_USER . '_by':
|
||||
case self::SUBJECT_UNSHARE_USER . '_by':
|
||||
return [
|
||||
'user' => $this->generateUserParameter($parameters[0]),
|
||||
'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]),
|
||||
'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]),
|
||||
'actor' => $this->generateUserParameter($parameters[2]),
|
||||
];
|
||||
case self::SUBJECT_SHARE_GROUP . '_you':
|
||||
case self::SUBJECT_UNSHARE_GROUP . '_you':
|
||||
return [
|
||||
'group' => $this->generateGroupParameter($parameters[0]),
|
||||
'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]),
|
||||
'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]),
|
||||
];
|
||||
case self::SUBJECT_SHARE_GROUP . '_by':
|
||||
case self::SUBJECT_UNSHARE_GROUP . '_by':
|
||||
return [
|
||||
'group' => $this->generateGroupParameter($parameters[0]),
|
||||
'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]),
|
||||
'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]),
|
||||
'actor' => $this->generateUserParameter($parameters[2]),
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,14 +124,14 @@ class Event extends Base {
|
|||
case self::SUBJECT_OBJECT_UPDATE . '_event':
|
||||
return [
|
||||
'actor' => $this->generateUserParameter($parameters[0]),
|
||||
'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]),
|
||||
'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]),
|
||||
'event' => $this->generateObjectParameter($parameters[2]),
|
||||
];
|
||||
case self::SUBJECT_OBJECT_ADD . '_event_self':
|
||||
case self::SUBJECT_OBJECT_DELETE . '_event_self':
|
||||
case self::SUBJECT_OBJECT_UPDATE . '_event_self':
|
||||
return [
|
||||
'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]),
|
||||
'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]),
|
||||
'event' => $this->generateObjectParameter($parameters[2]),
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class Todo extends Event {
|
|||
case self::SUBJECT_OBJECT_UPDATE . '_todo_needs_action':
|
||||
return [
|
||||
'actor' => $this->generateUserParameter($parameters[0]),
|
||||
'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]),
|
||||
'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]),
|
||||
'todo' => $this->generateObjectParameter($parameters[2]),
|
||||
];
|
||||
case self::SUBJECT_OBJECT_ADD . '_todo_self':
|
||||
|
|
@ -104,7 +104,7 @@ class Todo extends Event {
|
|||
case self::SUBJECT_OBJECT_UPDATE . '_todo_completed_self':
|
||||
case self::SUBJECT_OBJECT_UPDATE . '_todo_needs_action_self':
|
||||
return [
|
||||
'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]),
|
||||
'calendar' => $this->generateCalendarParameter((int)$event->getObjectId(), $parameters[1]),
|
||||
'todo' => $this->generateObjectParameter($parameters[2]),
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ class BirthdayService {
|
|||
* @param string $cardData
|
||||
* @param array $book
|
||||
* @param int $calendarId
|
||||
* @param string $type
|
||||
* @param string[] $type
|
||||
*/
|
||||
private function updateCalendar($cardUri, $cardData, $book, $calendarId, $type) {
|
||||
$objectUri = $book['uri'] . '-' . $cardUri . $type['postfix'] . '.ics';
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ use Sabre\VObject\Component\VCalendar;
|
|||
use Sabre\VObject\DateTimeParser;
|
||||
use Sabre\VObject\Reader;
|
||||
use Sabre\VObject\Recur\EventIterator;
|
||||
use Sabre\Uri;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\EventDispatcher\GenericEvent;
|
||||
|
||||
|
|
@ -318,7 +319,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
}
|
||||
}
|
||||
|
||||
list(, $name) = URLUtil::splitPath($row['principaluri']);
|
||||
list(, $name) = Uri\split($row['principaluri']);
|
||||
$uri = $row['uri'] . '_shared_by_' . $name;
|
||||
$row['displayname'] = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')';
|
||||
$components = [];
|
||||
|
|
@ -432,7 +433,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
->execute();
|
||||
|
||||
while($row = $result->fetch()) {
|
||||
list(, $name) = URLUtil::splitPath($row['principaluri']);
|
||||
list(, $name) = Uri\split($row['principaluri']);
|
||||
$row['displayname'] = $row['displayname'] . "($name)";
|
||||
$components = [];
|
||||
if ($row['components']) {
|
||||
|
|
@ -498,7 +499,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
throw new NotFound('Node with name \'' . $uri . '\' could not be found');
|
||||
}
|
||||
|
||||
list(, $name) = URLUtil::splitPath($row['principaluri']);
|
||||
list(, $name) = Uri\split($row['principaluri']);
|
||||
$row['displayname'] = $row['displayname'] . ' ' . "($name)";
|
||||
$components = [];
|
||||
if ($row['components']) {
|
||||
|
|
@ -2104,7 +2105,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
|
||||
private function convertPrincipal($principalUri, $toV2) {
|
||||
if ($this->principalBackend->getPrincipalPrefix() === 'principals') {
|
||||
list(, $name) = URLUtil::splitPath($principalUri);
|
||||
list(, $name) = Uri\split($principalUri);
|
||||
if ($toV2 === true) {
|
||||
return "principals/users/$name";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class Plugin extends \Sabre\CalDAV\Plugin {
|
|||
function getCalendarHomeForPrincipal($principalUrl) {
|
||||
|
||||
if (strrpos($principalUrl, 'principals/users', -strlen($principalUrl)) !== false) {
|
||||
list(, $principalId) = URLUtil::splitPath($principalUrl);
|
||||
list(, $principalId) = \Sabre\Uri\split($principalUrl);
|
||||
return self::CALENDAR_ROOT .'/' . $principalId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
|
|||
}
|
||||
}
|
||||
|
||||
list(, $name) = URLUtil::splitPath($row['principaluri']);
|
||||
list(, $name) = \Sabre\Uri\split($row['principaluri']);
|
||||
$uri = $row['uri'] . '_shared_by_' . $name;
|
||||
$displayName = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')';
|
||||
|
||||
|
|
@ -1091,7 +1091,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
|
|||
|
||||
private function convertPrincipal($principalUri, $toV2) {
|
||||
if ($this->principalBackend->getPrincipalPrefix() === 'principals') {
|
||||
list(, $name) = URLUtil::splitPath($principalUri);
|
||||
list(, $name) = \Sabre\Uri\split($principalUri);
|
||||
if ($toV2 === true) {
|
||||
return "principals/users/$name";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,15 +44,15 @@ class Plugin extends \Sabre\CardDAV\Plugin {
|
|||
protected function getAddressbookHomeForPrincipal($principal) {
|
||||
|
||||
if (strrpos($principal, 'principals/users', -strlen($principal)) !== false) {
|
||||
list(, $principalId) = URLUtil::splitPath($principal);
|
||||
list(, $principalId) = \Sabre\Uri\split($principal);
|
||||
return self::ADDRESSBOOK_ROOT . '/users/' . $principalId;
|
||||
}
|
||||
if (strrpos($principal, 'principals/groups', -strlen($principal)) !== false) {
|
||||
list(, $principalId) = URLUtil::splitPath($principal);
|
||||
list(, $principalId) = \Sabre\Uri\split($principal);
|
||||
return self::ADDRESSBOOK_ROOT . '/groups/' . $principalId;
|
||||
}
|
||||
if (strrpos($principal, 'principals/system', -strlen($principal)) !== false) {
|
||||
list(, $principalId) = URLUtil::splitPath($principal);
|
||||
list(, $principalId) = \Sabre\Uri\split($principal);
|
||||
return self::ADDRESSBOOK_ROOT . '/system/' . $principalId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class LegacyDAVACL extends DavAclPlugin {
|
|||
}
|
||||
|
||||
private function convertPrincipal($principal, $toV2) {
|
||||
list(, $name) = URLUtil::splitPath($principal);
|
||||
list(, $name) = \Sabre\Uri\split($principal);
|
||||
if ($toV2) {
|
||||
return "principals/users/$name";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ class Directory extends \OCA\DAV\Connector\Sabre\Node
|
|||
throw new \Sabre\DAV\Exception\Forbidden('Could not copy directory ' . $sourceNode->getName() . ', target exists');
|
||||
}
|
||||
|
||||
list($sourceDir,) = \Sabre\HTTP\URLUtil::splitPath($sourceNode->getPath());
|
||||
list($sourceDir,) = \Sabre\Uri\split($sourceNode->getPath());
|
||||
$destinationDir = $this->getPath();
|
||||
|
||||
$sourcePath = $sourceNode->getPath();
|
||||
|
|
|
|||
|
|
@ -396,7 +396,7 @@ class File extends Node implements IFile {
|
|||
* @throws ServiceUnavailable
|
||||
*/
|
||||
private function createFileChunked($data) {
|
||||
list($path, $name) = \Sabre\HTTP\URLUtil::splitPath($this->path);
|
||||
list($path, $name) = \Sabre\Uri\split($this->path);
|
||||
|
||||
$info = \OC_FileChunking::decodeName($name);
|
||||
if (empty($info)) {
|
||||
|
|
|
|||
|
|
@ -196,14 +196,14 @@ class FilesPlugin extends ServerPlugin {
|
|||
if (!$sourceNode instanceof Node) {
|
||||
return;
|
||||
}
|
||||
list($sourceDir,) = \Sabre\HTTP\URLUtil::splitPath($source);
|
||||
list($destinationDir,) = \Sabre\HTTP\URLUtil::splitPath($destination);
|
||||
list($sourceDir,) = \Sabre\Uri\split($source);
|
||||
list($destinationDir,) = \Sabre\Uri\split($destination);
|
||||
|
||||
if ($sourceDir !== $destinationDir) {
|
||||
$sourceNodeFileInfo = $sourceNode->getFileInfo();
|
||||
if (is_null($sourceNodeFileInfo)) {
|
||||
if ($sourceNodeFileInfo === null) {
|
||||
throw new NotFound($source . ' does not exist');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$sourceNodeFileInfo->isDeletable()) {
|
||||
throw new Forbidden($source . " cannot be deleted");
|
||||
|
|
@ -434,7 +434,7 @@ class FilesPlugin extends ServerPlugin {
|
|||
public function sendFileIdHeader($filePath, \Sabre\DAV\INode $node = null) {
|
||||
// chunked upload handling
|
||||
if (isset($_SERVER['HTTP_OC_CHUNKED'])) {
|
||||
list($path, $name) = \Sabre\HTTP\URLUtil::splitPath($filePath);
|
||||
list($path, $name) = \Sabre\Uri\split($filePath);
|
||||
$info = \OC_FileChunking::decodeName($name);
|
||||
if (!empty($info)) {
|
||||
$filePath = $path . '/' . $info['name'];
|
||||
|
|
|
|||
|
|
@ -126,8 +126,8 @@ abstract class Node implements \Sabre\DAV\INode {
|
|||
throw new \Sabre\DAV\Exception\Forbidden();
|
||||
}
|
||||
|
||||
list($parentPath,) = \Sabre\HTTP\URLUtil::splitPath($this->path);
|
||||
list(, $newName) = \Sabre\HTTP\URLUtil::splitPath($name);
|
||||
list($parentPath,) = \Sabre\Uri\split($this->path);
|
||||
list(, $newName) = \Sabre\Uri\split($name);
|
||||
|
||||
// verify path of the target
|
||||
$this->verifyPath();
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class ObjectTree extends \Sabre\DAV\Tree {
|
|||
private function resolveChunkFile($path) {
|
||||
if (isset($_SERVER['HTTP_OC_CHUNKED'])) {
|
||||
// resolve to real file name to find the proper node
|
||||
list($dir, $name) = \Sabre\HTTP\URLUtil::splitPath($path);
|
||||
list($dir, $name) = \Sabre\Uri\split($path);
|
||||
if ($dir == '/' || $dir == '.') {
|
||||
$dir = '';
|
||||
}
|
||||
|
|
@ -221,7 +221,7 @@ class ObjectTree extends \Sabre\DAV\Tree {
|
|||
// this will trigger existence check
|
||||
$this->getNodeForPath($source);
|
||||
|
||||
list($destinationDir, $destinationName) = \Sabre\HTTP\URLUtil::splitPath($destination);
|
||||
list($destinationDir, $destinationName) = \Sabre\Uri\split($destination);
|
||||
try {
|
||||
$this->fileView->verifyPath($destinationDir, $destinationName);
|
||||
} catch (\OCP\Files\InvalidPathException $ex) {
|
||||
|
|
@ -238,7 +238,7 @@ class ObjectTree extends \Sabre\DAV\Tree {
|
|||
throw new FileLocked($e->getMessage(), $e->getCode(), $e);
|
||||
}
|
||||
|
||||
list($destinationDir,) = \Sabre\HTTP\URLUtil::splitPath($destination);
|
||||
list($destinationDir,) = \Sabre\Uri\split($destination);
|
||||
$this->markDirty($destinationDir);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class Principal implements BackendInterface {
|
|||
* @return array
|
||||
*/
|
||||
public function getPrincipalByPath($path) {
|
||||
list($prefix, $name) = URLUtil::splitPath($path);
|
||||
list($prefix, $name) = \Sabre\Uri\split($path);
|
||||
|
||||
if ($prefix === $this->principalPrefix) {
|
||||
$user = $this->userManager->get($name);
|
||||
|
|
@ -138,7 +138,7 @@ class Principal implements BackendInterface {
|
|||
* @throws Exception
|
||||
*/
|
||||
public function getGroupMembership($principal, $needGroups = false) {
|
||||
list($prefix, $name) = URLUtil::splitPath($principal);
|
||||
list($prefix, $name) = \Sabre\Uri\split($principal);
|
||||
|
||||
if ($prefix === $this->principalPrefix) {
|
||||
$user = $this->userManager->get($name);
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class QuotaPlugin extends \Sabre\DAV\ServerPlugin {
|
|||
if (substr($uri, 0, 1) !== '/') {
|
||||
$uri = '/' . $uri;
|
||||
}
|
||||
list($parentUri, $newName) = URLUtil::splitPath($uri);
|
||||
list($parentUri, $newName) = \Sabre\Uri\split($uri);
|
||||
if(is_null($parentUri)) {
|
||||
$parentUri = '';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ class SystemPrincipalBackend extends AbstractBackend {
|
|||
* @return array
|
||||
*/
|
||||
function getGroupMembership($principal) {
|
||||
list($prefix, $name) = URLUtil::splitPath($principal);
|
||||
list($prefix, $name) = \Sabre\Uri\split($principal);
|
||||
|
||||
if ($prefix === 'principals/system') {
|
||||
$principal = $this->getPrincipalByPath($principal);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class FilesHome extends Directory {
|
|||
}
|
||||
|
||||
function getName() {
|
||||
list(,$name) = URLUtil::splitPath($this->principalInfo['uri']);
|
||||
list(,$name) = \Sabre\Uri\split($this->principalInfo['uri']);
|
||||
return $name;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class RootCollection extends AbstractPrincipalCollection {
|
|||
* @return INode
|
||||
*/
|
||||
function getChildForPrincipal(array $principalInfo) {
|
||||
list(,$name) = URLUtil::splitPath($principalInfo['uri']);
|
||||
list(,$name) = \Sabre\Uri\split($principalInfo['uri']);
|
||||
$user = \OC::$server->getUserSession()->getUser();
|
||||
if (is_null($user) || $name !== $user->getUID()) {
|
||||
// a user is only allowed to see their own home contents, so in case another collection
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class RetryJob extends Job {
|
|||
* run the job, then remove it from the jobList
|
||||
*
|
||||
* @param JobList $jobList
|
||||
* @param ILogger $logger
|
||||
* @param ILogger|null $logger
|
||||
*/
|
||||
public function execute($jobList, ILogger $logger = null) {
|
||||
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class GetSharedSecret extends Job{
|
|||
* run the job, then remove it from the joblist
|
||||
*
|
||||
* @param JobList $jobList
|
||||
* @param ILogger $logger
|
||||
* @param ILogger|null $logger
|
||||
*/
|
||||
public function execute($jobList, ILogger $logger = null) {
|
||||
$target = $this->argument['url'];
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class RequestSharedSecret extends Job {
|
|||
* run the job, then remove it from the joblist
|
||||
*
|
||||
* @param JobList $jobList
|
||||
* @param ILogger $logger
|
||||
* @param ILogger|null $logger
|
||||
*/
|
||||
public function execute($jobList, ILogger $logger = null) {
|
||||
$target = $this->argument['url'];
|
||||
|
|
|
|||
|
|
@ -71,27 +71,27 @@ class Applicable extends Base {
|
|||
'The id of the mount to edit'
|
||||
)->addOption(
|
||||
'add-user',
|
||||
null,
|
||||
'',
|
||||
InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
|
||||
'user to add as applicable'
|
||||
)->addOption(
|
||||
'remove-user',
|
||||
null,
|
||||
'',
|
||||
InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
|
||||
'user to remove as applicable'
|
||||
)->addOption(
|
||||
'add-group',
|
||||
null,
|
||||
'',
|
||||
InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
|
||||
'group to add as applicable'
|
||||
)->addOption(
|
||||
'remove-group',
|
||||
null,
|
||||
'',
|
||||
InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED,
|
||||
'group to remove as applicable'
|
||||
)->addOption(
|
||||
'remove-all',
|
||||
null,
|
||||
'',
|
||||
InputOption::VALUE_NONE,
|
||||
'Set the mount to be globally applicable'
|
||||
);
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class Create extends Base {
|
|||
->setDescription('Create a new mount configuration')
|
||||
->addOption(
|
||||
'user',
|
||||
null,
|
||||
'',
|
||||
InputOption::VALUE_OPTIONAL,
|
||||
'user to add the mount configuration for, if not set the mount will be added as system mount'
|
||||
)
|
||||
|
|
@ -110,7 +110,7 @@ class Create extends Base {
|
|||
)
|
||||
->addOption(
|
||||
'dry',
|
||||
null,
|
||||
'',
|
||||
InputOption::VALUE_NONE,
|
||||
'Don\'t save the created mount, only list the new mount'
|
||||
);
|
||||
|
|
@ -180,7 +180,7 @@ class Create extends Base {
|
|||
if ($input->getOption('output') === self::OUTPUT_FORMAT_PLAIN) {
|
||||
$output->writeln('<info>Storage created with id ' . $mount->getId() . '</info>');
|
||||
} else {
|
||||
$output->writeln($mount->getId());
|
||||
$output->writeln((string)$mount->getId());
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class Delete extends Base {
|
|||
$question = new ConfirmationQuestion('Delete this mount? [y/N] ', false);
|
||||
|
||||
if (!$questionHelper->ask($input, $output, $question)) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class Import extends Base {
|
|||
->setDescription('Import mount configurations')
|
||||
->addOption(
|
||||
'user',
|
||||
null,
|
||||
'',
|
||||
InputOption::VALUE_OPTIONAL,
|
||||
'user to add the mount configurations for, if not set the mount will be added as system mount'
|
||||
)
|
||||
|
|
@ -98,7 +98,7 @@ class Import extends Base {
|
|||
)
|
||||
->addOption(
|
||||
'dry',
|
||||
null,
|
||||
'',
|
||||
InputOption::VALUE_NONE,
|
||||
'Don\'t save the imported mounts, only list the new mounts'
|
||||
);
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class ListCommand extends Base {
|
|||
'user id to list the personal mounts for, if no user is provided admin mounts will be listed'
|
||||
)->addOption(
|
||||
'show-password',
|
||||
null,
|
||||
'',
|
||||
InputOption::VALUE_NONE,
|
||||
'show passwords and secrets'
|
||||
)->addOption(
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class Notify extends Base {
|
|||
'The password for the remote mount (required only for some mount configuration that don\'t store credentials)'
|
||||
)->addOption(
|
||||
'path',
|
||||
null,
|
||||
'',
|
||||
InputOption::VALUE_REQUIRED,
|
||||
'The directory in the storage to listen for updates in',
|
||||
'/'
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class AuthMechanism implements \JsonSerializable {
|
|||
|
||||
/**
|
||||
* @param string $scheme
|
||||
* @return self
|
||||
* @return $this
|
||||
*/
|
||||
public function setScheme($scheme) {
|
||||
$this->scheme = $scheme;
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class Backend implements \JsonSerializable {
|
|||
|
||||
/**
|
||||
* @param string $class
|
||||
* @return self
|
||||
* @return $this
|
||||
*/
|
||||
public function setStorageClass($class) {
|
||||
$this->storageClass = $class;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ trait FrontendDefinitionTrait {
|
|||
|
||||
/**
|
||||
* @param string $text
|
||||
* @return self
|
||||
* @return $this
|
||||
*/
|
||||
public function setText($text) {
|
||||
$this->text = $text;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ trait IdentifierTrait {
|
|||
|
||||
/**
|
||||
* @param string $identifier
|
||||
* @return self
|
||||
* @return $this
|
||||
*/
|
||||
public function setIdentifier($identifier) {
|
||||
$this->identifier = $identifier;
|
||||
|
|
@ -63,7 +63,7 @@ trait IdentifierTrait {
|
|||
|
||||
/**
|
||||
* @param string $alias
|
||||
* @return self
|
||||
* @return $this
|
||||
*/
|
||||
public function addIdentifierAlias($alias) {
|
||||
$this->identifierAliases[] = $alias;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class InsufficientDataForMeaningfulAnswerException extends StorageNotAvailableEx
|
|||
*
|
||||
* @param string $message
|
||||
* @param int $code
|
||||
* @param \Exception $previous
|
||||
* @param \Exception|null $previous
|
||||
* @since 6.0.0
|
||||
*/
|
||||
public function __construct($message = '', $code = self::STATUS_INDETERMINATE, \Exception $previous = null) {
|
||||
|
|
|
|||
|
|
@ -313,11 +313,11 @@ class OC_Mount_Config {
|
|||
private static function getSingleDependencyMessage(\OCP\IL10N $l, $module, $backend) {
|
||||
switch (strtolower($module)) {
|
||||
case 'curl':
|
||||
return (string)$l->t('The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', $backend);
|
||||
return (string)$l->t('The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]);
|
||||
case 'ftp':
|
||||
return (string)$l->t('The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', $backend);
|
||||
return (string)$l->t('The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]);
|
||||
default:
|
||||
return (string)$l->t('"%s" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it.', array($module, $backend));
|
||||
return (string)$l->t('"%s" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$module, $backend]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class RetryJob extends Job {
|
|||
* run the job, then remove it from the jobList
|
||||
*
|
||||
* @param JobList $jobList
|
||||
* @param ILogger $logger
|
||||
* @param ILogger|null $logger
|
||||
*/
|
||||
public function execute($jobList, ILogger $logger = null) {
|
||||
if ($this->shouldRun($this->argument)) {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ namespace OCA\Provisioning_API\Tests\Controller;
|
|||
|
||||
use OCA\Provisioning_API\Controller\GroupsController;
|
||||
use OCP\IGroupManager;
|
||||
use OCP\ILogger;
|
||||
use OCP\IUserSession;
|
||||
|
||||
class GroupsControllerTest extends \Test\TestCase {
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class Notifier implements INotifier {
|
|||
}
|
||||
|
||||
$notification->setParsedSubject($l->t('Update for %1$s to version %2$s is available.', [$appName, $notification->getObjectId()]))
|
||||
->setRichSubject($l->t('Update for {app} to version %s is available.', $notification->getObjectId()), [
|
||||
->setRichSubject($l->t('Update for {app} to version %s is available.', [$notification->getObjectId()]), [
|
||||
'app' => [
|
||||
'type' => 'app',
|
||||
'id' => $notification->getObjectType(),
|
||||
|
|
|
|||
|
|
@ -63,9 +63,9 @@ class Notifier implements INotifier {
|
|||
$params = $notification->getSubjectParameters();
|
||||
$days = (int) $params[0];
|
||||
if ($days === 2) {
|
||||
$notification->setParsedSubject($l->t('Your password will expire tomorrow.', $days));
|
||||
$notification->setParsedSubject($l->t('Your password will expire tomorrow.'));
|
||||
} else if ($days === 1) {
|
||||
$notification->setParsedSubject($l->t('Your password will expire today.', $days));
|
||||
$notification->setParsedSubject($l->t('Your password will expire today.'));
|
||||
} else {
|
||||
$notification->setParsedSubject($l->n(
|
||||
'Your password will expire within %n day.',
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ class Manager implements IManager {
|
|||
return $row;
|
||||
}
|
||||
|
||||
throw new \UnexpectedValueException($this->l->t('Operation #%s does not exist', $id));
|
||||
throw new \UnexpectedValueException($this->l->t('Operation #%s does not exist', [$id]));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -250,11 +250,11 @@ class Manager implements IManager {
|
|||
/** @var IOperation $instance */
|
||||
$instance = $this->container->query($class);
|
||||
} catch (QueryException $e) {
|
||||
throw new \UnexpectedValueException($this->l->t('Operation %s does not exist', $class));
|
||||
throw new \UnexpectedValueException($this->l->t('Operation %s does not exist', [$class]));
|
||||
}
|
||||
|
||||
if (!($instance instanceof IOperation)) {
|
||||
throw new \UnexpectedValueException($this->l->t('Operation %s is invalid', $class));
|
||||
throw new \UnexpectedValueException($this->l->t('Operation %s is invalid', [$class]));
|
||||
}
|
||||
|
||||
$instance->validateOperation($name, $checks, $operation);
|
||||
|
|
@ -264,11 +264,11 @@ class Manager implements IManager {
|
|||
/** @var ICheck $instance */
|
||||
$instance = $this->container->query($check['class']);
|
||||
} catch (QueryException $e) {
|
||||
throw new \UnexpectedValueException($this->l->t('Check %s does not exist', $class));
|
||||
throw new \UnexpectedValueException($this->l->t('Check %s does not exist', [$class]));
|
||||
}
|
||||
|
||||
if (!($instance instanceof ICheck)) {
|
||||
throw new \UnexpectedValueException($this->l->t('Check %s is invalid', $class));
|
||||
throw new \UnexpectedValueException($this->l->t('Check %s is invalid', [$class]));
|
||||
}
|
||||
|
||||
$instance->validateCheck($check['operator'], $check['value']);
|
||||
|
|
|
|||
|
|
@ -173,6 +173,7 @@ class AvatarController extends Controller {
|
|||
if (isset($path)) {
|
||||
$path = stripslashes($path);
|
||||
$userFolder = $this->rootFolder->getUserFolder($this->userId);
|
||||
/** @var File $node */
|
||||
$node = $userFolder->get($path);
|
||||
if (!($node instanceof File)) {
|
||||
return new JSONResponse(['data' => ['message' => $this->l->t('Please select a file.')]]);
|
||||
|
|
@ -296,7 +297,7 @@ class AvatarController extends Controller {
|
|||
Http::STATUS_OK,
|
||||
['Content-Type' => $image->mimeType()]);
|
||||
|
||||
$resp->setETag(crc32($image->data()));
|
||||
$resp->setETag((string)crc32($image->data()));
|
||||
$resp->cacheFor(0);
|
||||
$resp->setLastModified(new \DateTime('now', new \DateTimeZone('GMT')));
|
||||
return $resp;
|
||||
|
|
@ -328,7 +329,7 @@ class AvatarController extends Controller {
|
|||
}
|
||||
|
||||
$image = new \OC_Image($tmpAvatar);
|
||||
$image->crop($crop['x'], $crop['y'], round($crop['w']), round($crop['h']));
|
||||
$image->crop($crop['x'], $crop['y'], (int)round($crop['w']), (int)round($crop['h']));
|
||||
try {
|
||||
$avatar = $this->avatarManager->getAvatar($this->userId);
|
||||
$avatar->set($image);
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class ContactsMenuController extends Controller {
|
|||
* @NoAdminRequired
|
||||
*
|
||||
* @param string|null filter
|
||||
* @return JSONResponse
|
||||
* @return \JsonSerializable[]
|
||||
*/
|
||||
public function index($filter = null) {
|
||||
return $this->manager->getEntries($this->userSession->getUser(), $filter);
|
||||
|
|
@ -65,15 +65,14 @@ class ContactsMenuController extends Controller {
|
|||
*
|
||||
* @param integer $shareType
|
||||
* @param string $shareWith
|
||||
* @return JSONResponse
|
||||
* @return JSONResponse|\JsonSerializable
|
||||
*/
|
||||
public function findOne($shareType, $shareWith) {
|
||||
$contact = $this->manager->findOne($this->userSession->getUser(), $shareType, $shareWith);
|
||||
|
||||
if ($contact) {
|
||||
return $contact;
|
||||
} else {
|
||||
return new JSONResponse([], Http::STATUS_NOT_FOUND);
|
||||
}
|
||||
return new JSONResponse([], Http::STATUS_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,11 +122,11 @@ class OCSController extends \OCP\AppFramework\OCSController {
|
|||
]);
|
||||
}
|
||||
|
||||
$response = new DataResponse(null, 102);
|
||||
$response = new DataResponse([], 102);
|
||||
$response->throttle();
|
||||
return $response;
|
||||
}
|
||||
return new DataResponse(null, 101);
|
||||
return new DataResponse([], 101);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -146,6 +146,6 @@ class OCSController extends \OCP\AppFramework\OCSController {
|
|||
return new DataResponse($data);
|
||||
}
|
||||
|
||||
return new DataResponse('User not found', 404);
|
||||
return new DataResponse(['User not found'], 404);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,10 @@ class FeedBackHandler {
|
|||
private $progressStateStep = 0;
|
||||
/** @var string */
|
||||
private $currentStep;
|
||||
/** @var \OCP\IEventSource */
|
||||
private $eventSource;
|
||||
/** @var \OCP\IL10N */
|
||||
private $l10n;
|
||||
|
||||
public function __construct(\OCP\IEventSource $eventSource, \OCP\IL10N $l10n) {
|
||||
$this->eventSource = $eventSource;
|
||||
|
|
@ -220,7 +224,7 @@ if (OC::checkUpgrade(false)) {
|
|||
|
||||
if (!empty($disabledApps)) {
|
||||
$eventSource->send('notice',
|
||||
(string)$l->t('Following apps have been disabled: %s', implode(', ', $disabledApps)));
|
||||
(string)$l->t('Following apps have been disabled: %s', [implode(', ', $disabledApps)]));
|
||||
}
|
||||
} else {
|
||||
$eventSource->send('notice', (string)$l->t('Already up to date'));
|
||||
|
|
|
|||
|
|
@ -36,6 +36,12 @@ class MigrationSchemaChecker extends NodeVisitorAbstract {
|
|||
/** @var array */
|
||||
public $errors = [];
|
||||
|
||||
/**
|
||||
* @param Node $node
|
||||
* @return void
|
||||
*
|
||||
* @suppress PhanUndeclaredProperty
|
||||
*/
|
||||
public function enterNode(Node $node) {
|
||||
/**
|
||||
* Check tables
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ class DependencyAnalyzer {
|
|||
}, $supportedDatabases);
|
||||
$currentDatabase = $this->platform->getDatabase();
|
||||
if (!in_array($currentDatabase, $supportedDatabases)) {
|
||||
$missing[] = (string)$this->l->t('Following databases are supported: %s', implode(', ', $supportedDatabases));
|
||||
$missing[] = (string)$this->l->t('Following databases are supported: %s', [implode(', ', $supportedDatabases)]);
|
||||
}
|
||||
return $missing;
|
||||
}
|
||||
|
|
@ -282,7 +282,7 @@ class DependencyAnalyzer {
|
|||
}
|
||||
$currentOS = $this->platform->getOS();
|
||||
if (!in_array($currentOS, $oss)) {
|
||||
$missing[] = (string)$this->l->t('Following platforms are supported: %s', implode(', ', $oss));
|
||||
$missing[] = (string)$this->l->t('Following platforms are supported: %s', [implode(', ', $oss)]);
|
||||
}
|
||||
return $missing;
|
||||
}
|
||||
|
|
@ -315,12 +315,12 @@ class DependencyAnalyzer {
|
|||
|
||||
if (!is_null($minVersion)) {
|
||||
if ($this->compareSmaller($this->platform->getOcVersion(), $minVersion)) {
|
||||
$missing[] = (string)$this->l->t('Server version %s or higher is required.', $this->toVisibleVersion($minVersion));
|
||||
$missing[] = (string)$this->l->t('Server version %s or higher is required.', [$this->toVisibleVersion($minVersion)]);
|
||||
}
|
||||
}
|
||||
if (!is_null($maxVersion)) {
|
||||
if ($this->compareBigger($this->platform->getOcVersion(), $maxVersion)) {
|
||||
$missing[] = (string)$this->l->t('Server version %s or lower is required.', $this->toVisibleVersion($maxVersion));
|
||||
$missing[] = (string)$this->l->t('Server version %s or lower is required.', [$this->toVisibleVersion($maxVersion)]);
|
||||
}
|
||||
}
|
||||
return $missing;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
|
|||
* Put your class dependencies in here
|
||||
* @param string $appName the name of the app
|
||||
* @param array $urlParams
|
||||
* @param ServerContainer $server
|
||||
* @param ServerContainer|null $server
|
||||
*/
|
||||
public function __construct($appName, $urlParams = array(), ServerContainer $server = null){
|
||||
parent::__construct();
|
||||
|
|
|
|||
|
|
@ -721,7 +721,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
|
||||
// strip off the script name's dir and file name
|
||||
// FIXME: Sabre does not really belong here
|
||||
list($path, $name) = \Sabre\HTTP\URLUtil::splitPath($scriptName);
|
||||
list($path, $name) = \Sabre\Uri\split($scriptName);
|
||||
if (!empty($path)) {
|
||||
if($path === $pathInfo || strpos($pathInfo, $path.'/') === 0) {
|
||||
$pathInfo = substr($pathInfo, strlen($path));
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ abstract class Job implements IJob {
|
|||
|
||||
/**
|
||||
* @param JobList $jobList
|
||||
* @param ILogger $logger
|
||||
* @param ILogger|null $logger
|
||||
*/
|
||||
public function execute($jobList, ILogger $logger = null) {
|
||||
$jobList->setLastRun($this);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ abstract class QueuedJob extends Job {
|
|||
* run the job, then remove it from the joblist
|
||||
*
|
||||
* @param JobList $jobList
|
||||
* @param ILogger $logger
|
||||
* @param ILogger|null $logger
|
||||
*/
|
||||
public function execute($jobList, ILogger $logger = null) {
|
||||
$jobList->remove($this, $this->argument);
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ abstract class TimedJob extends Job {
|
|||
* run the job if
|
||||
*
|
||||
* @param JobList $jobList
|
||||
* @param ILogger $logger
|
||||
* @param ILogger|null $logger
|
||||
*/
|
||||
public function execute($jobList, ILogger $logger = null) {
|
||||
if ((time() - $this->lastRun) > $this->interval) {
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ class QueryBuilder implements IQueryBuilder {
|
|||
*
|
||||
* @param string|integer $key The parameter position or name.
|
||||
* @param mixed $value The parameter value.
|
||||
* @param string|null $type One of the IQueryBuilder::PARAM_* constants.
|
||||
* @param string|null|int $type One of the IQueryBuilder::PARAM_* constants.
|
||||
*
|
||||
* @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ use OCP\Files\InvalidDirectoryException;
|
|||
use OCP\Files\InvalidPathException;
|
||||
use OCP\Files\ReservedWordException;
|
||||
use OCP\Files\Storage\ILockingStorage;
|
||||
use OCP\Files\Storage\IStorage;
|
||||
use OCP\Lock\ILockingProvider;
|
||||
use OCP\Lock\LockedException;
|
||||
|
||||
|
|
@ -578,13 +579,13 @@ abstract class Common implements Storage, ILockingStorage {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \OCP\Files\Storage $sourceStorage
|
||||
* @param IStorage $sourceStorage
|
||||
* @param string $sourceInternalPath
|
||||
* @param string $targetInternalPath
|
||||
* @param bool $preserveMtime
|
||||
* @return bool
|
||||
*/
|
||||
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
|
||||
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
|
||||
if ($sourceStorage === $this) {
|
||||
return $this->copy($sourceInternalPath, $targetInternalPath);
|
||||
}
|
||||
|
|
@ -625,12 +626,12 @@ abstract class Common implements Storage, ILockingStorage {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \OCP\Files\Storage $sourceStorage
|
||||
* @param IStorage $sourceStorage
|
||||
* @param string $sourceInternalPath
|
||||
* @param string $targetInternalPath
|
||||
* @return bool
|
||||
*/
|
||||
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
if ($sourceStorage === $this) {
|
||||
return $this->rename($sourceInternalPath, $targetInternalPath);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
namespace OC\Files\Storage;
|
||||
|
||||
use OC\Files\Cache\FailedCache;
|
||||
use OCP\Files\Storage\IStorage;
|
||||
use \OCP\Lock\ILockingProvider;
|
||||
use \OCP\Files\StorageNotAvailableException;
|
||||
|
||||
|
|
@ -183,11 +184,11 @@ class FailedStorage extends Common {
|
|||
return true;
|
||||
}
|
||||
|
||||
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
throw new StorageNotAvailableException($this->e->getMessage(), $this->e->getCode(), $this->e);
|
||||
}
|
||||
|
||||
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
throw new StorageNotAvailableException($this->e->getMessage(), $this->e->getCode(), $this->e);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ namespace OC\Files\Storage;
|
|||
|
||||
use OC\Files\Storage\Wrapper\Jail;
|
||||
use OCP\Files\ForbiddenException;
|
||||
use OCP\Files\Storage\IStorage;
|
||||
|
||||
/**
|
||||
* for local filestore, we only have to map the paths
|
||||
|
|
@ -404,12 +405,12 @@ class Local extends \OC\Files\Storage\Common {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \OCP\Files\Storage $sourceStorage
|
||||
* @param IStorage $sourceStorage
|
||||
* @param string $sourceInternalPath
|
||||
* @param string $targetInternalPath
|
||||
* @return bool
|
||||
*/
|
||||
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
|
||||
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
|
||||
if ($sourceStorage->instanceOfStorage('\OC\Files\Storage\Local')) {
|
||||
/**
|
||||
* @var \OC\Files\Storage\Local $sourceStorage
|
||||
|
|
@ -422,12 +423,12 @@ class Local extends \OC\Files\Storage\Common {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \OCP\Files\Storage $sourceStorage
|
||||
* @param IStorage $sourceStorage
|
||||
* @param string $sourceInternalPath
|
||||
* @param string $targetInternalPath
|
||||
* @return bool
|
||||
*/
|
||||
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
if ($sourceStorage->instanceOfStorage(Local::class)) {
|
||||
if ($sourceStorage->instanceOfStorage(Jail::class)) {
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@
|
|||
*/
|
||||
namespace OC\Files\Storage\Wrapper;
|
||||
|
||||
use OCP\Files\Storage\IStorage;
|
||||
|
||||
/**
|
||||
* Availability checker for storages
|
||||
*
|
||||
|
|
@ -432,7 +434,7 @@ class Availability extends Wrapper {
|
|||
}
|
||||
|
||||
/** {@inheritdoc} */
|
||||
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
$this->checkAvailability();
|
||||
try {
|
||||
return parent::copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
|
||||
|
|
@ -443,7 +445,7 @@ class Availability extends Wrapper {
|
|||
}
|
||||
|
||||
/** {@inheritdoc} */
|
||||
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
$this->checkAvailability();
|
||||
try {
|
||||
return parent::moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
namespace OC\Files\Storage\Wrapper;
|
||||
|
||||
use OCP\Files\Storage\IStorage;
|
||||
use OCP\ICache;
|
||||
use OC\Cache\CappedMemoryCache;
|
||||
|
||||
|
|
@ -483,12 +484,12 @@ class Encoding extends Wrapper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \OCP\Files\Storage $sourceStorage
|
||||
* @param IStorage $sourceStorage
|
||||
* @param string $sourceInternalPath
|
||||
* @param string $targetInternalPath
|
||||
* @return bool
|
||||
*/
|
||||
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
if ($sourceStorage === $this) {
|
||||
return $this->copy($sourceInternalPath, $this->findPathToUse($targetInternalPath));
|
||||
}
|
||||
|
|
@ -501,12 +502,12 @@ class Encoding extends Wrapper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \OCP\Files\Storage $sourceStorage
|
||||
* @param IStorage $sourceStorage
|
||||
* @param string $sourceInternalPath
|
||||
* @param string $targetInternalPath
|
||||
* @return bool
|
||||
*/
|
||||
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
if ($sourceStorage === $this) {
|
||||
$result = $this->rename($sourceInternalPath, $this->findPathToUse($targetInternalPath));
|
||||
if ($result) {
|
||||
|
|
|
|||
|
|
@ -590,13 +590,13 @@ class Encryption extends Wrapper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param Storage $sourceStorage
|
||||
* @param Storage\IStorage $sourceStorage
|
||||
* @param string $sourceInternalPath
|
||||
* @param string $targetInternalPath
|
||||
* @param bool $preserveMtime
|
||||
* @return bool
|
||||
*/
|
||||
public function moveFromStorage(Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = true) {
|
||||
public function moveFromStorage(Storage\IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = true) {
|
||||
if ($sourceStorage === $this) {
|
||||
return $this->rename($sourceInternalPath, $targetInternalPath);
|
||||
}
|
||||
|
|
@ -624,14 +624,14 @@ class Encryption extends Wrapper {
|
|||
|
||||
|
||||
/**
|
||||
* @param Storage $sourceStorage
|
||||
* @param Storage\IStorage $sourceStorage
|
||||
* @param string $sourceInternalPath
|
||||
* @param string $targetInternalPath
|
||||
* @param bool $preserveMtime
|
||||
* @param bool $isRename
|
||||
* @return bool
|
||||
*/
|
||||
public function copyFromStorage(Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false, $isRename = false) {
|
||||
public function copyFromStorage(Storage\IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false, $isRename = false) {
|
||||
|
||||
// TODO clean this up once the underlying moveFromStorage in OC\Files\Storage\Wrapper\Common is fixed:
|
||||
// - call $this->storage->copyFromStorage() instead of $this->copyBetweenStorage
|
||||
|
|
@ -645,12 +645,12 @@ class Encryption extends Wrapper {
|
|||
/**
|
||||
* Update the encrypted cache version in the database
|
||||
*
|
||||
* @param Storage $sourceStorage
|
||||
* @param Storage\IStorage $sourceStorage
|
||||
* @param string $sourceInternalPath
|
||||
* @param string $targetInternalPath
|
||||
* @param bool $isRename
|
||||
*/
|
||||
private function updateEncryptedVersion(Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $isRename) {
|
||||
private function updateEncryptedVersion(Storage\IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $isRename) {
|
||||
$isEncrypted = $this->encryptionManager->isEnabled() && $this->shouldEncrypt($targetInternalPath) ? 1 : 0;
|
||||
$cacheInformation = [
|
||||
'encrypted' => (bool)$isEncrypted,
|
||||
|
|
@ -682,7 +682,7 @@ class Encryption extends Wrapper {
|
|||
/**
|
||||
* copy file between two storages
|
||||
*
|
||||
* @param Storage $sourceStorage
|
||||
* @param Storage\IStorage $sourceStorage
|
||||
* @param string $sourceInternalPath
|
||||
* @param string $targetInternalPath
|
||||
* @param bool $preserveMtime
|
||||
|
|
@ -690,7 +690,7 @@ class Encryption extends Wrapper {
|
|||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
private function copyBetweenStorage(Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, $isRename) {
|
||||
private function copyBetweenStorage(Storage\IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, $isRename) {
|
||||
|
||||
// for versions we have nothing to do, because versions should always use the
|
||||
// key from the original file. Just create a 1:1 copy and done
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ namespace OC\Files\Storage\Wrapper;
|
|||
|
||||
use OC\Files\Cache\Wrapper\CacheJail;
|
||||
use OC\Files\Cache\Wrapper\JailPropagator;
|
||||
use OCP\Files\Storage\IStorage;
|
||||
use OCP\Lock\ILockingProvider;
|
||||
|
||||
/**
|
||||
|
|
@ -465,12 +466,12 @@ class Jail extends Wrapper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \OCP\Files\Storage $sourceStorage
|
||||
* @param IStorage $sourceStorage
|
||||
* @param string $sourceInternalPath
|
||||
* @param string $targetInternalPath
|
||||
* @return bool
|
||||
*/
|
||||
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
if ($sourceStorage === $this) {
|
||||
return $this->copy($sourceInternalPath, $targetInternalPath);
|
||||
}
|
||||
|
|
@ -478,12 +479,12 @@ class Jail extends Wrapper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \OCP\Files\Storage $sourceStorage
|
||||
* @param IStorage $sourceStorage
|
||||
* @param string $sourceInternalPath
|
||||
* @param string $targetInternalPath
|
||||
* @return bool
|
||||
*/
|
||||
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
if ($sourceStorage === $this) {
|
||||
return $this->rename($sourceInternalPath, $targetInternalPath);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
namespace OC\Files\Storage\Wrapper;
|
||||
|
||||
use OCP\Files\Cache\ICacheEntry;
|
||||
use OCP\Files\Storage\IStorage;
|
||||
|
||||
class Quota extends Wrapper {
|
||||
|
||||
|
|
@ -170,12 +171,12 @@ class Quota extends Wrapper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \OCP\Files\Storage $sourceStorage
|
||||
* @param IStorage $sourceStorage
|
||||
* @param string $sourceInternalPath
|
||||
* @param string $targetInternalPath
|
||||
* @return bool
|
||||
*/
|
||||
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
$free = $this->free_space('');
|
||||
if ($free < 0 or $this->getSize($sourceInternalPath, $sourceStorage) < $free) {
|
||||
return $this->storage->copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
|
||||
|
|
@ -185,12 +186,12 @@ class Quota extends Wrapper {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \OCP\Files\Storage $sourceStorage
|
||||
* @param IStorage $sourceStorage
|
||||
* @param string $sourceInternalPath
|
||||
* @param string $targetInternalPath
|
||||
* @return bool
|
||||
*/
|
||||
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
$free = $this->free_space('');
|
||||
if ($free < 0 or $this->getSize($sourceInternalPath, $sourceStorage) < $free) {
|
||||
return $this->storage->moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ namespace OC\Files\Storage\Wrapper;
|
|||
|
||||
use OCP\Files\InvalidPathException;
|
||||
use OCP\Files\Storage\ILockingStorage;
|
||||
use OCP\Files\Storage\IStorage;
|
||||
use OCP\Lock\ILockingProvider;
|
||||
|
||||
class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage {
|
||||
|
|
@ -542,12 +543,12 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \OCP\Files\Storage $sourceStorage
|
||||
* @param IStorage $sourceStorage
|
||||
* @param string $sourceInternalPath
|
||||
* @param string $targetInternalPath
|
||||
* @return bool
|
||||
*/
|
||||
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
if ($sourceStorage === $this) {
|
||||
return $this->copy($sourceInternalPath, $targetInternalPath);
|
||||
}
|
||||
|
|
@ -556,12 +557,12 @@ class Wrapper implements \OC\Files\Storage\Storage, ILockingStorage {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \OCP\Files\Storage $sourceStorage
|
||||
* @param IStorage $sourceStorage
|
||||
* @param string $sourceInternalPath
|
||||
* @param string $targetInternalPath
|
||||
* @return bool
|
||||
*/
|
||||
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
if ($sourceStorage === $this) {
|
||||
return $this->rename($sourceInternalPath, $targetInternalPath);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
namespace OC\Group;
|
||||
|
||||
use OCP\IGroup;
|
||||
use OCP\IUser;
|
||||
|
||||
class Group implements IGroup {
|
||||
/** @var null|string */
|
||||
|
|
@ -119,10 +120,10 @@ class Group implements IGroup {
|
|||
/**
|
||||
* check if a user is in the group
|
||||
*
|
||||
* @param \OC\User\User $user
|
||||
* @param IUser $user
|
||||
* @return bool
|
||||
*/
|
||||
public function inGroup($user) {
|
||||
public function inGroup(IUser $user) {
|
||||
if (isset($this->users[$user->getUID()])) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -138,9 +139,9 @@ class Group implements IGroup {
|
|||
/**
|
||||
* add a user to the group
|
||||
*
|
||||
* @param \OC\User\User $user
|
||||
* @param IUser $user
|
||||
*/
|
||||
public function addUser($user) {
|
||||
public function addUser(IUser $user) {
|
||||
if ($this->inGroup($user)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -246,10 +246,10 @@ class Manager extends PublicEmitter implements IGroupManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param \OC\User\User|null $user
|
||||
* @param IUser|null $user
|
||||
* @return \OC\Group\Group[]
|
||||
*/
|
||||
public function getUserGroups($user) {
|
||||
public function getUserGroups(IUser $user= null) {
|
||||
if (!$user instanceof IUser) {
|
||||
return [];
|
||||
}
|
||||
|
|
@ -303,10 +303,10 @@ class Manager extends PublicEmitter implements IGroupManager {
|
|||
|
||||
/**
|
||||
* get a list of group ids for a user
|
||||
* @param \OC\User\User $user
|
||||
* @param IUser $user
|
||||
* @return array with group ids
|
||||
*/
|
||||
public function getUserGroupIds($user) {
|
||||
public function getUserGroupIds(IUser $user) {
|
||||
return array_map(function($value) {
|
||||
return (string) $value;
|
||||
}, array_keys($this->getUserGroups($user)));
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class L10NString implements \JsonSerializable {
|
|||
}
|
||||
|
||||
// Replace %n first (won't interfere with vsprintf)
|
||||
$text = str_replace('%n', $this->count, $text);
|
||||
$text = str_replace('%n', (string)$this->count, $text);
|
||||
return vsprintf($text, $this->parameters);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ namespace OC\Lockdown\Filesystem;
|
|||
use Icewind\Streams\IteratorDirectory;
|
||||
use OC\Files\FileInfo;
|
||||
use OC\Files\Storage\Common;
|
||||
use OCP\Files\Storage\IStorage;
|
||||
|
||||
class NullStorage extends Common {
|
||||
public function __construct($parameters) {
|
||||
|
|
@ -156,11 +157,11 @@ class NullStorage extends Common {
|
|||
return false;
|
||||
}
|
||||
|
||||
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
|
||||
}
|
||||
|
||||
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
|
||||
throw new \OC\ForbiddenException('This request is not allowed to access the filesystem');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ EOF;
|
|||
* Adds a heading to the email
|
||||
*
|
||||
* @param string $title
|
||||
* @param string $plainTitle|bool Title that is used in the plain text email
|
||||
* @param string|bool $plainTitle Title that is used in the plain text email
|
||||
* if empty the $title is used, if false none will be used
|
||||
*/
|
||||
public function addHeading($title, $plainTitle = '') {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class BackgroundRepair extends TimedJob {
|
|||
* run the job, then remove it from the job list
|
||||
*
|
||||
* @param JobList $jobList
|
||||
* @param ILogger $logger
|
||||
* @param ILogger|null $logger
|
||||
*/
|
||||
public function execute($jobList, ILogger $logger = null) {
|
||||
// add an interval of 15 mins
|
||||
|
|
|
|||
|
|
@ -25,7 +25,11 @@ namespace OC\OCS;
|
|||
|
||||
class Exception extends \Exception {
|
||||
|
||||
/** @var Result */
|
||||
private $result;
|
||||
|
||||
public function __construct(Result $result) {
|
||||
parent::__construct();
|
||||
$this->result = $result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ class File extends \OCP\Search\Result {
|
|||
$this->path = $path;
|
||||
$this->size = $data->getSize();
|
||||
$this->modified = $data->getMtime();
|
||||
$this->mime = $data->getMimetype();
|
||||
$this->mime_type = $data->getMimetype();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class CsrfToken {
|
|||
* The unencrypted value of the token. Used for decrypting an already
|
||||
* encrypted token.
|
||||
*
|
||||
* @return int
|
||||
* @return string
|
||||
*/
|
||||
public function getDecryptedValue() {
|
||||
$token = explode(':', $this->value);
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ class CertificateManager implements ICertificateManager {
|
|||
/**
|
||||
* Get the path to the certificate bundle for this user
|
||||
*
|
||||
* @param string $uid (optional) user to get the certificate bundle for, use `null` to get the system bundle
|
||||
* @param string|null $uid (optional) user to get the certificate bundle for, use `null` to get the system bundle
|
||||
* @return string
|
||||
*/
|
||||
public function getCertificateBundle($uid = '') {
|
||||
|
|
@ -241,7 +241,7 @@ class CertificateManager implements ICertificateManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $uid (optional) user to get the certificate path for, use `null` to get the system path
|
||||
* @param string|null $uid (optional) user to get the certificate path for, use `null` to get the system path
|
||||
* @return string
|
||||
*/
|
||||
private function getPathToCertificates($uid = '') {
|
||||
|
|
|
|||
|
|
@ -1249,7 +1249,6 @@ class Server extends ServerContainer implements IServerContainer {
|
|||
}
|
||||
|
||||
/**
|
||||
* @internal For internal use only
|
||||
* @return \OC\SystemConfig
|
||||
*/
|
||||
public function getSystemConfig() {
|
||||
|
|
|
|||
|
|
@ -50,14 +50,16 @@ use OCP\Security\ISecureRandom;
|
|||
class CryptoWrapper {
|
||||
const COOKIE_NAME = 'oc_sessionPassphrase';
|
||||
|
||||
/** @var IConfig */
|
||||
protected $config;
|
||||
/** @var ISession */
|
||||
protected $session;
|
||||
|
||||
/** @var \OCP\Security\ICrypto */
|
||||
/** @var ICrypto */
|
||||
protected $crypto;
|
||||
|
||||
/** @var ISecureRandom */
|
||||
protected $random;
|
||||
/** @var string */
|
||||
protected $passphrase;
|
||||
|
||||
/**
|
||||
* @param IConfig $config
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class RemoveOrphaned extends TimedJob {
|
|||
* run the job, then remove it from the job list
|
||||
*
|
||||
* @param JobList $jobList
|
||||
* @param ILogger $logger
|
||||
* @param ILogger|null $logger
|
||||
*/
|
||||
public function execute($jobList, ILogger $logger = null) {
|
||||
// add an interval of 15 mins
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ class Setup {
|
|||
'error' => $this->l10n->t(
|
||||
'Mac OS X is not supported and %s will not work properly on this platform. ' .
|
||||
'Use it at your own risk! ',
|
||||
$this->defaults->getName()
|
||||
[$this->defaults->getName()]
|
||||
),
|
||||
'hint' => $this->l10n->t('For the best results, please consider using a GNU/Linux server instead.')
|
||||
);
|
||||
|
|
@ -234,7 +234,7 @@ class Setup {
|
|||
'error' => $this->l10n->t(
|
||||
'It seems that this %s instance is running on a 32-bit PHP environment and the open_basedir has been configured in php.ini. ' .
|
||||
'This will lead to problems with files over 4 GB and is highly discouraged.',
|
||||
$this->defaults->getName()
|
||||
[$this->defaults->getName()]
|
||||
),
|
||||
'hint' => $this->l10n->t('Please remove the open_basedir setting within your php.ini or switch to 64-bit PHP.')
|
||||
);
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ class Tags implements \OCP\ITags {
|
|||
if($tagId === false) {
|
||||
$l10n = \OC::$server->getL10N('core');
|
||||
throw new \Exception(
|
||||
$l10n->t('Could not find category "%s"', $tag)
|
||||
$l10n->t('Could not find category "%s"', [$tag])
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ class OC_DB {
|
|||
/**
|
||||
* Prepare a SQL query
|
||||
* @param string $query Query string
|
||||
* @param int $limit
|
||||
* @param int $offset
|
||||
* @param bool $isManipulation
|
||||
* @param int|null $limit
|
||||
* @param int|null $offset
|
||||
* @param bool|null $isManipulation
|
||||
* @throws \OC\DatabaseException
|
||||
* @return OC_DB_StatementWrapper prepared SQL query
|
||||
*
|
||||
|
|
@ -104,7 +104,7 @@ class OC_DB {
|
|||
* @param mixed $stmt OC_DB_StatementWrapper,
|
||||
* an array with 'sql' and optionally 'limit' and 'offset' keys
|
||||
* .. or a simple sql query string
|
||||
* @param array $parameters
|
||||
* @param array|null $parameters
|
||||
* @return OC_DB_StatementWrapper
|
||||
* @throws \OC\DatabaseException
|
||||
*/
|
||||
|
|
@ -151,7 +151,6 @@ class OC_DB {
|
|||
/**
|
||||
* saves database schema to xml file
|
||||
* @param string $file name of file
|
||||
* @param int $mode
|
||||
* @return bool
|
||||
*
|
||||
* TODO: write more documentation
|
||||
|
|
@ -179,6 +178,7 @@ class OC_DB {
|
|||
* @param string $file file to read structure from
|
||||
* @throws Exception
|
||||
* @return string|boolean
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public static function updateDbFromStructure($file) {
|
||||
$schemaManager = self::getMDB2SchemaManager();
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class OC_DB_StatementWrapper {
|
|||
* make execute return the result instead of a bool
|
||||
*
|
||||
* @param array $input
|
||||
* @return \OC_DB_StatementWrapper|int
|
||||
* @return \OC_DB_StatementWrapper|int|bool
|
||||
*/
|
||||
public function execute($input= []) {
|
||||
$this->lastArguments = $input;
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ class OC_EventSource implements \OCP\IEventSource {
|
|||
*
|
||||
* @throws \BadMethodCallException
|
||||
* if only one parameter is given, a typeless message will be send with that parameter as data
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public function send($type, $data = null) {
|
||||
if ($data and !preg_match('/^[A-Za-z0-9_]+$/', $type)) {
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ class OC_Helper {
|
|||
/**
|
||||
* Make a computer file size
|
||||
* @param string $str file size in human readable format
|
||||
* @return float a file size in bytes
|
||||
* @return float|bool a file size in bytes
|
||||
*
|
||||
* Makes 2kB to 2048.
|
||||
*
|
||||
|
|
@ -395,7 +395,7 @@ class OC_Helper {
|
|||
* performs a search in a nested array
|
||||
* @param array $haystack the array to be searched
|
||||
* @param string $needle the search string
|
||||
* @param string $index optional, only search this key name
|
||||
* @param mixed $index optional, only search this key name
|
||||
* @return mixed the key of the matching field, otherwise false
|
||||
*
|
||||
* performs a search in a nested array
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ class OC_JSON{
|
|||
* Check if the app is enabled, send json error msg if not
|
||||
* @param string $app
|
||||
* @deprecated Use the AppFramework instead. It will automatically check if the app is enabled.
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public static function checkAppEnabled($app) {
|
||||
if( !OC_App::isEnabled($app)) {
|
||||
|
|
@ -64,6 +65,7 @@ class OC_JSON{
|
|||
/**
|
||||
* Check if the user is logged in, send json error msg if not
|
||||
* @deprecated Use annotation based ACLs from the AppFramework instead
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public static function checkLoggedIn() {
|
||||
$twoFactorAuthManger = \OC::$server->getTwoFactorAuthManager();
|
||||
|
|
@ -79,6 +81,7 @@ class OC_JSON{
|
|||
/**
|
||||
* Check an ajax get/post call if the request token is valid, send json error msg if not.
|
||||
* @deprecated Use annotation based CSRF checks from the AppFramework instead
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public static function callCheck() {
|
||||
if(!\OC::$server->getRequest()->passesStrictCookieCheck()) {
|
||||
|
|
@ -96,6 +99,7 @@ class OC_JSON{
|
|||
/**
|
||||
* Check if the user is a admin, send json error msg if not.
|
||||
* @deprecated Use annotation based ACLs from the AppFramework instead
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public static function checkAdminUser() {
|
||||
if( !OC_User::isAdminUser(OC_User::getUser())) {
|
||||
|
|
@ -109,6 +113,7 @@ class OC_JSON{
|
|||
* Check is a given user exists - send json error msg if not
|
||||
* @param string $user
|
||||
* @deprecated Use a AppFramework JSONResponse instead
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public static function checkUserExists($user) {
|
||||
if (!OCP\User::userExists($user)) {
|
||||
|
|
@ -122,6 +127,7 @@ class OC_JSON{
|
|||
/**
|
||||
* Check if the user is a subadmin, send json error msg if not
|
||||
* @deprecated Use annotation based ACLs from the AppFramework instead
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public static function checkSubAdminUser() {
|
||||
$userObject = \OC::$server->getUserSession()->getUser();
|
||||
|
|
@ -140,6 +146,7 @@ class OC_JSON{
|
|||
/**
|
||||
* Send json error msg
|
||||
* @deprecated Use a AppFramework JSONResponse instead
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public static function error($data = array()) {
|
||||
$data['status'] = 'error';
|
||||
|
|
@ -149,6 +156,7 @@ class OC_JSON{
|
|||
/**
|
||||
* Send json success msg
|
||||
* @deprecated Use a AppFramework JSONResponse instead
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public static function success($data = array()) {
|
||||
$data['status'] = 'success';
|
||||
|
|
@ -167,6 +175,7 @@ class OC_JSON{
|
|||
/**
|
||||
* Encode and print $data in json format
|
||||
* @deprecated Use a AppFramework JSONResponse instead
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public static function encodedPrint($data, $setContentType=true) {
|
||||
if($setContentType) {
|
||||
|
|
|
|||
|
|
@ -116,11 +116,11 @@ class OC_Response {
|
|||
}
|
||||
|
||||
/**
|
||||
* Set response expire time
|
||||
* @param string|DateTime $expires date-time when the response expires
|
||||
* string for DateInterval from now
|
||||
* DateTime object when to expire response
|
||||
*/
|
||||
* Set response expire time
|
||||
* @param string|DateTime|int $expires date-time when the response expires
|
||||
* string for DateInterval from now
|
||||
* DateTime object when to expire response
|
||||
*/
|
||||
static public function setExpiresHeader($expires) {
|
||||
if (is_string($expires) && $expires[0] == 'P') {
|
||||
$interval = $expires;
|
||||
|
|
|
|||
|
|
@ -291,10 +291,11 @@ class OC_Template extends \OC\Template\Base {
|
|||
}
|
||||
|
||||
/**
|
||||
* Print a fatal error page and terminates the script
|
||||
* @param string $error_msg The error message to show
|
||||
* @param string $hint An optional hint message - needs to be properly escaped
|
||||
*/
|
||||
* Print a fatal error page and terminates the script
|
||||
* @param string $error_msg The error message to show
|
||||
* @param string $hint An optional hint message - needs to be properly escape
|
||||
* @suppress PhanAccessMethodInternal
|
||||
*/
|
||||
public static function printErrorPage( $error_msg, $hint = '' ) {
|
||||
if (\OC_App::isEnabled('theming') && !\OC_App::isAppLoaded('theming')) {
|
||||
\OC_App::loadApp('theming');
|
||||
|
|
@ -325,7 +326,10 @@ class OC_Template extends \OC\Template\Base {
|
|||
|
||||
/**
|
||||
* print error page using Exception details
|
||||
* @param Exception | Throwable $exception
|
||||
* @param Exception|Throwable $exception
|
||||
* @param bool $fetchPage
|
||||
* @return bool|string
|
||||
* @suppress PhanAccessMethodInternal
|
||||
*/
|
||||
public static function printExceptionErrorPage($exception, $fetchPage = false) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ function emit_css_tag($href, $opts = '') {
|
|||
|
||||
/**
|
||||
* Prints all tags for CSS loading
|
||||
* @param hash $obj all the script information from template
|
||||
* @param array $obj all the script information from template
|
||||
*/
|
||||
function emit_css_loading_tags($obj) {
|
||||
foreach($obj['cssfiles'] as $css) {
|
||||
|
|
@ -72,7 +72,6 @@ function emit_css_loading_tags($obj) {
|
|||
* Prints a <script> tag with nonce and defer depending on config
|
||||
* @param string $src the source URL, ignored when empty
|
||||
* @param string $script_content the inline script content, ignored when empty
|
||||
* @param bool $defer_flag deferred loading or not
|
||||
*/
|
||||
function emit_script_tag($src, $script_content='') {
|
||||
$defer_str=' defer';
|
||||
|
|
@ -93,7 +92,7 @@ function emit_script_tag($src, $script_content='') {
|
|||
|
||||
/**
|
||||
* Print all <script> tags for loading JS
|
||||
* @param hash $obj all the script information from template
|
||||
* @param array $obj all the script information from template
|
||||
*/
|
||||
function emit_script_loading_tags($obj) {
|
||||
foreach($obj['jsfiles'] as $jsfile) {
|
||||
|
|
@ -250,7 +249,7 @@ function mimetype_icon( $mimetype ) {
|
|||
* make preview_icon available as a simple function
|
||||
* Returns the path to the preview of the image.
|
||||
* @param string $path path of file
|
||||
* @return link to the preview
|
||||
* @return string link to the preview
|
||||
*/
|
||||
function preview_icon( $path ) {
|
||||
return \OC::$server->getURLGenerator()->linkToRoute('core.Preview.getPreview', ['x' => 32, 'y' => 32, 'file' => $path]);
|
||||
|
|
@ -258,6 +257,8 @@ function preview_icon( $path ) {
|
|||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param string $token
|
||||
* @return string
|
||||
*/
|
||||
function publicPreview_icon ( $path, $token ) {
|
||||
return \OC::$server->getURLGenerator()->linkToRoute('files_sharing.PublicPreview.getPreview', ['x' => 32, 'y' => 32, 'file' => $path, 't' => $token]);
|
||||
|
|
@ -289,8 +290,8 @@ function strip_time($timestamp){
|
|||
* Formats timestamp relatively to the current time using
|
||||
* a human-friendly format like "x minutes ago" or "yesterday"
|
||||
* @param int $timestamp timestamp to format
|
||||
* @param int $fromTime timestamp to compare from, defaults to current time
|
||||
* @param bool $dateOnly whether to strip time information
|
||||
* @param int|null $fromTime timestamp to compare from, defaults to current time
|
||||
* @param bool|null $dateOnly whether to strip time information
|
||||
* @return string timestamp
|
||||
*/
|
||||
function relative_modified_date($timestamp, $fromTime = null, $dateOnly = false) {
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ class OC_User {
|
|||
* @return bool
|
||||
*
|
||||
* Set the User Authentication Module
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public static function useBackend($backend = 'database') {
|
||||
if ($backend instanceof \OCP\UserInterface) {
|
||||
|
|
@ -123,6 +124,7 @@ class OC_User {
|
|||
|
||||
/**
|
||||
* setup the configured backends in config.php
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public static function setupBackends() {
|
||||
OC_App::loadApps(['prelogin']);
|
||||
|
|
@ -347,7 +349,7 @@ class OC_User {
|
|||
* get the display name of the user currently logged in.
|
||||
*
|
||||
* @param string $uid
|
||||
* @return string uid or false
|
||||
* @return string|bool uid or false
|
||||
*/
|
||||
public static function getDisplayName($uid = null) {
|
||||
if ($uid) {
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ class OC_Util {
|
|||
* TODO make home storage aware of this and use the object storage instead of local disk access
|
||||
*
|
||||
* @param array $config containing 'class' and optional 'arguments'
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
private static function initObjectStoreRootFS($config) {
|
||||
// check misconfiguration
|
||||
|
|
@ -124,6 +125,7 @@ class OC_Util {
|
|||
* necessity of a data folder being present.
|
||||
*
|
||||
* @param array $config containing 'class' and optional 'arguments'
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
private static function initObjectStoreMultibucketRootFS($config) {
|
||||
// check misconfiguration
|
||||
|
|
@ -165,6 +167,8 @@ class OC_Util {
|
|||
* @param string $user
|
||||
* @return boolean
|
||||
* @description configure the initial filesystem based on the configuration
|
||||
* @suppress PhanDeprecatedFunction
|
||||
* @suppress PhanAccessMethodInternal
|
||||
*/
|
||||
public static function setupFS($user = '') {
|
||||
//setting up the filesystem twice can only lead to trouble
|
||||
|
|
@ -202,7 +206,7 @@ class OC_Util {
|
|||
return $storage;
|
||||
});
|
||||
|
||||
\OC\Files\Filesystem::addStorageWrapper('enable_sharing', function ($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) {
|
||||
\OC\Files\Filesystem::addStorageWrapper('enable_sharing', function ($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) {
|
||||
if (!$mount->getOption('enable_sharing', true)) {
|
||||
return new \OC\Files\Storage\Wrapper\PermissionsMask([
|
||||
'storage' => $storage,
|
||||
|
|
@ -213,7 +217,7 @@ class OC_Util {
|
|||
});
|
||||
|
||||
// install storage availability wrapper, before most other wrappers
|
||||
\OC\Files\Filesystem::addStorageWrapper('oc_availability', function ($mountPoint, $storage) {
|
||||
\OC\Files\Filesystem::addStorageWrapper('oc_availability', function ($mountPoint, \OCP\Files\Storage\IStorage $storage) {
|
||||
if (!$storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage') && !$storage->isLocal()) {
|
||||
return new \OC\Files\Storage\Wrapper\Availability(['storage' => $storage]);
|
||||
}
|
||||
|
|
@ -289,6 +293,7 @@ class OC_Util {
|
|||
* check if a password is required for each public link
|
||||
*
|
||||
* @return boolean
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public static function isPublicLinkPasswordRequired() {
|
||||
$appConfig = \OC::$server->getAppConfig();
|
||||
|
|
@ -329,6 +334,7 @@ class OC_Util {
|
|||
* check if share API enforces a default expire date
|
||||
*
|
||||
* @return boolean
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public static function isDefaultExpireDateEnforced() {
|
||||
$isDefaultExpireDateEnabled = \OCP\Config::getAppValue('core', 'shareapi_default_expire_date', 'no');
|
||||
|
|
@ -345,7 +351,7 @@ class OC_Util {
|
|||
* Get the quota of a user
|
||||
*
|
||||
* @param string $userId
|
||||
* @return int Quota bytes
|
||||
* @return float Quota bytes
|
||||
*/
|
||||
public static function getUserQuota($userId) {
|
||||
$user = \OC::$server->getUserManager()->get($userId);
|
||||
|
|
@ -365,6 +371,7 @@ class OC_Util {
|
|||
* @param String $userId
|
||||
* @param \OCP\Files\Folder $userDirectory
|
||||
* @throws \RuntimeException
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public static function copySkeleton($userId, \OCP\Files\Folder $userDirectory) {
|
||||
|
||||
|
|
@ -431,6 +438,7 @@ class OC_Util {
|
|||
|
||||
/**
|
||||
* @return void
|
||||
* @suppress PhanUndeclaredMethod
|
||||
*/
|
||||
public static function tearDownFS() {
|
||||
\OC\Files\Filesystem::tearDown();
|
||||
|
|
@ -487,6 +495,7 @@ class OC_Util {
|
|||
|
||||
/**
|
||||
* @description load the version.php into the session as cache
|
||||
* @suppress PhanUndeclaredVariable
|
||||
*/
|
||||
private static function loadVersion() {
|
||||
if (self::$versionCache !== null) {
|
||||
|
|
@ -563,8 +572,8 @@ class OC_Util {
|
|||
* add a translation JS file
|
||||
*
|
||||
* @param string $application application id
|
||||
* @param string $languageCode language code, defaults to the current language
|
||||
* @param bool $prepend prepend the Script to the beginning of the list
|
||||
* @param string|null $languageCode language code, defaults to the current language
|
||||
* @param bool|null $prepend prepend the Script to the beginning of the list
|
||||
*/
|
||||
public static function addTranslations($application, $languageCode = null, $prepend = false) {
|
||||
if (is_null($languageCode)) {
|
||||
|
|
@ -1068,6 +1077,7 @@ class OC_Util {
|
|||
* the apps visible for the current user
|
||||
*
|
||||
* @return string URL
|
||||
* @suppress PhanDeprecatedFunction
|
||||
*/
|
||||
public static function getDefaultPageUrl() {
|
||||
$urlGenerator = \OC::$server->getURLGenerator();
|
||||
|
|
@ -1347,6 +1357,8 @@ class OC_Util {
|
|||
* in case the opcode cache does not re-validate files
|
||||
*
|
||||
* @return void
|
||||
* @suppress PhanDeprecatedFunction
|
||||
* @suppress PhanUndeclaredConstant
|
||||
*/
|
||||
public static function clearOpcodeCache() {
|
||||
// APC
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class ManagerEvent extends Event {
|
|||
protected $event;
|
||||
/** @var string */
|
||||
protected $appID;
|
||||
/** @var \OCP\IGroup[] */
|
||||
/** @var \OCP\IGroup[]|null */
|
||||
protected $groups;
|
||||
|
||||
/**
|
||||
|
|
@ -53,7 +53,7 @@ class ManagerEvent extends Event {
|
|||
*
|
||||
* @param string $event
|
||||
* @param $appID
|
||||
* @param \OCP\IGroup[] $groups
|
||||
* @param \OCP\IGroup[]|null $groups
|
||||
* @since 9.0.0
|
||||
*/
|
||||
public function __construct($event, $appID, array $groups = null) {
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ abstract class ApiController extends Controller {
|
|||
$response = new Response();
|
||||
$response->addHeader('Access-Control-Allow-Origin', $origin);
|
||||
$response->addHeader('Access-Control-Allow-Methods', $this->corsMethods);
|
||||
$response->addHeader('Access-Control-Max-Age', $this->corsMaxAge);
|
||||
$response->addHeader('Access-Control-Max-Age', (string)$this->corsMaxAge);
|
||||
$response->addHeader('Access-Control-Allow-Headers', $this->corsAllowedHeaders);
|
||||
$response->addHeader('Access-Control-Allow-Credentials', 'false');
|
||||
return $response;
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ class App {
|
|||
* @param \OCP\Route\IRouter $router
|
||||
* @param array $routes
|
||||
* @since 6.0.0
|
||||
* @suppress PhanAccessMethodInternal
|
||||
*/
|
||||
public function registerRoutes($router, $routes) {
|
||||
$routeConfig = new RouteConfig($this->container, $router, $routes);
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ class OCSResponse extends Response {
|
|||
* @return string
|
||||
* @since 8.1.0
|
||||
* @deprecated 9.2.0 To implement an OCS endpoint extend the OCSController
|
||||
* @suppress PhanDeprecatedClass
|
||||
*/
|
||||
public function render() {
|
||||
$r = new \OC_OCS_Result($this->data, $this->statuscode, $this->message);
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ class Response {
|
|||
|
||||
/**
|
||||
* By default renders no output
|
||||
* @return null
|
||||
* @return string|null
|
||||
* @since 6.0.0
|
||||
*/
|
||||
public function render() {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ interface IJob {
|
|||
* Run the background job with the registered argument
|
||||
*
|
||||
* @param \OCP\BackgroundJob\IJobList $jobList The job list that manages the state of this job
|
||||
* @param ILogger $logger
|
||||
* @param ILogger|null $logger
|
||||
* @since 7.0.0
|
||||
*/
|
||||
public function execute($jobList, ILogger $logger = null);
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ interface ICommentsManager {
|
|||
* @param int $limit optional, number of maximum comments to be returned. if
|
||||
* not specified, all comments are returned.
|
||||
* @param int $offset optional, starting point
|
||||
* @param \DateTime $notOlderThan optional, timestamp of the oldest comments
|
||||
* @param \DateTime|null $notOlderThan optional, timestamp of the oldest comments
|
||||
* that may be returned
|
||||
* @return IComment[]
|
||||
* @since 9.0.0
|
||||
|
|
@ -120,7 +120,7 @@ interface ICommentsManager {
|
|||
/**
|
||||
* @param $objectType string the object type, e.g. 'files'
|
||||
* @param $objectId string the id of the object
|
||||
* @param \DateTime $notOlderThan optional, timestamp of the oldest comments
|
||||
* @param \DateTime|null $notOlderThan optional, timestamp of the oldest comments
|
||||
* that may be returned
|
||||
* @return Int
|
||||
* @since 9.0.0
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class DB {
|
|||
* @since 4.5.0
|
||||
*/
|
||||
public static function insertid($table=null) {
|
||||
return \OC::$server->getDatabaseConnection()->lastInsertId($table);
|
||||
return (string)\OC::$server->getDatabaseConnection()->lastInsertId($table);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ interface IQueryBuilder {
|
|||
*
|
||||
* @param string|integer $key The parameter position or name.
|
||||
* @param mixed $value The parameter value.
|
||||
* @param string|null $type One of the IQueryBuilder::PARAM_* constants.
|
||||
* @param string|null|int $type One of the IQueryBuilder::PARAM_* constants.
|
||||
*
|
||||
* @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance.
|
||||
* @since 8.2.0
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ interface IQueryLogger extends SQLLogger {
|
|||
* query is finished finalized with stopQuery() method.
|
||||
*
|
||||
* @param string $sql
|
||||
* @param array $params
|
||||
* @param array $types
|
||||
* @param array|null $params
|
||||
* @param array|null $types
|
||||
* @since 8.0.0
|
||||
*/
|
||||
public function startQuery($sql, array $params = null, array $types = null);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue