summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/composer/composer/ClassLoader.php2
-rw-r--r--lib/composer/composer/InstalledVersions.php25
-rw-r--r--lib/composer/composer/installed.php4
-rw-r--r--lib/private/Accounts/AccountManager.php2
-rw-r--r--lib/private/AppFramework/Http/Dispatcher.php4
-rw-r--r--lib/private/AppFramework/Http/Request.php2
-rw-r--r--lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php2
-rw-r--r--lib/private/BackgroundJob/JobList.php4
-rw-r--r--lib/private/Collaboration/Resources/Manager.php2
-rw-r--r--lib/private/DB/Adapter.php2
-rw-r--r--lib/private/DB/AdapterPgSql.php2
-rw-r--r--lib/private/Files/View.php4
-rw-r--r--lib/private/Installer.php133
-rw-r--r--lib/private/Mail/Mailer.php2
-rw-r--r--lib/private/Memcache/Memcached.php1
-rw-r--r--lib/private/Migration/BackgroundRepair.php2
-rw-r--r--lib/private/Notification/Manager.php4
-rw-r--r--lib/private/Preview/MarkDown.php4
-rw-r--r--lib/private/Preview/TXT.php2
-rw-r--r--lib/private/Security/TrustedDomainHelper.php2
-rw-r--r--lib/private/Setup/MySQL.php2
-rw-r--r--lib/private/Share/Share.php2
-rw-r--r--lib/private/Share20/DefaultShareProvider.php2
-rw-r--r--lib/private/URLGenerator.php2
-rw-r--r--lib/private/legacy/OC_DB.php2
-rw-r--r--lib/private/legacy/OC_DB_StatementWrapper.php2
-rw-r--r--lib/public/IDBConnection.php2
27 files changed, 111 insertions, 108 deletions
diff --git a/lib/composer/composer/ClassLoader.php b/lib/composer/composer/ClassLoader.php
index 0cd6055d1b7..afef3fa2ad8 100644
--- a/lib/composer/composer/ClassLoader.php
+++ b/lib/composer/composer/ClassLoader.php
@@ -149,7 +149,7 @@ class ClassLoader
/**
* @return string[] Array of classname => path
- * @psalm-var array<string, string>
+ * @psalm-return array<string, string>
*/
public function getClassMap()
{
diff --git a/lib/composer/composer/InstalledVersions.php b/lib/composer/composer/InstalledVersions.php
index b3a4e1611e6..d50e0c9fcc4 100644
--- a/lib/composer/composer/InstalledVersions.php
+++ b/lib/composer/composer/InstalledVersions.php
@@ -20,12 +20,25 @@ use Composer\Semver\VersionParser;
*
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
- * To require it's presence, you can require `composer-runtime-api ^2.0`
+ * To require its presence, you can require `composer-runtime-api ^2.0`
*/
class InstalledVersions
{
+ /**
+ * @var mixed[]|null
+ * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
+ */
private static $installed;
+
+ /**
+ * @var bool|null
+ */
private static $canGetVendors;
+
+ /**
+ * @var array[]
+ * @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
+ */
private static $installedByVendor = array();
/**
@@ -228,7 +241,7 @@ class InstalledVersions
/**
* @return array
- * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
+ * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
*/
public static function getRootPackage()
{
@@ -242,7 +255,7 @@ class InstalledVersions
*
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
* @return array[]
- * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
+ * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
*/
public static function getRawData()
{
@@ -265,7 +278,7 @@ class InstalledVersions
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @return array[]
- * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
*/
public static function getAllRawData()
{
@@ -288,7 +301,7 @@ class InstalledVersions
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
- * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
+ * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
*/
public static function reload($data)
{
@@ -298,7 +311,7 @@ class InstalledVersions
/**
* @return array[]
- * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
*/
private static function getInstalled()
{
diff --git a/lib/composer/composer/installed.php b/lib/composer/composer/installed.php
index b811738fbd0..f12a8e00dbe 100644
--- a/lib/composer/composer/installed.php
+++ b/lib/composer/composer/installed.php
@@ -5,7 +5,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../../../',
'aliases' => array(),
- 'reference' => '66144c300395458ff38b86e50cd92174443cd85e',
+ 'reference' => '1225189f74d06606aafc4150d07584b90cea50dd',
'name' => '__root__',
'dev' => false,
),
@@ -16,7 +16,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../../../',
'aliases' => array(),
- 'reference' => '66144c300395458ff38b86e50cd92174443cd85e',
+ 'reference' => '1225189f74d06606aafc4150d07584b90cea50dd',
'dev_requirement' => false,
),
),
diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php
index cdfb123179e..7f855c07d46 100644
--- a/lib/private/Accounts/AccountManager.php
+++ b/lib/private/Accounts/AccountManager.php
@@ -633,7 +633,7 @@ class AccountManager implements IAccountManager {
}
// the value col is limited to 255 bytes. It is used for searches only.
- $value = $property['value'] ? Util::shortenMultibyteString($property['value'], 255) : '';
+ $value = $property['value'] ? Util::shortenMultibyteString($property['value'], 255) : '';
$query->setParameter('name', $property['name'])
->setParameter('value', $value);
diff --git a/lib/private/AppFramework/Http/Dispatcher.php b/lib/private/AppFramework/Http/Dispatcher.php
index 6bbab42cb79..0f12dbda629 100644
--- a/lib/private/AppFramework/Http/Dispatcher.php
+++ b/lib/private/AppFramework/Http/Dispatcher.php
@@ -131,7 +131,7 @@ class Dispatcher {
$numExecuted = $databaseStatsAfter['executed'] - $databaseStatsBefore['executed'];
if ($numBuilt > 50) {
- $this->logger->debug('Controller {class}::{method} created {count} QueryBuilder objects, please check if they are created inside a loop by accident.' , [
+ $this->logger->debug('Controller {class}::{method} created {count} QueryBuilder objects, please check if they are created inside a loop by accident.', [
'class' => get_class($controller),
'method' => $methodName,
'count' => $numBuilt,
@@ -139,7 +139,7 @@ class Dispatcher {
}
if ($numExecuted > 100) {
- $this->logger->warning('Controller {class}::{method} executed {count} queries.' , [
+ $this->logger->warning('Controller {class}::{method} executed {count} queries.', [
'class' => get_class($controller),
'method' => $methodName,
'count' => $numExecuted,
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php
index c67500bcaa4..21af2bc46f4 100644
--- a/lib/private/AppFramework/Http/Request.php
+++ b/lib/private/AppFramework/Http/Request.php
@@ -303,7 +303,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
* @return string
*/
public function getHeader(string $name): string {
- $name = strtoupper(str_replace('-', '_',$name));
+ $name = strtoupper(str_replace('-', '_', $name));
if (isset($this->server['HTTP_' . $name])) {
return $this->server['HTTP_' . $name];
}
diff --git a/lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php b/lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php
index 8bdbacda20b..5f683fa38ac 100644
--- a/lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php
+++ b/lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php
@@ -109,7 +109,7 @@ class RateLimitingMiddleware extends Middleware {
*/
public function afterException($controller, $methodName, \Exception $exception) {
if ($exception instanceof RateLimitExceededException) {
- if (stripos($this->request->getHeader('Accept'),'html') === false) {
+ if (stripos($this->request->getHeader('Accept'), 'html') === false) {
$response = new DataResponse([], $exception->getCode());
} else {
$response = new TemplateResponse(
diff --git a/lib/private/BackgroundJob/JobList.php b/lib/private/BackgroundJob/JobList.php
index 9442bd9eca9..3dbcf518f1e 100644
--- a/lib/private/BackgroundJob/JobList.php
+++ b/lib/private/BackgroundJob/JobList.php
@@ -356,8 +356,8 @@ class JobList implements IJobList {
public function resetBackgroundJob(IJob $job): void {
$query = $this->connection->getQueryBuilder();
$query->update('jobs')
- ->set('last_run', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT))
- ->set('reserved_at', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT))
+ ->set('last_run', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT))
+ ->set('reserved_at', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT))
->where($query->expr()->eq('id', $query->createNamedParameter($job->getId()), IQueryBuilder::PARAM_INT));
$query->executeStatement();
}
diff --git a/lib/private/Collaboration/Resources/Manager.php b/lib/private/Collaboration/Resources/Manager.php
index a0fba16998f..8fc3d0dd5ea 100644
--- a/lib/private/Collaboration/Resources/Manager.php
+++ b/lib/private/Collaboration/Resources/Manager.php
@@ -131,7 +131,7 @@ class Manager implements IManager {
*/
public function searchCollections(IUser $user, string $filter, int $limit = 50, int $start = 0): array {
$query = $this->connection->getQueryBuilder();
- $userId = $user instanceof IUser ? $user->getUID() : '';
+ $userId = $user->getUID();
$query->select('c.*', 'a.access')
->from(self::TABLE_COLLECTIONS, 'c')
diff --git a/lib/private/DB/Adapter.php b/lib/private/DB/Adapter.php
index 4d9b43d0787..334006d1706 100644
--- a/lib/private/DB/Adapter.php
+++ b/lib/private/DB/Adapter.php
@@ -136,7 +136,7 @@ class Adapter {
/**
* @throws \OCP\DB\Exception
*/
- public function insertIgnoreConflict(string $table,array $values) : int {
+ public function insertIgnoreConflict(string $table, array $values) : int {
try {
$builder = $this->conn->getQueryBuilder();
$builder->insert($table);
diff --git a/lib/private/DB/AdapterPgSql.php b/lib/private/DB/AdapterPgSql.php
index 1262fd4f1ab..9045aa7f879 100644
--- a/lib/private/DB/AdapterPgSql.php
+++ b/lib/private/DB/AdapterPgSql.php
@@ -43,7 +43,7 @@ class AdapterPgSql extends Adapter {
return $statement;
}
- public function insertIgnoreConflict(string $table,array $values) : int {
+ public function insertIgnoreConflict(string $table, array $values) : int {
if ($this->isPre9_5CompatMode() === true) {
return parent::insertIgnoreConflict($table, $values);
}
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index f2d91065b9a..271b7a27321 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -1182,7 +1182,7 @@ class View {
if ($result && in_array('delete', $hooks) and $result) {
$this->removeUpdate($storage, $internalPath);
}
- if ($result && in_array('write', $hooks, true) && $operation !== 'fopen' && $operation !== 'touch') {
+ if ($result && in_array('write', $hooks, true) && $operation !== 'fopen' && $operation !== 'touch') {
$this->writeUpdate($storage, $internalPath);
}
if ($result && in_array('touch', $hooks)) {
@@ -1407,7 +1407,7 @@ class View {
}
$info = new FileInfo($path, $storage, $internalPath, $data, $mount, $owner);
- if ($data and isset($data['fileid'])) {
+ if (isset($data['fileid'])) {
if ($includeMountPoints and $data['mimetype'] === 'httpd/unix-directory') {
//add the sizes of other mount points to the folder
$extOnly = ($includeMountPoints === 'ext');
diff --git a/lib/private/Installer.php b/lib/private/Installer.php
index b63619b821c..95143656295 100644
--- a/lib/private/Installer.php
+++ b/lib/private/Installer.php
@@ -308,91 +308,80 @@ class Installer {
$extractDir = $this->tempManager->getTemporaryFolder();
$archive = new TAR($tempFile);
- if ($archive) {
- if (!$archive->extract($extractDir)) {
- $errorMessage = 'Could not extract app ' . $appId;
+ if (!$archive->extract($extractDir)) {
+ $errorMessage = 'Could not extract app ' . $appId;
- $archiveError = $archive->getError();
- if ($archiveError instanceof \PEAR_Error) {
- $errorMessage .= ': ' . $archiveError->getMessage();
- }
-
- throw new \Exception($errorMessage);
- }
- $allFiles = scandir($extractDir);
- $folders = array_diff($allFiles, ['.', '..']);
- $folders = array_values($folders);
-
- if (count($folders) > 1) {
- throw new \Exception(
- sprintf(
- 'Extracted app %s has more than 1 folder',
- $appId
- )
- );
+ $archiveError = $archive->getError();
+ if ($archiveError instanceof \PEAR_Error) {
+ $errorMessage .= ': ' . $archiveError->getMessage();
}
- // Check if appinfo/info.xml has the same app ID as well
- if ((PHP_VERSION_ID < 80000)) {
- $loadEntities = libxml_disable_entity_loader(false);
- $xml = simplexml_load_file($extractDir . '/' . $folders[0] . '/appinfo/info.xml');
- libxml_disable_entity_loader($loadEntities);
- } else {
- $xml = simplexml_load_file($extractDir . '/' . $folders[0] . '/appinfo/info.xml');
- }
- if ((string)$xml->id !== $appId) {
- throw new \Exception(
- sprintf(
- 'App for id %s has a wrong app ID in info.xml: %s',
- $appId,
- (string)$xml->id
- )
- );
- }
+ throw new \Exception($errorMessage);
+ }
+ $allFiles = scandir($extractDir);
+ $folders = array_diff($allFiles, ['.', '..']);
+ $folders = array_values($folders);
- // Check if the version is lower than before
- $currentVersion = OC_App::getAppVersion($appId);
- $newVersion = (string)$xml->version;
- if (version_compare($currentVersion, $newVersion) === 1) {
- throw new \Exception(
- sprintf(
- 'App for id %s has version %s and tried to update to lower version %s',
- $appId,
- $currentVersion,
- $newVersion
- )
- );
- }
+ if (count($folders) > 1) {
+ throw new \Exception(
+ sprintf(
+ 'Extracted app %s has more than 1 folder',
+ $appId
+ )
+ );
+ }
- $baseDir = OC_App::getInstallPath() . '/' . $appId;
- // Remove old app with the ID if existent
- OC_Helper::rmdirr($baseDir);
- // Move to app folder
- if (@mkdir($baseDir)) {
- $extractDir .= '/' . $folders[0];
- OC_Helper::copyr($extractDir, $baseDir);
- }
- OC_Helper::copyr($extractDir, $baseDir);
- OC_Helper::rmdirr($extractDir);
- return;
+ // Check if appinfo/info.xml has the same app ID as well
+ if ((PHP_VERSION_ID < 80000)) {
+ $loadEntities = libxml_disable_entity_loader(false);
+ $xml = simplexml_load_file($extractDir . '/' . $folders[0] . '/appinfo/info.xml');
+ libxml_disable_entity_loader($loadEntities);
} else {
+ $xml = simplexml_load_file($extractDir . '/' . $folders[0] . '/appinfo/info.xml');
+ }
+ if ((string)$xml->id !== $appId) {
throw new \Exception(
sprintf(
- 'Could not extract app with ID %s to %s',
+ 'App for id %s has a wrong app ID in info.xml: %s',
$appId,
- $extractDir
+ (string)$xml->id
)
);
}
- } else {
- // Signature does not match
- throw new \Exception(
- sprintf(
- 'App with id %s has invalid signature',
- $appId
- )
- );
+
+ // Check if the version is lower than before
+ $currentVersion = OC_App::getAppVersion($appId);
+ $newVersion = (string)$xml->version;
+ if (version_compare($currentVersion, $newVersion) === 1) {
+ throw new \Exception(
+ sprintf(
+ 'App for id %s has version %s and tried to update to lower version %s',
+ $appId,
+ $currentVersion,
+ $newVersion
+ )
+ );
+ }
+
+ $baseDir = OC_App::getInstallPath() . '/' . $appId;
+ // Remove old app with the ID if existent
+ OC_Helper::rmdirr($baseDir);
+ // Move to app folder
+ if (@mkdir($baseDir)) {
+ $extractDir .= '/' . $folders[0];
+ OC_Helper::copyr($extractDir, $baseDir);
+ }
+ OC_Helper::copyr($extractDir, $baseDir);
+ OC_Helper::rmdirr($extractDir);
+ return;
}
+ // Signature does not match
+ throw new \Exception(
+ sprintf(
+ 'App with id %s has invalid signature',
+ $appId
+ )
+ );
}
}
diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php
index 1189907eac9..61f506d2676 100644
--- a/lib/private/Mail/Mailer.php
+++ b/lib/private/Mail/Mailer.php
@@ -244,7 +244,7 @@ class Mailer implements IMailer {
}
[$name, $domain] = explode('@', $email, 2);
- $domain = idn_to_ascii($domain, 0,INTL_IDNA_VARIANT_UTS46);
+ $domain = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);
return $name.'@'.$domain;
}
diff --git a/lib/private/Memcache/Memcached.php b/lib/private/Memcache/Memcached.php
index b3414a7d290..50f3fa66ab3 100644
--- a/lib/private/Memcache/Memcached.php
+++ b/lib/private/Memcache/Memcached.php
@@ -66,6 +66,7 @@ class Memcached extends Cache implements IMemcache {
//\Memcached::OPT_BINARY_PROTOCOL => true,
];
// by default enable igbinary serializer if available
+ /** @psalm-suppress RedundantCondition */
if (\Memcached::HAVE_IGBINARY) {
$defaultOptions[\Memcached::OPT_SERIALIZER] =
\Memcached::SERIALIZER_IGBINARY;
diff --git a/lib/private/Migration/BackgroundRepair.php b/lib/private/Migration/BackgroundRepair.php
index 25026575d38..03a3d3f4a7c 100644
--- a/lib/private/Migration/BackgroundRepair.php
+++ b/lib/private/Migration/BackgroundRepair.php
@@ -97,7 +97,7 @@ class BackgroundRepair extends TimedJob {
try {
$repair->addStep($step);
} catch (\Exception $ex) {
- $this->logger->logException($ex,[
+ $this->logger->logException($ex, [
'app' => 'migration'
]);
diff --git a/lib/private/Notification/Manager.php b/lib/private/Notification/Manager.php
index d8bbc02e105..c707884355b 100644
--- a/lib/private/Notification/Manager.php
+++ b/lib/private/Notification/Manager.php
@@ -381,12 +381,12 @@ class Manager implements IManager {
throw new \InvalidArgumentException('The given notification has been processed');
}
- if (!($notification instanceof INotification) || !$notification->isValidParsed()) {
+ if (!$notification->isValidParsed()) {
throw new \InvalidArgumentException('The given notification has not been handled');
}
}
- if (!($notification instanceof INotification) || !$notification->isValidParsed()) {
+ if (!$notification->isValidParsed()) {
throw new \InvalidArgumentException('The given notification has not been handled');
}
diff --git a/lib/private/Preview/MarkDown.php b/lib/private/Preview/MarkDown.php
index e24bdb5959b..929f319f57d 100644
--- a/lib/private/Preview/MarkDown.php
+++ b/lib/private/Preview/MarkDown.php
@@ -43,7 +43,7 @@ class MarkDown extends TXT {
return null;
}
- $content = stream_get_contents($content,3000);
+ $content = stream_get_contents($content, 3000);
//don't create previews of empty text files
if (trim($content) === '') {
@@ -119,7 +119,7 @@ class MarkDown extends TXT {
// Get rid of markdown symbols that we still needed for the font size
$line = preg_replace('/^#*\s/', '', $line);
- $wrappedText = wordwrap($line, $wordWrap,"\n");
+ $wrappedText = wordwrap($line, $wordWrap, "\n");
$linesWrapped = count(explode("\n", $wrappedText));
imagettftext($image, $actualFontSize, 0, $x, $y, $textColor, $actualFontSize === $fontSize ? $fontFile : $fontFileBold, $wrappedText);
$nextLineStart = (int)($linesWrapped * ceil($actualFontSize * 2));
diff --git a/lib/private/Preview/TXT.php b/lib/private/Preview/TXT.php
index d55d32386a7..bb3af6b90de 100644
--- a/lib/private/Preview/TXT.php
+++ b/lib/private/Preview/TXT.php
@@ -62,7 +62,7 @@ class TXT extends ProviderV2 {
return null;
}
- $content = stream_get_contents($content,3000);
+ $content = stream_get_contents($content, 3000);
//don't create previews of empty text files
if (trim($content) === '') {
diff --git a/lib/private/Security/TrustedDomainHelper.php b/lib/private/Security/TrustedDomainHelper.php
index 175e4cbd356..0688ebba5b3 100644
--- a/lib/private/Security/TrustedDomainHelper.php
+++ b/lib/private/Security/TrustedDomainHelper.php
@@ -98,7 +98,7 @@ class TrustedDomainHelper implements ITrustedDomainHelper {
return true;
}
// Reject misformed domains in any case
- if (strpos($domain,'-') === 0 || strpos($domain,'..') !== false) {
+ if (strpos($domain, '-') === 0 || strpos($domain, '..') !== false) {
return false;
}
// Match, allowing for * wildcards
diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php
index 8a12465fd8d..920baf3e4ee 100644
--- a/lib/private/Setup/MySQL.php
+++ b/lib/private/Setup/MySQL.php
@@ -125,7 +125,7 @@ class MySQL extends AbstractDatabase {
$connection->executeUpdate($query);
}
} catch (\Exception $ex) {
- $this->logger->error('Database user creation failed.',[
+ $this->logger->error('Database user creation failed.', [
'exception' => $ex,
'app' => 'mysql.setup',
]);
diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php
index 548c8a2c451..47b09982f3a 100644
--- a/lib/private/Share/Share.php
+++ b/lib/private/Share/Share.php
@@ -847,7 +847,7 @@ class Share extends Constants {
* @param array $parameters additional format parameters
* @return array format result
*/
- private static function formatResult($items, $column, $backend, $format = self::FORMAT_NONE , $parameters = null) {
+ private static function formatResult($items, $column, $backend, $format = self::FORMAT_NONE, $parameters = null) {
if ($format === self::FORMAT_NONE) {
return $items;
} elseif ($format === self::FORMAT_STATUSES) {
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php
index ec0f25cbae5..6e8d9105a76 100644
--- a/lib/private/Share20/DefaultShareProvider.php
+++ b/lib/private/Share20/DefaultShareProvider.php
@@ -670,7 +670,7 @@ class DefaultShareProvider implements IShareProvider {
);
}
- $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
+ $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
$qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())));
$qb->orderBy('id');
diff --git a/lib/private/URLGenerator.php b/lib/private/URLGenerator.php
index 382179b23e0..753a4a217d1 100644
--- a/lib/private/URLGenerator.php
+++ b/lib/private/URLGenerator.php
@@ -187,7 +187,7 @@ class URLGenerator implements IURLGenerator {
$theme = \OC_Util::getTheme();
//if a theme has a png but not an svg always use the png
- $basename = substr(basename($file),0,-4);
+ $basename = substr(basename($file), 0, -4);
$appPath = \OC_App::getAppPath($appName);
diff --git a/lib/private/legacy/OC_DB.php b/lib/private/legacy/OC_DB.php
index 1fbc233f535..39faf8e80aa 100644
--- a/lib/private/legacy/OC_DB.php
+++ b/lib/private/legacy/OC_DB.php
@@ -42,7 +42,7 @@ class OC_DB {
*
* SQL query via Doctrine prepare(), needs to be execute()'d!
*/
- public static function prepare($query , $limit = null, $offset = null, $isManipulation = null) {
+ public static function prepare($query, $limit = null, $offset = null, $isManipulation = null) {
$connection = \OC::$server->getDatabaseConnection();
if ($isManipulation === null) {
diff --git a/lib/private/legacy/OC_DB_StatementWrapper.php b/lib/private/legacy/OC_DB_StatementWrapper.php
index d8e8f0ae37f..d6214a49a33 100644
--- a/lib/private/legacy/OC_DB_StatementWrapper.php
+++ b/lib/private/legacy/OC_DB_StatementWrapper.php
@@ -59,7 +59,7 @@ class OC_DB_StatementWrapper {
/**
* pass all other function directly to the \Doctrine\DBAL\Driver\Statement
*/
- public function __call($name,$arguments) {
+ public function __call($name, $arguments) {
return call_user_func_array([$this->statement,$name], $arguments);
}
diff --git a/lib/public/IDBConnection.php b/lib/public/IDBConnection.php
index 2fa7fa1ad36..d12baa400c0 100644
--- a/lib/public/IDBConnection.php
+++ b/lib/public/IDBConnection.php
@@ -188,7 +188,7 @@ interface IDBConnection {
* @return int number of inserted rows
* @since 16.0.0
*/
- public function insertIgnoreConflict(string $table,array $values) : int;
+ public function insertIgnoreConflict(string $table, array $values) : int;
/**
* Insert or update a row value