Remove unneeded semicolon and parentheses

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2018-01-26 23:46:40 +01:00
parent 9be6050cc4
commit a661f043e1
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
79 changed files with 101 additions and 101 deletions

View File

@ -193,7 +193,7 @@ class Backend {
'href' => "principal:${row['principaluri']}",
'commonName' => isset($p['{DAV:}displayname']) ? $p['{DAV:}displayname'] : '',
'status' => 1,
'readOnly' => ((int) $row['access'] === self::ACCESS_READ),
'readOnly' => (int) $row['access'] === self::ACCESS_READ,
'{http://owncloud.org/ns}principal' => $row['principaluri'],
'{http://owncloud.org/ns}group-share' => is_null($p)
];

View File

@ -147,7 +147,7 @@ class SystemTagsObjectMappingCollection implements ICollection {
function childExists($tagId) {
try {
$result = ($this->tagMapper->haveTag([$this->objectId], $this->objectType, $tagId, true));
$result = $this->tagMapper->haveTag([$this->objectId], $this->objectType, $tagId, true);
if ($result) {
$tags = $this->tagManager->getTagsByIds([$tagId]);

View File

@ -211,7 +211,7 @@ class KeyManager {
*/
public function recoveryKeyExists() {
$key = $this->getRecoveryKey();
return (!empty($key));
return !empty($key);
}
/**

View File

@ -57,7 +57,7 @@ class App {
public static function extendJsConfig($settings) {
$appConfig = json_decode($settings['array']['oc_appconfig'], true);
$maxChunkSize = (int)(\OC::$server->getConfig()->getAppValue('files', 'max_chunk_size', (10 * 1024 * 1024)));
$maxChunkSize = (int)\OC::$server->getConfig()->getAppValue('files', 'max_chunk_size', 10 * 1024 * 1024);
$appConfig['files'] = [
'max_chunk_size' => $maxChunkSize
];

View File

@ -322,7 +322,7 @@ class Scan extends Base {
* @return string
*/
protected function formatExecTime() {
list($secs, ) = explode('.', sprintf("%.1f", ($this->execTime)));
list($secs, ) = explode('.', sprintf("%.1f", $this->execTime));
# if you want to have microseconds add this: . '.' . $tens;
return date('H:i:s', $secs);

View File

@ -260,7 +260,7 @@ class ScanAppData extends Base {
* @return string
*/
protected function formatExecTime() {
list($secs, ) = explode('.', sprintf("%.1f", ($this->execTime)));
list($secs, ) = explode('.', sprintf("%.1f", $this->execTime));
# if you want to have microseconds add this: . '.' . $tens;
return date('H:i:s', $secs);

View File

@ -56,7 +56,7 @@ class Admin implements ISettings {
$maxUploadFilesize = Util::humanFileSize(min($upload_max_filesize, $post_max_size));
$parameters = [
'uploadChangable' => (($htaccessWorking and $htaccessWritable) or $userIniWritable ),
'uploadChangable' => ($htaccessWorking and $htaccessWritable) or $userIniWritable,
'uploadMaxFilesize' => $maxUploadFilesize,
// max possible makes only sense on a 32 bit system
'displayMaxPossibleUploadSize' => PHP_INT_SIZE === 4,

View File

@ -39,7 +39,7 @@ class AccessKey extends AuthMechanism {
->setScheme(self::SCHEME_AMAZONS3_ACCESSKEY)
->setText($l->t('Access key'))
->addParameters([
(new DefinitionParameter('key', $l->t('Access key'))),
new DefinitionParameter('key', $l->t('Access key')),
(new DefinitionParameter('secret', $l->t('Secret key')))
->setType(DefinitionParameter::VALUE_PASSWORD),
]);

View File

@ -39,7 +39,7 @@ class OAuth1 extends AuthMechanism {
->addParameters([
(new DefinitionParameter('configured', 'configured'))
->setType(DefinitionParameter::VALUE_HIDDEN),
(new DefinitionParameter('app_key', $l->t('App key'))),
new DefinitionParameter('app_key', $l->t('App key')),
(new DefinitionParameter('app_secret', $l->t('App secret')))
->setType(DefinitionParameter::VALUE_PASSWORD),
(new DefinitionParameter('token', 'token'))

View File

@ -39,7 +39,7 @@ class OAuth2 extends AuthMechanism {
->addParameters([
(new DefinitionParameter('configured', 'configured'))
->setType(DefinitionParameter::VALUE_HIDDEN),
(new DefinitionParameter('client_id', $l->t('Client ID'))),
new DefinitionParameter('client_id', $l->t('Client ID')),
(new DefinitionParameter('client_secret', $l->t('Client secret')))
->setType(DefinitionParameter::VALUE_PASSWORD),
(new DefinitionParameter('token', 'token'))

View File

@ -37,11 +37,11 @@ class OpenStack extends AuthMechanism {
->setScheme(self::SCHEME_OPENSTACK)
->setText($l->t('OpenStack'))
->addParameters([
(new DefinitionParameter('user', $l->t('Username'))),
new DefinitionParameter('user', $l->t('Username')),
(new DefinitionParameter('password', $l->t('Password')))
->setType(DefinitionParameter::VALUE_PASSWORD),
(new DefinitionParameter('tenant', $l->t('Tenant name'))),
(new DefinitionParameter('url', $l->t('Identity endpoint URL'))),
new DefinitionParameter('tenant', $l->t('Tenant name')),
new DefinitionParameter('url', $l->t('Identity endpoint URL')),
])
;
}

View File

@ -37,7 +37,7 @@ class Rackspace extends AuthMechanism {
->setScheme(self::SCHEME_OPENSTACK)
->setText($l->t('Rackspace'))
->addParameters([
(new DefinitionParameter('user', $l->t('Username'))),
new DefinitionParameter('user', $l->t('Username')),
(new DefinitionParameter('key', $l->t('API key')))
->setType(DefinitionParameter::VALUE_PASSWORD),
])

View File

@ -37,7 +37,7 @@ class Password extends AuthMechanism {
->setScheme(self::SCHEME_PASSWORD)
->setText($l->t('Username and password'))
->addParameters([
(new DefinitionParameter('user', $l->t('Username'))),
new DefinitionParameter('user', $l->t('Username')),
(new DefinitionParameter('password', $l->t('Password')))
->setType(DefinitionParameter::VALUE_PASSWORD),
]);

View File

@ -47,8 +47,8 @@ class RSA extends AuthMechanism {
->setScheme(self::SCHEME_PUBLICKEY)
->setText($l->t('RSA public key'))
->addParameters([
(new DefinitionParameter('user', $l->t('Username'))),
(new DefinitionParameter('public_key', $l->t('Public key'))),
new DefinitionParameter('user', $l->t('Username')),
new DefinitionParameter('public_key', $l->t('Public key')),
(new DefinitionParameter('private_key', 'private_key'))
->setType(DefinitionParameter::VALUE_HIDDEN),
])

View File

@ -42,7 +42,7 @@ class AmazonS3 extends Backend {
->setStorageClass('\OCA\Files_External\Lib\Storage\AmazonS3')
->setText($l->t('Amazon S3'))
->addParameters([
(new DefinitionParameter('bucket', $l->t('Bucket'))),
new DefinitionParameter('bucket', $l->t('Bucket')),
(new DefinitionParameter('hostname', $l->t('Hostname')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
(new DefinitionParameter('port', $l->t('Port')))

View File

@ -42,7 +42,7 @@ class DAV extends Backend {
->setStorageClass('\OC\Files\Storage\DAV')
->setText($l->t('WebDAV'))
->addParameters([
(new DefinitionParameter('host', $l->t('URL'))),
new DefinitionParameter('host', $l->t('URL')),
(new DefinitionParameter('root', $l->t('Remote subfolder')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
(new DefinitionParameter('secure', $l->t('Secure https://')))

View File

@ -42,7 +42,7 @@ class FTP extends Backend {
->setStorageClass('\OCA\Files_External\Lib\Storage\FTP')
->setText($l->t('FTP'))
->addParameters([
(new DefinitionParameter('host', $l->t('Host'))),
new DefinitionParameter('host', $l->t('Host')),
(new DefinitionParameter('root', $l->t('Remote subfolder')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
(new DefinitionParameter('secure', $l->t('Secure ftps://')))

View File

@ -38,7 +38,7 @@ class Local extends Backend {
->setStorageClass('\OC\Files\Storage\Local')
->setText($l->t('Local'))
->addParameters([
(new DefinitionParameter('datadir', $l->t('Location'))),
new DefinitionParameter('datadir', $l->t('Location')),
])
->setAllowedVisibility(BackendService::VISIBILITY_ADMIN)
->setPriority(BackendService::PRIORITY_DEFAULT + 50)

View File

@ -40,7 +40,7 @@ class OwnCloud extends Backend {
->setStorageClass('\OCA\Files_External\Lib\Storage\OwnCloud')
->setText($l->t('Nextcloud'))
->addParameters([
(new DefinitionParameter('host', $l->t('URL'))),
new DefinitionParameter('host', $l->t('URL')),
(new DefinitionParameter('root', $l->t('Remote subfolder')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
(new DefinitionParameter('secure', $l->t('Secure https://')))

View File

@ -36,7 +36,7 @@ class SFTP extends Backend {
->setStorageClass('\OCA\Files_External\Lib\Storage\SFTP')
->setText($l->t('SFTP'))
->addParameters([
(new DefinitionParameter('host', $l->t('Host'))),
new DefinitionParameter('host', $l->t('Host')),
(new DefinitionParameter('root', $l->t('Root')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
])

View File

@ -38,7 +38,7 @@ class SFTP_Key extends Backend {
->setStorageClass('\OCA\Files_External\Lib\Storage\SFTP')
->setText($l->t('SFTP with secret key login'))
->addParameters([
(new DefinitionParameter('host', $l->t('Host'))),
new DefinitionParameter('host', $l->t('Host')),
(new DefinitionParameter('root', $l->t('Remote subfolder')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
])

View File

@ -44,8 +44,8 @@ class SMB extends Backend {
->setStorageClass('\OCA\Files_External\Lib\Storage\SMB')
->setText($l->t('SMB / CIFS'))
->addParameters([
(new DefinitionParameter('host', $l->t('Host'))),
(new DefinitionParameter('share', $l->t('Share'))),
new DefinitionParameter('host', $l->t('Host')),
new DefinitionParameter('share', $l->t('Share')),
(new DefinitionParameter('root', $l->t('Remote subfolder')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
(new DefinitionParameter('domain', $l->t('Domain')))

View File

@ -46,7 +46,7 @@ class SMB_OC extends Backend {
->setStorageClass('\OCA\Files_External\Lib\Storage\SMB')
->setText($l->t('SMB / CIFS using OC login'))
->addParameters([
(new DefinitionParameter('host', $l->t('Host'))),
new DefinitionParameter('host', $l->t('Host')),
(new DefinitionParameter('username_as_share', $l->t('Username as share')))
->setType(DefinitionParameter::VALUE_BOOLEAN),
(new DefinitionParameter('share', $l->t('Share')))

View File

@ -46,7 +46,7 @@ class Swift extends Backend {
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
(new DefinitionParameter('region', $l->t('Region')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
(new DefinitionParameter('bucket', $l->t('Bucket'))),
new DefinitionParameter('bucket', $l->t('Bucket')),
(new DefinitionParameter('timeout', $l->t('Request timeout (seconds)')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
])

View File

@ -150,7 +150,7 @@ class FTP extends StreamWrapper{
*/
public static function checkDependencies() {
if (function_exists('ftp_login')) {
return(true);
return true;
} else {
return array('ftp');
}

View File

@ -170,7 +170,7 @@ class Swift extends \OC\Files\Storage\Common {
$bucketUrl = Url::factory($params['bucket']);
if ($bucketUrl->isAbsolute()) {
$this->bucket = end(($bucketUrl->getPathSegments()));
$this->bucket = end($bucketUrl->getPathSegments());
$params['endpoint_url'] = $bucketUrl->addPath('..')->normalizePath();
} else {
$this->bucket = $params['bucket'];

View File

@ -194,7 +194,7 @@ class BackendService {
*/
public function getAvailableBackends() {
return array_filter($this->getBackends(), function($backend) {
return !($backend->checkDependencies());
return !$backend->checkDependencies();
});
}

View File

@ -225,7 +225,7 @@ class Helper {
*/
public static function generateUniqueTarget($path, $excludeList, $view) {
$pathinfo = pathinfo($path);
$ext = (isset($pathinfo['extension'])) ? '.'.$pathinfo['extension'] : '';
$ext = isset($pathinfo['extension']) ? '.'.$pathinfo['extension'] : '';
$name = $pathinfo['filename'];
$dir = $pathinfo['dirname'];
$i = 2;

View File

@ -117,7 +117,7 @@ class File implements \OCP\Share_Backend_File_Dependent {
}
}
$excludeList = (is_array($exclude)) ? $exclude : array();
$excludeList = is_array($exclude) ? $exclude : array();
return \OCA\Files_Sharing\Helper::generateUniqueTarget($target, $excludeList, $view);
}

View File

@ -131,7 +131,7 @@ class SharedMount extends MountPoint implements MoveableMount {
*/
private function generateUniqueTarget($path, $view, array $mountpoints) {
$pathinfo = pathinfo($path);
$ext = (isset($pathinfo['extension'])) ? '.' . $pathinfo['extension'] : '';
$ext = isset($pathinfo['extension']) ? '.' . $pathinfo['extension'] : '';
$name = $pathinfo['filename'];
$dir = $pathinfo['dirname'];

View File

@ -873,10 +873,10 @@ class Trashbin {
foreach ($matches as $ma) {
if ($timestamp) {
$parts = explode('.v', substr($ma['path'], 0, $offset));
$versions[] = (end($parts));
$versions[] = end($parts);
} else {
$parts = explode('.v', $ma);
$versions[] = (end($parts));
$versions[] = end($parts);
}
}
}

View File

@ -746,7 +746,7 @@ class Access extends LDAPUtility implements IUserTools {
*/
private function _createAltInternalOwnCloudNameForGroups($name) {
$usedNames = $this->groupMapper->getNamesBySearch($name, "", '_%');
if(!($usedNames) || count($usedNames) === 0) {
if(!$usedNames || count($usedNames) === 0) {
$lastNo = 1; //will become name_2
} else {
natsort($usedNames);
@ -842,7 +842,7 @@ class Access extends LDAPUtility implements IUserTools {
});
}
$this->batchApplyUserAttributes($recordsToUpdate);
return $this->fetchList($ldapRecords, (count($attr) > 1));
return $this->fetchList($ldapRecords, count($attr) > 1);
}
/**
@ -886,7 +886,7 @@ class Access extends LDAPUtility implements IUserTools {
* @return array
*/
public function fetchListOfGroups($filter, $attr, $limit = null, $offset = null) {
return $this->fetchList($this->searchGroups($filter, $attr, $limit, $offset), (count($attr) > 1));
return $this->fetchList($this->searchGroups($filter, $attr, $limit, $offset), count($attr) > 1);
}
/**

View File

@ -113,7 +113,7 @@ class Connection extends LDAPUtility {
public function __destruct() {
if(!$this->dontDestruct && $this->ldap->isResource($this->ldapConnectionRes)) {
@$this->ldap->unbind($this->ldapConnectionRes);
};
}
}
/**

View File

@ -73,7 +73,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP {
* @return mixed, the result of the method or false
*/
protected function callOnLastSeenOn($gid, $method, $parameters, $passOnWhen) {
$cacheKey = $this->getGroupCacheKey($gid);;
$cacheKey = $this->getGroupCacheKey($gid);
$prefix = $this->getFromCache($cacheKey);
//in case the uid has been found in the past, try this stored connection first
if(!is_null($prefix)) {

View File

@ -549,7 +549,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
| Backend::GET_DISPLAYNAME
| Backend::PROVIDE_AVATAR
| Backend::COUNT_USERS
| (((int)$this->access->connection->turnOnPasswordChange === 1)?(Backend::SET_PASSWORD):0)
| (((int)$this->access->connection->turnOnPasswordChange === 1)? Backend::SET_PASSWORD :0)
| $this->userPluginManager->getImplementedActions())
& $actions);
}

View File

@ -245,7 +245,7 @@ class Wizard extends LDAPUtility {
$this->applyFind('ldap_display_name', $attr);
return $this->result;
}
};
}
throw new \Exception(self::$l->t('Could not detect user display name attribute. Please specify it yourself in advanced LDAP settings.'));
}

View File

@ -23,7 +23,7 @@ style('user_ldap', 'renewPassword');
<?php p($message); ?><br>
</div>
<?php endforeach; ?>
<?php if (isset($_['internalexception']) && ($_['internalexception'])): ?>
<?php if (isset($_['internalexception']) && $_['internalexception']): ?>
<div class="warning">
<?php p($l->t('An internal error occurred.')); ?><br>
<small><?php p($l->t('Please try again or contact your administrator.')); ?></small>

View File

@ -71,10 +71,10 @@ style('user_ldap', 'settings');
print_unescaped('<p class="ldapwarning">'.$l->t('<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it.').'</p>');
}
?>
<?php require_once(__DIR__ . '/part.wizard-server.php'); ?>
<?php require_once(__DIR__ . '/part.wizard-userfilter.php'); ?>
<?php require_once(__DIR__ . '/part.wizard-loginfilter.php'); ?>
<?php require_once(__DIR__ . '/part.wizard-groupfilter.php'); ?>
<?php require_once __DIR__ . '/part.wizard-server.php'; ?>
<?php require_once __DIR__ . '/part.wizard-userfilter.php'; ?>
<?php require_once __DIR__ . '/part.wizard-loginfilter.php'; ?>
<?php require_once __DIR__ . '/part.wizard-groupfilter.php'; ?>
<fieldset id="ldapSettings-1">
<div id="ldapAdvancedAccordion">
<h3><?php p($l->t('Connection Settings'));?></h3>

View File

@ -87,7 +87,7 @@ class ListApps extends Base {
sort($enabledApps);
foreach ($enabledApps as $app) {
$apps['enabled'][$app] = (isset($versions[$app])) ? $versions[$app] : true;
$apps['enabled'][$app] = isset($versions[$app]) ? $versions[$app] : true;
}
sort($disabledApps);

View File

@ -121,7 +121,7 @@ class Base extends Command implements CompletionAwareInterface {
} else if ($value === true) {
return 'true';
} else if ($value === null) {
return ($returnNull) ? null : 'null';
return $returnNull ? null : 'null';
} else {
return $value;
}

View File

@ -118,7 +118,7 @@ class ChangeKeyStorageRoot extends Command {
$output->writeln("Start to move keys:");
if ($this->rootView->is_dir(($oldRoot)) === false) {
if ($this->rootView->is_dir($oldRoot) === false) {
$output->writeln("No old keys found: Nothing needs to be moved");
return false;
}

View File

@ -90,7 +90,7 @@ class Install extends Command {
// ignore the OS X setup warning
if(count($errors) !== 1 ||
(string)($errors[0]['error']) !== 'Mac OS X is not supported and Nextcloud will not work properly on this platform. Use it at your own risk! ') {
(string)$errors[0]['error'] !== 'Mac OS X is not supported and Nextcloud will not work properly on this platform. Use it at your own risk! ') {
return 1;
}
}

View File

@ -76,7 +76,7 @@ class Info extends Base {
$data = [
'user_id' => $user->getUID(),
'display_name' => $user->getDisplayName(),
'email' => ($user->getEMailAddress()) ? $user->getEMailAddress() : '',
'email' => $user->getEMailAddress() ? $user->getEMailAddress() : '',
'cloud_id' => $user->getCloudId(),
'enabled' => $user->isEnabled(),
'groups' => $groups,

View File

@ -17,7 +17,7 @@
<?php print_unescaped($_['headers']); ?>
</head>
<body id="body-public">
<?php include('layout.noscript.warning.php'); ?>
<?php include 'layout.noscript.warning.php'; ?>
<?php print_unescaped($_['content']); ?>
</body>
</html>

View File

@ -19,7 +19,7 @@
<?php print_unescaped($_['headers']); ?>
</head>
<body id="<?php p($_['bodyid']);?>">
<?php include('layout.noscript.warning.php'); ?>
<?php include 'layout.noscript.warning.php'; ?>
<div class="wrapper">
<div class="v-align">
<?php if ($_['bodyid'] === 'body-login' ): ?>

View File

@ -26,7 +26,7 @@
<?php print_unescaped($_['headers']); ?>
</head>
<body id="<?php p($_['bodyid']);?>">
<?php include('layout.noscript.warning.php'); ?>
<?php include 'layout.noscript.warning.php'; ?>
<div id="notification-container">
<div id="notification"></div>
</div>

View File

@ -10,7 +10,7 @@ script('core', 'merged-login');
<?php if (!empty($_['redirect_url'])) {
print_unescaped('<input type="hidden" name="redirect_url" value="' . \OCP\Util::sanitizeHTML($_['redirect_url']) . '">');
} ?>
<?php if (isset($_['apacheauthfailed']) && ($_['apacheauthfailed'])): ?>
<?php if (isset($_['apacheauthfailed']) && $_['apacheauthfailed']): ?>
<div class="warning">
<?php p($l->t('Server side authentication failed!')); ?><br>
<small><?php p($l->t('Please contact your administrator.')); ?></small>
@ -21,7 +21,7 @@ script('core', 'merged-login');
<?php p($message); ?><br>
</div>
<?php endforeach; ?>
<?php if (isset($_['internalexception']) && ($_['internalexception'])): ?>
<?php if (isset($_['internalexception']) && $_['internalexception']): ?>
<div class="warning">
<?php p($l->t('An internal error occurred.')); ?><br>
<small><?php p($l->t('Please try again or contact your administrator.')); ?></small>

View File

@ -352,7 +352,7 @@ class OC {
$currentVersion = implode('.', \OCP\Util::getVersion());
// if not a core upgrade, then it's apps upgrade
$isAppsOnlyUpgrade = (version_compare($currentVersion, $installedVersion, '='));
$isAppsOnlyUpgrade = version_compare($currentVersion, $installedVersion, '=');
$oldTheme = $systemConfig->getValue('theme');
$systemConfig->setValue('theme', '');
@ -603,7 +603,7 @@ class OC {
if(!date_default_timezone_set('UTC')) {
throw new \RuntimeException('Could not set timezone to UTC');
};
}
//try to configure php to enable big file uploads.
//this doesn´t work always depending on the webserver and php configuration.
@ -837,7 +837,7 @@ class OC {
/** @var \OCP\App\ManagerEvent $event */
$jobList = \OC::$server->getJobList();
$job = 'OC\\Settings\\RemoveOrphaned';
if(!($jobList->has($job, null))) {
if(!$jobList->has($job, null)) {
$jobList->add($job);
}
});

View File

@ -55,7 +55,7 @@ class SQLiteSessionInit implements EventSubscriber {
* @return void
*/
public function postConnect(ConnectionEventArgs $args) {
$sensitive = ($this->caseSensitiveLike) ? 'true' : 'false';
$sensitive = $this->caseSensitiveLike ? 'true' : 'false';
$args->getConnection()->executeUpdate('PRAGMA case_sensitive_like = ' . $sensitive);
$args->getConnection()->executeUpdate('PRAGMA journal_mode = ' . $this->journalMode);
/** @var \PDO $pdo */

View File

@ -206,7 +206,7 @@ class Cache implements ICache {
$result = $this->connection->executeQuery($sql, [$fileId]);
$files = $result->fetchAll();
return array_map(function (array $data) {
return self::cacheEntryFromData($data, $this->mimetypeLoader);;
return self::cacheEntryFromData($data, $this->mimetypeLoader);
}, $files);
}
return [];

View File

@ -428,7 +428,7 @@ class Scanner extends BasicEmitter implements IScanner {
$exceptionOccurred = false;
$childQueue = [];
foreach ($newChildren as $file) {
$child = ($path) ? $path . '/' . $file : $file;
$child = $path ? $path . '/' . $file : $file;
try {
$existingData = isset($existingChildren[$file]) ? $existingChildren[$file] : null;
$data = $this->scanFile($child, $reuse, $folderId, $existingData, $lock);
@ -467,7 +467,7 @@ class Scanner extends BasicEmitter implements IScanner {
}
$removedChildren = \array_diff(array_keys($existingChildren), $newChildren);
foreach ($removedChildren as $childName) {
$child = ($path) ? $path . '/' . $childName : $childName;
$child = $path ? $path . '/' . $childName : $childName;
$this->removeFromCache($child);
}
if ($this->useTransactions) {

View File

@ -154,7 +154,7 @@ class Storage {
public function getAvailability() {
if ($row = self::getStorageById($this->storageId)) {
return [
'available' => ((int)$row['available'] === 1),
'available' => (int)$row['available'] === 1,
'last_checked' => $row['last_checked']
];
} else {

View File

@ -55,7 +55,7 @@ trait S3ConnectionTrait {
$this->test = isset($params['test']);
$this->bucket = $params['bucket'];
$this->timeout = (!isset($params['timeout'])) ? 15 : $params['timeout'];
$this->timeout = !isset($params['timeout']) ? 15 : $params['timeout'];
$params['region'] = empty($params['region']) ? 'eu-west-1' : $params['region'];
$params['hostname'] = empty($params['hostname']) ? 's3.' . $params['region'] . '.amazonaws.com' : $params['hostname'];
if (!isset($params['port']) || $params['port'] === '') {

View File

@ -329,7 +329,7 @@ class Encryption extends Wrapper {
$resultFseek = $this->parentStreamSeek($positionInFile);
// only allow writes on seekable streams, or at the end of the encrypted stream
if (!($this->readOnly) && ($resultFseek || $positionInFile === $this->size)) {
if (!$this->readOnly && ($resultFseek || $positionInFile === $this->size)) {
// switch the writeFlag so flush() will write the block
$this->writeFlag = true;

View File

@ -682,7 +682,7 @@ class View {
return false;
}
} else {
$hooks = ($this->file_exists($path)) ? array('update', 'write') : array('create', 'write');
$hooks = $this->file_exists($path) ? array('update', 'write') : array('create', 'write');
return $this->basicOperation('file_put_contents', $path, $hooks, $data);
}
}
@ -1245,7 +1245,7 @@ class View {
private function runHooks($hooks, $path, $post = false) {
$relativePath = $path;
$path = $this->getHookPath($path);
$prefix = ($post) ? 'post_' : '';
$prefix = $post ? 'post_' : '';
$run = true;
if ($this->shouldEmitHooks($relativePath)) {
foreach ($hooks as $hook) {

View File

@ -149,7 +149,7 @@ class Installer {
}
//run appinfo/install.php
if((!isset($data['noinstall']) or $data['noinstall']==false)) {
if(!isset($data['noinstall']) or $data['noinstall']==false) {
self::includeAppScript($basedir . '/appinfo/install.php');
}

View File

@ -101,7 +101,7 @@ class File {
$url = ($request->getRequestUri() !== '') ? $request->getRequestUri() : '--';
$method = is_string($request->getMethod()) ? $request->getMethod() : '--';
if($config->getValue('installed', false)) {
$user = (\OC_User::getUser()) ? \OC_User::getUser() : '--';
$user = \OC_User::getUser() ? \OC_User::getUser() : '--';
} else {
$user = '--';
}

View File

@ -113,7 +113,7 @@ class ArrayCache extends Cache implements IMemcache {
return $oldValue + $step;
} else {
$success = $this->add($key, $step);
return ($success) ? $step : false;
return $success ? $step : false;
}
}

View File

@ -60,7 +60,7 @@ class TXT extends Provider {
$lines = preg_split("/\r\n|\n|\r/", $content);
$fontSize = ($maxX) ? (int) ((5 / 32) * $maxX) : 5; //5px
$fontSize = $maxX ? (int) ((5 / 32) * $maxX) : 5; //5px
$lineSize = ceil($fontSize * 1.25);
$image = imagecreate($maxX, $maxY);

View File

@ -411,7 +411,7 @@ class PreviewManager implements IPreview {
// Video requires avconv or ffmpeg
if (in_array('OC\Preview\Movie', $this->getEnabledDefaultProvider())) {
$avconvBinary = \OC_Helper::findBinaryPath('avconv');
$ffmpegBinary = ($avconvBinary) ? null : \OC_Helper::findBinaryPath('ffmpeg');
$ffmpegBinary = $avconvBinary ? null : \OC_Helper::findBinaryPath('ffmpeg');
if ($avconvBinary || $ffmpegBinary) {
// FIXME // a bit hacky but didn't want to use subclasses

View File

@ -157,7 +157,7 @@ class MySQL extends AbstractDatabase {
} else {
break;
}
};
}
}
} catch (\Exception $ex) {
$this->logger->logException($ex, [

View File

@ -154,7 +154,7 @@ class PostgreSQL extends AbstractDatabase {
while ($this->userExists($connection)) {
$i++;
$this->dbUser = $dbUser . $i;
};
}
// create the user
$query = $connection->prepare("CREATE USER " . addslashes($this->dbUser) . " CREATEDB PASSWORD '" . addslashes($this->dbPassword) . "'");

View File

@ -168,7 +168,7 @@ class Helper extends \OC\Share\Constants {
if ($defaultExpireDate === 'yes') {
$enforceExpireDate = $config->getAppValue('core', 'shareapi_enforce_expire_date', 'no');
$defaultExpireSettings['defaultExpireDateSet'] = true;
$defaultExpireSettings['expireAfterDays'] = (int)($config->getAppValue('core', 'shareapi_expire_after_n_days', '7'));
$defaultExpireSettings['expireAfterDays'] = (int)$config->getAppValue('core', 'shareapi_expire_after_n_days', '7');
$defaultExpireSettings['enforceExpireDate'] = $enforceExpireDate === 'yes';
}

View File

@ -1546,8 +1546,8 @@ class Share extends Constants {
'error' => &$error
);
$preHookData['itemTarget'] = ($isGroupShare) ? $groupItemTarget : $itemTarget;
$preHookData['shareWith'] = ($isGroupShare) ? $shareWith['group'] : $shareWith;
$preHookData['itemTarget'] = $isGroupShare ? $groupItemTarget : $itemTarget;
$preHookData['shareWith'] = $isGroupShare ? $shareWith['group'] : $shareWith;
\OC_Hook::emit('OCP\Share', 'pre_shared', $preHookData);
@ -1559,7 +1559,7 @@ class Share extends Constants {
$sourceId = ($itemType === 'file' || $itemType === 'folder') ? $fileSource : $itemSource;
$sourceExists = self::getItemSharedWithBySource($itemType, $sourceId, self::FORMAT_NONE, null, true, $user);
$userShareType = ($isGroupShare) ? self::$shareTypeGroupUserUnique : $shareType;
$userShareType = $isGroupShare ? self::$shareTypeGroupUserUnique : $shareType;
if ($sourceExists && $sourceExists['item_source'] === $itemSource) {
$fileTarget = $sourceExists['file_target'];
@ -1659,9 +1659,9 @@ class Share extends Constants {
'expirationDate' => $expirationDate,
);
$postHookData['shareWith'] = ($isGroupShare) ? $shareWith['group'] : $shareWith;
$postHookData['itemTarget'] = ($isGroupShare) ? $groupItemTarget : $itemTarget;
$postHookData['fileTarget'] = ($isGroupShare) ? $groupFileTarget : $fileTarget;
$postHookData['shareWith'] = $isGroupShare ? $shareWith['group'] : $shareWith;
$postHookData['itemTarget'] = $isGroupShare ? $groupItemTarget : $itemTarget;
$postHookData['fileTarget'] = $isGroupShare ? $groupFileTarget : $fileTarget;
\OC_Hook::emit('OCP\Share', 'post_shared', $postHookData);

View File

@ -536,7 +536,7 @@ class Manager implements IManager {
/** @var \OCA\Files_Sharing\SharedStorage $storage */
$share->setParent($storage->getShareId());
}
};
}
}
/**

View File

@ -219,7 +219,7 @@ class JSConfigHelper {
'versionstring' => \OC_Util::getVersionString(),
'enable_avatars' => true, // here for legacy reasons - to not crash existing code that relies on this value
'lost_password_link'=> $this->config->getSystemValue('lost_password_link', null),
'modRewriteWorking' => ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true'),
'modRewriteWorking' => $this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true',
'sharing.maxAutocompleteResults' => (int)$this->config->getSystemValue('sharing.maxAutocompleteResults', 0),
'sharing.minSearchStringLength' => (int)$this->config->getSystemValue('sharing.minSearchStringLength', 0),
'blacklist_files_regex' => \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX,

View File

@ -352,7 +352,7 @@ class User implements IUser {
public function setEnabled($enabled) {
$oldStatus = $this->isEnabled();
$this->enabled = $enabled;
$enabled = ($enabled) ? 'true' : 'false';
$enabled = $enabled ? 'true' : 'false';
if ($oldStatus !== $this->enabled) {
$this->triggerChange('enabled', $enabled);
$this->config->setUserValue($this->uid, 'core', 'enabled', $enabled);

View File

@ -81,7 +81,7 @@ class OC_EventSource implements \OCP\IEventSource {
header('Location: '.\OC::$WEBROOT);
exit();
}
if (!(\OC::$server->getRequest()->passesCSRFCheck())) {
if (!\OC::$server->getRequest()->passesCSRFCheck()) {
$this->send('error', 'Possible CSRF attack. Connection will be closed.');
$this->close();
exit();

View File

@ -408,7 +408,7 @@ class OC_Helper {
$it = new RecursiveIteratorIterator($aIt);
while ($it->valid()) {
if (((isset($index) AND ($it->key() == $index)) OR (!isset($index))) AND ($it->current() == $needle)) {
if (((isset($index) AND ($it->key() == $index)) OR !isset($index)) AND ($it->current() == $needle)) {
return $aIt->key();
}

View File

@ -785,12 +785,12 @@ class OC_Image implements \OCP\IImage {
break;
case 8:
$color = @unpack('n', $vide . ($data[$p] ?? ''));
$color[1] = (isset($palette[$color[1] + 1])) ? $palette[$color[1] + 1] : $palette[1];
$color[1] = isset($palette[$color[1] + 1]) ? $palette[$color[1] + 1] : $palette[1];
break;
case 4:
$color = @unpack('n', $vide . ($data[floor($p)] ?? ''));
$color[1] = ($p * 2) % 2 == 0 ? $color[1] >> 4 : $color[1] & 0x0F;
$color[1] = (isset($palette[$color[1] + 1])) ? $palette[$color[1] + 1] : $palette[1];
$color[1] = isset($palette[$color[1] + 1]) ? $palette[$color[1] + 1] : $palette[1];
break;
case 1:
$color = @unpack('n', $vide . ($data[floor($p)] ?? ''));
@ -820,7 +820,7 @@ class OC_Image implements \OCP\IImage {
$color[1] = ($color[1] & 0x1);
break;
}
$color[1] = (isset($palette[$color[1] + 1])) ? $palette[$color[1] + 1] : $palette[1];
$color[1] = isset($palette[$color[1] + 1]) ? $palette[$color[1] + 1] : $palette[1];
break;
default:
fclose($fh);

View File

@ -91,7 +91,7 @@ class OC_JSON{
exit();
}
if( !(\OC::$server->getRequest()->passesCSRFCheck())) {
if( !\OC::$server->getRequest()->passesCSRFCheck()) {
$l = \OC::$server->getL10N('lib');
self::error(array( 'data' => array( 'message' => $l->t('Token expired. Please reload page.'), 'error' => 'token_expired' )));
exit();

View File

@ -894,7 +894,7 @@ class OC_Util {
}
foreach($invalidIniSettings as $setting) {
if(is_bool($setting[1])) {
$setting[1] = ($setting[1]) ? 'on' : 'off';
$setting[1] = $setting[1] ? 'on' : 'off';
}
$errors[] = [
'error' => $l->t('PHP setting "%s" is not set to "%s".', [$setting[0], var_export($setting[1], true)]),

View File

@ -101,7 +101,7 @@ class MailSettingsController extends Controller {
$params = get_defined_vars();
$configs = [];
foreach($params as $key => $value) {
$configs[$key] = (empty($value)) ? null : $value;
$configs[$key] = empty($value) ? null : $value;
}
// Delete passwords from config in case no auth is specified

View File

@ -254,7 +254,7 @@ class UsersController extends Controller {
return [
'name' => $user->getUID(),
'displayname' => $user->getDisplayName(),
'groups' => (empty($userGroups)) ? $this->groupManager->getUserGroupIds($user) : $userGroups,
'groups' => empty($userGroups) ? $this->groupManager->getUserGroupIds($user) : $userGroups,
'subadmin' => $subAdminGroups,
'quota' => $user->getQuota(),
'quota_bytes' => Util::computerFileSize($user->getQuota()),

View File

@ -10,7 +10,7 @@
</thead>
<tbody>
<?php foreach ($_['certs'] as $rootCert): /**@var \OCP\ICertificate $rootCert */ ?>
<tr class="<?php echo ($rootCert->isExpired()) ? 'expired' : 'valid' ?>"
<tr class="<?php echo $rootCert->isExpired() ? 'expired' : 'valid' ?>"
data-name="<?php p($rootCert->getName()) ?>">
<td class="rootCert"
title="<?php p($rootCert->getOrganization()) ?>">

View File

@ -6,4 +6,4 @@
<?php foreach($_['forms'] as $form) {
print_unescaped($form);
};
}

View File

@ -30,4 +30,4 @@
if (isset($form['form'])) {?>
<div id="<?php isset($form['anchor']) ? p($form['anchor']) : p('');?>"><?php print_unescaped($form['form']);?></div>
<?php }
};?>
} ?>

View File

@ -1,3 +1,3 @@
<div class="section">
<p><?php include(__DIR__ . '/../../settings.development.notice.php'); ?></p>
<p><?php include __DIR__ . '/../../settings.development.notice.php'; ?></p>
</div>

View File

@ -132,7 +132,7 @@
<ol>
<?php foreach(json_decode($_['cronErrors']) as $error) { if(isset($error->error)) {?>
<li><?php p($error->error) ?> <?php p($error->hint) ?></li>
<?php }};?>
<?php }} ?>
</ol>
</li>
<?php