* this class checks all methods for the presence of the @since tag
*/
class SinceTagCheckVisitor extends \PhpParser\NodeVisitorAbstract {
-
/** @var string */
protected $namespace = '';
/** @var string */
require __DIR__ . '/../../vendor/autoload.php';
trait Avatar {
-
/** @var string **/
private $lastAvatar;
protected $remoteBaseUrl;
public function __construct($baseUrl, $admin, $regular_user_password) {
-
// Initialize your context here
$this->baseUrl = $baseUrl;
$this->adminUser = $admin;
use PHPUnit\Framework\Assert;
trait ContactsMenu {
-
// BasicStructure trait is expected to be used in the class that uses this
// trait.
require __DIR__ . '/../../vendor/autoload.php';
trait Download {
-
/** @var string **/
private $downloadedFile;
*
*/
trait Mail {
-
// CommandLine trait is expected to be used in the class that uses this
// trait.
use PHPUnit\Framework\Assert;
trait Search {
-
// BasicStructure trait is expected to be used in the class that uses this
// trait.
use Behat\Behat\Context\Context;
class TalkContext implements Context {
-
/**
* @BeforeFeature @Talk
* @BeforeScenario @Talk
* Trashbin functions
*/
trait Trashbin {
-
// WebDav trait is expected to be used in the class that uses this trait.
/**
$output->writeln('Disabled:');
parent::writeArrayInOutputFormat($input, $output, $items['disabled']);
- break;
+ break;
default:
parent::writeArrayInOutputFormat($input, $output, $items);
- break;
+ break;
}
}
$configs = [
'system' => $this->getSystemConfigs($noSensitiveValues),
];
- break;
+ break;
case 'all':
$apps = $this->appConfig->getApps();
foreach ($apps as $appName) {
$configs['apps'][$appName] = $this->getAppConfigs($appName, $noSensitiveValues);
}
- break;
+ break;
default:
$configs = [
}
protected function execute(InputInterface $input, OutputInterface $output): int {
-
// validate the environment
$server = \OC::$server;
$setupHelper = new Setup(
$self = $this;
$updater = new Updater(
- $this->config,
- \OC::$server->getIntegrityCodeChecker(),
- $this->logger,
- $this->installer
+ $this->config,
+ \OC::$server->getIntegrityCodeChecker(),
+ $this->logger,
+ $this->installer
);
/** @var IEventDispatcher $dispatcher */
return new JSONResponse(['data' => [
'message' => $this->l->t("No temporary profile picture available, try again")
]],
- Http::STATUS_NOT_FOUND);
+ Http::STATUS_NOT_FOUND);
}
$image = new \OCP\Image();
$image->loadFromData($tmpAvatar);
$resp = new DataDisplayResponse(
- $image->data() ?? '',
- Http::STATUS_OK,
- ['Content-Type' => $image->mimeType()]);
+ $image->data() ?? '',
+ Http::STATUS_OK,
+ ['Content-Type' => $image->mimeType()]);
$resp->setETag((string)crc32($image->data() ?? ''));
$resp->cacheFor(0);
public function postCroppedAvatar(?array $crop = null): JSONResponse {
if (is_null($crop)) {
return new JSONResponse(['data' => ['message' => $this->l->t("No crop data provided")]],
- Http::STATUS_BAD_REQUEST);
+ Http::STATUS_BAD_REQUEST);
}
if (!isset($crop['x'], $crop['y'], $crop['w'], $crop['h'])) {
return new JSONResponse(['data' => ['message' => $this->l->t("No valid crop data provided")]],
- Http::STATUS_BAD_REQUEST);
+ Http::STATUS_BAD_REQUEST);
}
$tmpAvatar = $this->cache->get('tmpAvatar');
return new JSONResponse(['data' => [
'message' => $this->l->t("No temporary profile picture available, try again")
]],
- Http::STATUS_BAD_REQUEST);
+ Http::STATUS_BAD_REQUEST);
}
$image = new \OCP\Image();
return new JSONResponse(['status' => 'success']);
} catch (\OC\NotSquareException $e) {
return new JSONResponse(['data' => ['message' => $this->l->t('Crop is not square')]],
- Http::STATUS_BAD_REQUEST);
+ Http::STATUS_BAD_REQUEST);
} catch (\Exception $e) {
$this->logger->error($e->getMessage(), ['exception' => $e, 'app' => 'core']);
return new JSONResponse(['data' => ['message' => $this->l->t('An error occurred. Please contact your admin.')]], Http::STATUS_BAD_REQUEST);
use OCP\AppFramework\Http\Response;
class WalledGardenController extends Controller {
-
/**
* @PublicPage
* @NoCSRFRequired
use OCP\IRequest;
class WellKnownController extends Controller {
-
/** @var RequestManager */
private $requestManager;
use OCP\L10N\IFactory;
class WhatsNewController extends OCSController {
-
/** @var IConfig */
protected $config;
/** @var IUserSession */
use OCP\IRequest;
class WipeController extends Controller {
-
/** @var RemoteWipe */
private $remoteWipe;
namespace OC\Core\Data;
class LoginFlowV2Tokens {
-
/** @var string */
private $loginToken;
/** @var string */
* @method void setConfig(string $config)
*/
class ProfileConfig extends Entity implements JsonSerializable {
-
/**
* Visible to users, guests, and public access
*
use OCP\IUser;
class TwoFactorMiddleware extends Middleware {
-
/** @var Manager */
private $twoFactorManager;
use OCP\Migration\SimpleMigrationStep;
class Version13000Date20170718121200 extends SimpleMigrationStep {
-
/** @var IDBConnection */
private $connection;
use OCP\Migration\SimpleMigrationStep;
class Version13000Date20170814074715 extends SimpleMigrationStep {
-
/**
* @param IOutput $output
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* Auto-generated migration step: Please modify to your needs!
*/
class Version13000Date20170919121250 extends SimpleMigrationStep {
-
/**
* @param IOutput $output
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* Auto-generated migration step: Please modify to your needs!
*/
class Version13000Date20170926101637 extends BigIntMigration {
-
/**
* @return array Returns an array with the following structure
* ['table1' => ['column1', 'column2'], ...]
* Auto-generated migration step: Please modify to your needs!
*/
class Version14000Date20180404140050 extends SimpleMigrationStep {
-
/** @var IDBConnection */
private $connection;
use OCP\Migration\SimpleMigrationStep;
class Version14000Date20180516101403 extends SimpleMigrationStep {
-
/**
* @param IOutput $output
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
*/
class Version14000Date20180712153140 extends SimpleMigrationStep {
public function changeSchema(\OCP\Migration\IOutput $output, \Closure $schemaClosure, array $options) {
-
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
use OCP\Migration\SimpleMigrationStep;
class Version15000Date20180926101451 extends SimpleMigrationStep {
-
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
use OCP\Migration\SimpleMigrationStep;
class Version15000Date20181015062942 extends SimpleMigrationStep {
-
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
use OCP\Migration\SimpleMigrationStep;
class Version15000Date20181029084625 extends SimpleMigrationStep {
-
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
use OCP\Migration\SimpleMigrationStep;
class Version16000Date20190207141427 extends SimpleMigrationStep {
-
-
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
use OCP\Migration\SimpleMigrationStep;
class Version16000Date20190427105638 extends SimpleMigrationStep {
-
/** @var IDBConnection */
private $connection;
use OCP\Migration\SimpleMigrationStep;
class Version16000Date20190428150708 extends SimpleMigrationStep {
-
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
use OCP\Migration\SimpleMigrationStep;
class Version17000Date20190514105811 extends SimpleMigrationStep {
-
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
use OCP\Migration\SimpleMigrationStep;
class Version18000Date20190920085628 extends SimpleMigrationStep {
-
/** @var IDBConnection */
protected $connection;
use OCP\Migration\IOutput;
class Version18000Date20191014105105 extends SimpleMigrationStep {
-
/** @var IDBConnection */
protected $connection;
use OCP\Migration\IOutput;
class Version18000Date20191204114856 extends SimpleMigrationStep {
-
/** @var IDBConnection */
protected $connection;
use OCP\Migration\SimpleMigrationStep;
class Version20000Date20201109081918 extends SimpleMigrationStep {
-
/** @var IDBConnection */
protected $connection;
use OCP\Migration\SimpleMigrationStep;
class Version20000Date20201109081919 extends SimpleMigrationStep {
-
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
use OCP\Migration\IOutput;
class Version23000Date20210721100600 extends SimpleMigrationStep {
-
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
use OCP\Migration\BigIntMigration;
class Version23000Date20211213203940 extends BigIntMigration {
-
/**
* @return array Returns an array with the following structure
* ['table1' => ['column1', 'column2'], ...]
*
*/
class Version24000Date20211210141942 extends SimpleMigrationStep {
-
/** @var IDBConnection */
protected $connection;
use OCP\Migration\SimpleMigrationStep;
class Version25000Date20220602190540 extends SimpleMigrationStep {
-
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
use OCP\Migration\SimpleMigrationStep;
class Version25000Date20220905140840 extends SimpleMigrationStep {
-
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
$logger = \OC::$server->get(\Psr\Log\LoggerInterface::class);
$config = \OC::$server->getConfig();
$updater = new \OC\Updater(
- $config,
- \OC::$server->getIntegrityCodeChecker(),
- $logger,
- \OC::$server->query(\OC\Installer::class)
+ $config,
+ \OC::$server->getIntegrityCodeChecker(),
+ $logger,
+ \OC::$server->query(\OC\Installer::class)
);
$incompatibleApps = [];
$application->add(new OC\Core\Command\Check(\OC::$server->getSystemConfig()));
$application->add(new OC\Core\Command\L10n\CreateJs());
$application->add(new \OC\Core\Command\Integrity\SignApp(
- \OC::$server->getIntegrityCodeChecker(),
- new \OC\IntegrityCheck\Helpers\FileAccessHelper(),
- \OC::$server->getURLGenerator()
+ \OC::$server->getIntegrityCodeChecker(),
+ new \OC\IntegrityCheck\Helpers\FileAccessHelper(),
+ \OC::$server->getURLGenerator()
));
$application->add(new \OC\Core\Command\Integrity\SignCore(
- \OC::$server->getIntegrityCodeChecker(),
- new \OC\IntegrityCheck\Helpers\FileAccessHelper()
+ \OC::$server->getIntegrityCodeChecker(),
+ new \OC\IntegrityCheck\Helpers\FileAccessHelper()
));
$application->add(new \OC\Core\Command\Integrity\CheckApp(
- \OC::$server->getIntegrityCodeChecker()
+ \OC::$server->getIntegrityCodeChecker()
));
$application->add(new \OC\Core\Command\Integrity\CheckCore(
- \OC::$server->getIntegrityCodeChecker()
+ \OC::$server->getIntegrityCodeChecker()
));
\OC::$server->getConfig()
);
$application->add(new OC\Core\Command\Encryption\ChangeKeyStorageRoot(
- $view,
- \OC::$server->getUserManager(),
- \OC::$server->getConfig(),
- $util,
- new \Symfony\Component\Console\Helper\QuestionHelper()
- )
+ $view,
+ \OC::$server->getUserManager(),
+ \OC::$server->getConfig(),
+ $util,
+ new \Symfony\Component\Console\Helper\QuestionHelper()
+ )
);
$application->add(new OC\Core\Command\Encryption\ShowKeyStorageRoot($util));
$application->add(new OC\Core\Command\Encryption\MigrateKeyStorage(
- $view,
- \OC::$server->getUserManager(),
- \OC::$server->getConfig(),
- $util,
- \OC::$server->getCrypto()
- )
+ $view,
+ \OC::$server->getUserManager(),
+ \OC::$server->getConfig(),
+ $util,
+ \OC::$server->getCrypto()
+ )
);
$application->add(new OC\Core\Command\Maintenance\DataFingerprint(\OC::$server->getConfig(), new \OC\AppFramework\Utility\TimeFactory()));
<div class="guest-box">
<h2><?php p($l->t('Access forbidden')); ?></h2>
<p class='hint'><?php if (isset($_['message'])) {
- p($_['message']);
-}?></p>
+ p($_['message']);
+ }?></p>
</ul>
<title>
<?php
p(!empty($_['pageTitle']) ? $_['pageTitle'] . ' – ' : '');
- p($theme->getTitle());
- ?>
+p($theme->getTitle());
+?>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<?php if ($theme->getiTunesAppId() !== '') { ?>
<div id="nojavascript">
<div>
<?php print_unescaped(str_replace(
- ['{linkstart}', '{linkend}'],
- ['<a href="https://www.enable-javascript.com/" target="_blank" rel="noreferrer noopener">', '</a>'],
- $l->t('This application requires JavaScript for correct operation. Please {linkstart}enable JavaScript{linkend} and reload the page.')
- )); ?>
+ ['{linkstart}', '{linkend}'],
+ ['<a href="https://www.enable-javascript.com/" target="_blank" rel="noreferrer noopener">', '</a>'],
+ $l->t('This application requires JavaScript for correct operation. Please {linkstart}enable JavaScript{linkend} and reload the page.')
+ )); ?>
</div>
</div>
</noscript>
<title>
<?php
p(!empty($_['application'])?$_['application'].' - ':'');
- p($theme->getTitle());
- ?>
+p($theme->getTitle());
+?>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<?php if ($theme->getiTunesAppId() !== '') { ?>
<div class="header-right">
<?php
- /** @var \OCP\AppFramework\Http\Template\PublicTemplateResponse $template */
- if (isset($template) && $template->getActionCount() !== 0) {
- $primary = $template->getPrimaryAction();
- $others = $template->getOtherActions(); ?>
+/** @var \OCP\AppFramework\Http\Template\PublicTemplateResponse $template */
+if (isset($template) && $template->getActionCount() !== 0) {
+ $primary = $template->getPrimaryAction();
+ $others = $template->getOtherActions(); ?>
<span id="header-primary-action" class="<?php if ($template->getActionCount() === 1) {
p($primary->getIcon());
} ?>">
foreach ($others as $action) {
print_unescaped($action->render());
}
- ?>
+ ?>
</ul>
</div>
</div>
<?php } ?>
<?php
- } ?>
+} ?>
</div>
</header>
<main id="content" class="app-<?php p($_['appid']) ?>">
<footer>
<p><?php print_unescaped($theme->getLongFooter()); ?></p>
<?php
- if ($_['showSimpleSignUpLink']) {
- ?>
+if ($_['showSimpleSignUpLink']) {
+ ?>
<p>
<a href="https://nextcloud.com/signup/" target="_blank" rel="noreferrer noopener">
<?php p($l->t('Get your own free account')); ?>
</a>
</p>
<?php
- }
+}
?>
</footer>
<?php } ?>
<title>
<?php
p(!empty($_['pageTitle'])?$_['pageTitle'].' - ':'');
- p(!empty($_['application'])?$_['application'].' - ':'');
- p($theme->getTitle());
- ?>
+p(!empty($_['application'])?$_['application'].' - ':'');
+p($theme->getTitle());
+?>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<?php print_unescaped($_['headers']); ?>
</head>
<body id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) {
- p("data-theme-$themeId ");
- }?> data-themes=<?php p(join(',', $_['enabledThemes'])) ?>>
+ p("data-theme-$themeId ");
+ }?> data-themes=<?php p(join(',', $_['enabledThemes'])) ?>>
<?php include 'layout.noscript.warning.php'; ?>
<?php foreach ($_['initialStates'] as $app => $initialState) { ?>
aria-label="<?php p($l->t('Open settings menu'));?>"
aria-haspopup="true" aria-controls="expanddiv" aria-expanded="false">
<div id="avatardiv-menu" class="avatardiv<?php if ($_['userAvatarSet']) {
- print_unescaped(' avatardiv-shown');
- } else {
- print_unescaped('" style="display: none');
- } ?>"
+ print_unescaped(' avatardiv-shown');
+ } else {
+ print_unescaped('" style="display: none');
+ } ?>"
data-user="<?php p($_['user_uid']); ?>"
data-displayname="<?php p($_['user_displayname']); ?>"
<?php
- if ($_['userAvatarSet']) {
- $avatar32 = $getUserAvatar(32); ?> data-avatar="<?php p($avatar32); ?>"
+ if ($_['userAvatarSet']) {
+ $avatar32 = $getUserAvatar(32); ?> data-avatar="<?php p($avatar32); ?>"
<?php
- } ?>>
+ } ?>>
<?php
- if ($_['userAvatarSet']) {?>
+ if ($_['userAvatarSet']) {?>
<img alt="" width="32" height="32"
src="<?php p($avatar32);?>"
srcset="<?php p($getUserAvatar(64));?> 2x, <?php p($getUserAvatar(128));?> 4x"
\OCP\Util::addStyle('core', 'guest');
\OCP\Util::addStyle('core', 'publicshareauth');
\OCP\Util::addScript('core', 'publicshareauth');
-?>
+ ?>
<div class="guest-box">
<!-- password prompt form. It should be hidden when we show the email prompt form -->
<li>
<a class="two-factor-provider"
href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge',
- [
- 'challengeProviderId' => $provider->getId(),
- 'redirect_url' => $_['redirect_url'],
- ]
- )) ?>">
+ [
+ 'challengeProviderId' => $provider->getId(),
+ 'redirect_url' => $_['redirect_url'],
+ ]
+ )) ?>">
<?php
if ($provider instanceof \OCP\Authentication\TwoFactorAuth\IProvidesIcons) {
$icon = $provider->getLightIcon();
} else {
$icon = image_path('core', 'actions/password-white.svg');
}
- ?>
+ ?>
<img src="<?php p($icon) ?>" alt="" />
<div>
<h3><?php p($provider->getDisplayName()) ?></h3>
<li>
<a class="two-factor-provider"
href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.setupProvider',
- [
- 'providerId' => $provider->getId(),
- ]
- )) ?>">
+ [
+ 'providerId' => $provider->getId(),
+ ]
+ )) ?>">
<?php
if ($provider instanceof \OCP\Authentication\TwoFactorAuth\IProvidesIcons) {
$icon = $provider->getLightIcon();
} else {
$icon = image_path('core', 'actions/password-white.svg');
}
- ?>
+ ?>
<img src="<?php p($icon) ?>" alt="" />
<div>
<h3><?php p($provider->getDisplayName()) ?></h3>
<h2 class="title"><?php p($l->t('Update needed')) ?></h2>
<div class="text-left">
<?php if ($_['tooBig']) {
- p($l->t('Please use the command line updater because you have a big instance with more than 50 users.'));
-} else {
- p($l->t('Please use the command line updater because automatic updating is disabled in the config.php.'));
-} ?><br><br>
+ p($l->t('Please use the command line updater because you have a big instance with more than 50 users.'));
+ } else {
+ p($l->t('Please use the command line updater because automatic updating is disabled in the config.php.'));
+ } ?><br><br>
<?php
- print_unescaped($l->t('For help, see the <a target="_blank" rel="noreferrer noopener" href="%s">documentation</a>.', [link_to_docs('admin-cli-upgrade')])); ?>
+ print_unescaped($l->t('For help, see the <a target="_blank" rel="noreferrer noopener" href="%s">documentation</a>.', [link_to_docs('admin-cli-upgrade')])); ?>
</div>
</div>
use OCP\Accounts\IAccountProperty;
class AccountProperty implements IAccountProperty {
-
/** @var string */
private $name;
/** @var string */
use OCP\Accounts\IAccountPropertyCollection;
class AccountPropertyCollection implements IAccountPropertyCollection {
-
/** @var string */
protected $collectionName = '';
* @template-implements IEventListener<UserChangedEvent>
*/
class Hooks implements IEventListener {
-
/** @var IAccountManager */
private $accountManager;
/** @var LoggerInterface */
use OCP\IL10N;
class EventMerger implements IEventMerger {
-
/** @var IL10N */
protected $l10n;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class AppManager implements IAppManager {
-
/**
* Apps with these types can not be enabled for certain groups only
* @var string[]
namespace OC\App\AppStore\Bundles;
class EducationBundle extends Bundle {
-
/**
* {@inheritDoc}
*/
namespace OC\App\AppStore\Bundles;
class EnterpriseBundle extends Bundle {
-
/**
* {@inheritDoc}
*/
namespace OC\App\AppStore\Bundles;
class GroupwareBundle extends Bundle {
-
/**
* {@inheritDoc}
*/
namespace OC\App\AppStore\Bundles;
class SocialSharingBundle extends Bundle {
-
/**
* {@inheritDoc}
*/
use Psr\Log\LoggerInterface;
class AppFetcher extends Fetcher {
-
/** @var CompareVersion */
private $compareVersion;
$minPhpVersion = $phpVersion->getMinimumVersion();
$maxPhpVersion = $phpVersion->getMaximumVersion();
$minPhpFulfilled = $minPhpVersion === '' || $this->compareVersion->isCompatible(
- PHP_VERSION,
- $minPhpVersion,
- '>='
- );
+ PHP_VERSION,
+ $minPhpVersion,
+ '>='
+ );
$maxPhpFulfilled = $maxPhpVersion === '' || $this->compareVersion->isCompatible(
- PHP_VERSION,
- $maxPhpVersion,
- '<='
- );
+ PHP_VERSION,
+ $maxPhpVersion,
+ '<='
+ );
$isPhpCompatible = $minPhpFulfilled && $maxPhpFulfilled;
}
// Always get latests apps info if $allowUnstable
if (!$allowUnstable && is_array($jsonBlob)) {
-
// No caching when the version has been updated
if (isset($jsonBlob['ncversion']) && $jsonBlob['ncversion'] === $this->getVersion()) {
-
// If the timestamp is older than 3600 seconds request the files new
if ((int)$jsonBlob['timestamp'] > ($this->timeFactory->getTime() - self::INVALIDATE_AFTER_SECONDS)) {
return $jsonBlob['data'];
use OCP\IL10N;
class DependencyAnalyzer {
-
/** @var Platform */
private $platform;
/** @var \OCP\IL10N */
} else {
$array[$element] = $data;
}
- // Just a value
+ // Just a value
} else {
if ($totalElement > 1) {
$array[$element][] = $this->xmlToArray($node);
* database.
*/
class AppConfig implements IAppConfig {
-
/** @var array[] */
protected $sensitiveValues = [
'circles' => [
* > Large objects (LOBs) are not supported in comparison conditions.
*/
if (!($this->conn instanceof OracleConnection)) {
-
/*
* Only update the value when it is not the same
* Note that NULL requires some special handling. Since comparing
* Handles all the dependency injection, controllers and output flow
*/
class App {
-
/** @var string[] */
private static $nameSpaceCache = [];
* @psalm-immutable
*/
abstract class ARegistration {
-
/** @var string */
private $appId;
use OCP\IServerContainer;
class BootContext implements IBootContext {
-
/** @var IAppContainer */
private $appContainer;
use Throwable;
class Coordinator {
-
/** @var IServerContainer */
private $serverContainer;
* @template-extends ServiceRegistration<\OCP\EventDispatcher\IEventListener>
*/
class EventListenerRegistration extends ServiceRegistration {
-
/** @var string */
private $event;
use function array_map;
class FunctionInjector {
-
/** @var ContainerInterface */
private $container;
* @psalm-immutable
*/
final class ParameterRegistration extends ARegistration {
-
/** @var string */
private $name;
* @template-extends ServiceRegistration<\OCP\Preview\IProviderV2>
*/
class PreviewProviderRegistration extends ServiceRegistration {
-
/** @var string */
private $mimeTypeRegex;
use Throwable;
class RegistrationContext {
-
/** @var ServiceRegistration<ICapability>[] */
private $capabilities = [];
* @psalm-immutable
*/
class ServiceAliasRegistration extends ARegistration {
-
/**
* @var string
* @psalm-var string|class-string
* @psalm-immutable
*/
class ServiceFactoryRegistration extends ARegistration {
-
/**
* @var string
* @psalm-var string|class-string
* Class to dispatch the request to the middleware dispatcher
*/
class Dispatcher {
-
/** @var MiddlewareDispatcher */
private $middlewareDispatcher;
} catch (\Throwable $throwable) {
$exception = new \Exception($throwable->getMessage() . ' in file \'' . $throwable->getFile() . '\' line ' . $throwable->getLine(), $throwable->getCode(), $throwable);
$response = $this->middlewareDispatcher->afterException(
- $controller, $methodName, $exception);
+ $controller, $methodName, $exception);
}
$response = $this->middlewareDispatcher->afterController(
$types = ['int', 'integer', 'bool', 'boolean', 'float', 'double'];
foreach ($this->reflector->getParameters() as $param => $default) {
-
// try to get the parameter from the request object and cast
// it to the type annotated in the @param annotation
$value = $this->request->getParam($param, $default);
// format response
if ($response instanceof DataResponse || !($response instanceof Response)) {
-
// get format from the url format or request format parameter
$format = $this->request->getParam('format');
$this->items['post'] = $params;
}
}
- // Handle application/x-www-form-urlencoded for methods other than GET
+ // Handle application/x-www-form-urlencoded for methods other than GET
// or post correctly
} elseif ($this->method !== 'GET'
&& $this->method !== 'POST'
* @deprecated
*/
class Logger implements ILogger {
-
/** @var ILogger */
private $logger;
use OCP\IRequest;
class CompressionMiddleware extends Middleware {
-
/** @var bool */
private $useGZip;
* This class is used to store and run all the middleware in correct order
*/
class MiddlewareDispatcher {
-
/**
* @var array array containing all the middlewares
*/
use OCP\IRequest;
class OCSMiddleware extends Middleware {
-
/** @var IRequest */
private $request;
use OCP\ISession;
class PublicShareMiddleware extends Middleware {
-
/** @var IRequest */
private $request;
if (isset($this->request->server['HTTP_ORIGIN']) &&
$this->reflector->hasAnnotation('CORS')) {
-
// allow credentials headers must not be true or CSRF is possible
// otherwise
foreach ($response->getHeaders() as $header => $value) {
use OCP\AppFramework\Middleware;
class CSPMiddleware extends Middleware {
-
/** @var ContentSecurityPolicyManager */
private $contentSecurityPolicyManager;
/** @var ContentSecurityPolicyNonceManager */
use OCP\AppFramework\Middleware;
class FeaturePolicyMiddleware extends Middleware {
-
/** @var FeaturePolicyManager */
private $policyManager;
use OCP\AppFramework\Middleware;
class SameSiteCookieMiddleware extends Middleware {
-
/** @var Request */
private $request;
* @suppress PhanUndeclaredClassConstant
*/
public function beforeController($controller, $methodName) {
-
// this will set the current navigation entry of the app, use this only
// for normal HTML requests and not for AJAX requests
$this->navigationManager->setActiveEntry($this->appName);
* This allows oauth apps (e.g. moodle) to use the OCS endpoints
*/
if (!$this->request->passesCSRFCheck() && !(
- $controller instanceof OCSController && (
- $this->request->getHeader('OCS-APIREQUEST') === 'true' ||
- strpos($this->request->getHeader('Authorization'), 'Bearer ') === 0
- )
- )) {
+ $controller instanceof OCSController && (
+ $this->request->getHeader('OCS-APIREQUEST') === 'true' ||
+ strpos($this->request->getHeader('Authorization'), 'Bearer ') === 0
+ )
+ )) {
throw new CrossSiteRequestForgeryException();
}
}
use OCP\ISession;
class SessionMiddleware extends Middleware {
-
/** @var ControllerMethodReflector */
private $reflector;
* The routes and resource will be registered to the \OCP\Route\IRouter
*/
public function register() {
-
// parse simple
$this->processIndexRoutes($this->routes);
use function array_merge;
class ScopedPsrLogger implements LoggerInterface {
-
/** @var LoggerInterface */
private $inner;
use OCP\IConfig;
class AppConfig implements IAppConfig {
-
/** @var IConfig */
private $config;
* SimpleContainer is a simple implementation of a container on basis of Pimple
*/
class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
-
/** @var Container */
private $container;
* Needed to mock calls to time()
*/
class TimeFactory implements ITimeFactory {
-
-
/**
* @return int the result of a call to time()
*/
use OCP\EventDispatcher\Event;
abstract class ARemoteWipeEvent extends Event {
-
/** @var IToken */
private $token;
* @template-implements IEventListener<\OC\Authentication\Events\LoginFailed>
*/
class LoginFailedListener implements IEventListener {
-
/** @var IEventDispatcher */
private $dispatcher;
* @template-implements IEventListener<\OC\Authentication\Events\ARemoteWipeEvent>
*/
class RemoteWipeActivityListener implements IEventListener {
-
/** @var IActvityManager */
private $activityManager;
* @template-implements IEventListener<\OC\Authentication\Events\ARemoteWipeEvent>
*/
class RemoteWipeEmailListener implements IEventListener {
-
/** @var IMailer */
private $mailer;
* @template-implements IEventListener<\OC\Authentication\Events\ARemoteWipeEvent>
*/
class RemoteWipeNotificationsListener implements IEventListener {
-
/** @var INotificationManager */
private $notificationManager;
* @template-implements IEventListener<\OCP\User\Events\UserDeletedEvent>
*/
class UserDeletedStoreCleanupListener implements IEventListener {
-
/** @var Registry */
private $registry;
* @template-implements IEventListener<\OCP\User\Events\UserDeletedEvent>
*/
class UserDeletedTokenCleanupListener implements IEventListener {
-
/** @var Manager */
private $manager;
use OCP\User\Events\UserDeletedEvent;
class UserDeletedWebAuthnCleanupListener implements IEventListener {
-
/** @var PublicKeyCredentialMapper */
private $credentialMapper;
* @template-implements IEventListener<\OCP\User\Events\PostLoginEvent>
*/
class UserLoggedInListener implements IEventListener {
-
/** @var Manager */
private $manager;
namespace OC\Authentication\Login;
abstract class ALoginCommand {
-
/** @var ALoginCommand */
protected $next;
namespace OC\Authentication\Login;
class Chain {
-
/** @var PreLoginHookCommand */
private $preLoginHookCommand;
use OCP\IConfig;
class ClearLostPasswordTokensCommand extends ALoginCommand {
-
/** @var IConfig */
private $config;
use OC\User\Session;
class CompleteLoginCommand extends ALoginCommand {
-
/** @var Session */
private $userSession;
use OCP\IConfig;
class CreateSessionTokenCommand extends ALoginCommand {
-
/** @var IConfig */
private $config;
use OCP\IUserManager;
class EmailLoginCommand extends ALoginCommand {
-
/** @var IUserManager */
private $userManager;
$users = $this->userManager->getByEmail($loginData->getUsername());
// we only allow login by email if unique
if (count($users) === 1) {
-
// FIXME: This is a workaround to still stick to configured LDAP login filters
// this can be removed once the email login is properly implemented in the local user backend
// as described in https://github.com/nextcloud/server/issues/5221
use OCP\IConfig;
class FinishRememberedLoginCommand extends ALoginCommand {
-
/** @var Session */
private $userSession;
/** @var IConfig */
use Psr\Log\LoggerInterface;
class LoggedInCheckCommand extends ALoginCommand {
-
/** @var LoggerInterface */
private $logger;
/** @var IEventDispatcher */
use OCP\IUser;
class LoginData {
-
/** @var IRequest */
private $request;
namespace OC\Authentication\Login;
class LoginResult {
-
/** @var bool */
private $success;
use OCP\IUserManager;
class PreLoginHookCommand extends ALoginCommand {
-
/** @var IUserManager */
private $userManager;
use OCP\ISession;
class SetUserTimezoneCommand extends ALoginCommand {
-
/** @var IConfig */
private $config;
use OCP\IURLGenerator;
class TwoFactorCommand extends ALoginCommand {
-
/** @var Manager */
private $twoFactorManager;
use OCP\IUser;
class UidLoginCommand extends ALoginCommand {
-
/** @var Manager */
private $userManager;
use OCP\ISession;
class UpdateLastPasswordConfirmCommand extends ALoginCommand {
-
/** @var ISession */
private $session;
use Psr\Log\LoggerInterface;
class UserDisabledCheckCommand extends ALoginCommand {
-
/** @var IUserManager */
private $userManager;
use OCP\IUserManager;
class WebAuthnLoginCommand extends ALoginCommand {
-
/** @var IUserManager */
private $userManager;
use OCP\Authentication\LoginCredentials\ICredentials;
class Credentials implements ICredentials {
-
/** @var string */
private $uid;
use Psr\Log\LoggerInterface;
class Store implements IStore {
-
/** @var ISession */
private $session;
use OCP\Notification\INotifier;
class Notifier implements INotifier {
-
/** @var IL10nFactory */
private $factory;
use OC\Authentication\Exceptions\WipeTokenException;
interface IProvider {
-
-
/**
* Create and persist a new token
*
namespace OC\Authentication\Token;
interface IWipeableToken extends IToken {
-
/**
* Mark the token for remote wipe
*/
use OC\Authentication\Exceptions\WipeTokenException;
class Manager implements IProvider {
-
/** @var PublicKeyTokenProvider */
private $publicKeyTokenProvider;
use OCP\IUser;
class RemoteWipe {
-
/** @var IProvider */
private $tokenProvider;
use JsonSerializable;
class EnforcementState implements JsonSerializable {
-
/** @var bool */
private $enforced;
// First check if the session tells us we should do 2FA (99% case)
if (!$this->session->exists(self::SESSION_UID_KEY)) {
-
// Check if the session tells us it is 2FA authenticated already
if ($this->session->exists(self::SESSION_UID_DONE) &&
$this->session->get(self::SESSION_UID_DONE) === $user->getUID()) {
use OCP\IUser;
class MandatoryTwoFactor {
-
/** @var IConfig */
private $config;
use OCP\IUser;
class ProviderManager {
-
/** @var ProviderLoader */
private $providerLoader;
* Contains all two-factor provider information for the two-factor login challenge
*/
class ProviderSet {
-
/** @var IProvider */
private $providers;
use OCP\IUser;
class Registry implements IRegistry {
-
/** @var ProviderUserAssignmentDao */
private $assignmentDao;
use Webauthn\PublicKeyCredentialUserEntity;
class CredentialRepository implements PublicKeyCredentialSourceRepository {
-
/** @var PublicKeyCredentialMapper */
private $credentialMapper;
* @method void setData(string $data);
*/
class PublicKeyCredentialEntity extends Entity implements JsonSerializable {
-
/** @var string */
protected $name;
use Webauthn\TokenBinding\TokenBindingNotSupportedHandler;
class Manager {
-
/** @var CredentialRepository */
private $repository;
* This class implements methods to access Avatar functionality
*/
class AvatarManager implements IAvatarManager {
-
/** @var IUserSession */
private $userSession;
if (
(is_resource($data) && get_resource_type($data) === 'gd') ||
(is_object($data) && get_class($data) === \GdImage::class)
- ) {
+ ) {
$img->setResource($data);
} elseif (is_resource($data)) {
$img->loadFromFileHandle($data);
use OCP\EventDispatcher\Event;
class BroadcastEvent extends Event implements IBroadcastEvent {
-
/** @var ABroadcastedEvent */
private $event;
use Psr\Log\LoggerInterface;
class File implements ICache {
-
/** @var View */
protected $storage;
use OCP\Calendar\ICalendarQuery;
class CalendarQuery implements ICalendarQuery {
-
/** @var string */
private $principalUri;
use function array_merge;
class Manager implements IManager {
-
/**
* @var ICalendar[] holds all registered calendars
*/
use Psr\Log\LoggerInterface;
class CapabilitiesManager {
-
/** @var \Closure[] */
private $capabilities = [];
use Psr\Log\LoggerInterface;
class LookupPlugin implements ISearchPlugin {
-
/** @var IConfig */
private $config;
/** @var IClientService */
use OCP\IUser;
class Collection implements ICollection {
-
/** @var IManager|Manager */
protected $manager;
use Psr\Log\LoggerInterface;
class ProviderManager implements IProviderManager {
-
/** @var string[] */
protected $providers = [];
use OCP\IUser;
class Resource implements IResource {
-
/** @var IManager */
protected $manager;
*/
public function setActor($actorType, $actorId) {
if (
- !is_string($actorType) || !trim($actorType)
+ !is_string($actorType) || !trim($actorType)
|| !is_string($actorId) || $actorId === ''
) {
throw new \InvalidArgumentException('String expected.');
*/
public function setObject($objectType, $objectId) {
if (
- !is_string($objectType) || !trim($objectType)
+ !is_string($objectType) || !trim($objectType)
|| !is_string($objectId) || trim($objectId) === ''
) {
throw new \InvalidArgumentException('String expected.');
use Psr\Log\LoggerInterface;
class Manager implements ICommentsManager {
-
/** @var IDBConnection */
protected $dbConn;
use OCP\IServerContainer;
class ManagerFactory implements ICommentsManagerFactory {
-
/**
* Server container
*
use OCP\Contacts\ContactsMenu\ILinkAction;
class ActionFactory implements IActionFactory {
-
/**
* {@inheritDoc}
*/
use OCP\Contacts\ContactsMenu\IEntry;
class Entry implements IEntry {
-
/** @var string|int|null */
private $id = null;
use OCP\IAddressBook;
class ContactsManager implements IManager {
-
/**
* This function is used to search and find contacts within the users address books.
* In case $pattern is empty all contacts will be returned.
* handled by the database abstraction layer.
*/
class Adapter {
-
/**
* @var \OC\DB\Connection $conn
*/
namespace OC\DB;
class AdapterMySQL extends Adapter {
-
/** @var string */
protected $collation;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
class AdapterSqlite extends Adapter {
-
/**
* @param string $tableName
*/
* Adapts the public API to our internal DBAL connection wrapper
*/
class ConnectionAdapter implements IDBConnection {
-
/** @var Connection */
private $inner;
* @psalm-immutable
*/
class DbalException extends Exception {
-
/** @var \Doctrine\DBAL\Exception */
private $original;
* Various MySQL specific helper functions.
*/
class MySqlTools {
-
/**
* @param IDBConnection $connection
* @return bool
use Doctrine\DBAL\Schema\Table;
class OracleMigrator extends Migrator {
-
/**
* Quote a column's name but changing the name requires recreating
* the column instance and copying over all properties.
*/
protected function quoteIndex($index) {
return new Index(
- //TODO migrate existing uppercase indexes, then $this->connection->quoteIdentifier($index->getName()),
+ //TODO migrate existing uppercase indexes, then $this->connection->quoteIdentifier($index->getName()),
$index->getName(),
array_map(function ($columnName) {
return $this->connection->quoteIdentifier($columnName);
* Various PostgreSQL specific helper functions.
*/
class PgSqlTools {
-
/** @var \OCP\IConfig */
private $config;
* methods without much magic.
*/
class PreparedStatement implements IPreparedStatement {
-
/** @var Statement */
private $statement;
use OCP\DB\QueryBuilder\IQueryFunction;
class MySqlExpressionBuilder extends ExpressionBuilder {
-
/** @var string */
protected $collation;
use OCP\DB\QueryBuilder\IQueryFunction;
class OCIExpressionBuilder extends ExpressionBuilder {
-
/**
* @param mixed $column
* @param mixed|null $type
use OCP\DB\QueryBuilder\IQueryFunction;
class PgSqlExpressionBuilder extends ExpressionBuilder {
-
/**
* Returns a IQueryFunction that casts the column to the given type
*
use Psr\Log\LoggerInterface;
class QueryBuilder implements IQueryBuilder {
-
/** @var ConnectionAdapter */
private $connection;
* Adapts DBAL 2.6 API for DBAL 3.x for backwards compatibility of a leaked type
*/
class ResultAdapter implements IResult {
-
/** @var Result */
private $inner;
use Doctrine\DBAL\Types\Type;
class SQLiteMigrator extends Migrator {
-
/**
* @param Schema $targetSchema
* @param \Doctrine\DBAL\Connection $connection
use OCP\DB\ISchemaWrapper;
class SchemaWrapper implements ISchemaWrapper {
-
/** @var Connection */
protected $connection;
use Psr\Log\LoggerInterface;
class Manager implements IManager {
-
/** @var array */
private $lazyWidgets = [];
use Psr\Log\LoggerInterface;
class EventLogger implements IEventLogger {
-
/** @var Event[] */
private $events = [];
use OCP\Files\File;
class Token implements IToken {
-
/** @var Manager */
private $manager;
private $data;
use Symfony\Component\Console\Output\OutputInterface;
class DecryptAll {
-
/** @var OutputInterface */
protected $output;
* @return bool
*/
protected function decryptFile($path) {
-
// skip already decrypted files
$fileInfo = $this->rootView->getFileInfo($path);
if ($fileInfo !== false && !$fileInfo->isEncrypted()) {
* @package OC\Encryption
*/
class EncryptionWrapper {
-
/** @var ArrayCache */
private $arrayCache;
use OCP\Encryption\Exceptions\GenericEncryptionException;
class EncryptionHeaderKeyExistsException extends GenericEncryptionException {
-
/**
* @param string $key
*/
use OCP\Encryption\Exceptions\GenericEncryptionException;
class ModuleAlreadyExistsException extends GenericEncryptionException {
-
/**
* @param string $id
* @param string $name
* @return array{users: string[], public: bool}
*/
public function getAccessList($path) {
-
// Make sure that a share key is generated for the owner too
[$owner, $ownerPath] = $this->util->getUidAndFilename($path);
use OCP\Security\ICrypto;
class Storage implements IStorage {
-
// hidden file which indicate that the folder is a valid key storage
public const KEY_STORAGE_MARKER = '.oc_key_storage';
use Psr\Log\LoggerInterface;
class Manager implements IManager {
-
/** @var array */
protected $encryptionModules;
* update encrypted files, e.g. because a file was shared
*/
class Update {
-
/** @var View */
protected $view;
$normalizedPath = Filesystem::normalizePath($path);
$root = explode('/', $normalizedPath, 4);
if (count($root) > 1) {
-
// detect alternative key storage root
$rootDir = $this->getKeyStorageRoot();
if ($rootDir !== '' &&
use Symfony\Component\EventDispatcher\EventDispatcher as SymfonyDispatcher;
class EventDispatcher implements IEventDispatcher {
-
/** @var SymfonyDispatcher */
private $dispatcher;
* created by the service container
*/
final class ServiceEventListener {
-
/** @var IServerContainer */
private $container;
* @deprecated 20.0.0 use \OCP\EventDispatcher\IEventDispatcher
*/
class SymfonyAdapter implements EventDispatcherInterface {
-
/** @var EventDispatcher */
private $eventDispatcher;
private LoggerInterface $logger;
use OCP\Federation\ICloudFederationShare;
class CloudFederationFactory implements ICloudFederationFactory {
-
/**
* get a CloudFederationShare Object to prepare a share you want to send
*
* @package OC\Federation
*/
class CloudFederationProviderManager implements ICloudFederationProviderManager {
-
/** @var array list of available cloud federation providers */
private $cloudFederationProvider;
use Psr\Log\LoggerInterface;
class QuerySearchHelper {
-
/** @var IMimeTypeLoader */
private $mimetypeLoader;
/** @var IDBConnection */
}
// only proceed if $file is not a partial file, blacklist is handled by the storage
if (!self::isPartialFile($file)) {
-
// acquire a lock
if ($lock) {
if ($this->storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) {
try {
if ($data) {
-
// pre-emit only if it was a file. By that we avoid counting/treating folders as files
if ($data['mimetype'] !== 'httpd/unix-directory') {
$this->emit('\OC\Files\Cache\Scanner', 'scanFile', [$file, $this->storageId]);
} else {
throw new \InvalidArgumentException('Binary operators inside "not" is not supported');
}
- // no break
+ // no break
case ISearchBinaryOperator::OPERATOR_AND:
return call_user_func_array([$expr, 'andX'], $this->searchOperatorArrayToDBExprArray($builder, $operator->getArguments()));
case ISearchBinaryOperator::OPERATOR_OR:
use OCP\IUserSession;
class Filesystem {
-
/**
* @var Mount\Manager $mounts
*/
namespace OC\Files\ObjectStore;
class AppdataPreviewObjectStoreStorage extends ObjectStoreStorage {
-
/** @var string */
private $internalId;
use OC\User\User;
class HomeObjectStoreStorage extends ObjectStoreStorage implements \OCP\Files\IHomeStorage {
-
/**
* The home user storage requires a user object to create a unique storage id
* @param array $params
} else {
return false;
}
- // no break
+ // no break
case 'w':
case 'wb':
case 'w+':
return new PermissionsMask([
'storage' => $storage,
'mask' => Constants::PERMISSION_ALL & ~(
- Constants::PERMISSION_UPDATE |
- Constants::PERMISSION_CREATE |
- Constants::PERMISSION_DELETE
- ),
+ Constants::PERMISSION_UPDATE |
+ Constants::PERMISSION_CREATE |
+ Constants::PERMISSION_DELETE
+ ),
]);
}
return $storage;
use OCP\Files\SimpleFS\ISimpleFile;
class SimpleFolder implements ISimpleFolder {
-
/** @var Folder */
private $folder;
* @throws InvalidPathException
*/
public function verifyPath($path, $fileName) {
-
// verify empty and dot files
$trimmed = trim($fileName);
if ($trimmed === '') {
* Storage placeholder to represent a missing precondition, storage unavailable
*/
class FailedStorage extends Common {
-
/** @var \Exception */
protected $e;
* in classes which extend it, e.g. $this->stat() .
*/
trait LocalTempFileTrait {
-
/** @var string[] */
protected $cachedFiles = [];
* All paths passed to the storage are relative to the storage and should NOT have a leading slash.
*/
interface Storage extends \OCP\Files\Storage {
-
/**
* get a cache instance for the storage
*
* the actual given name and then try its NFD form.
*/
class Encoding extends Wrapper {
-
/**
* @var ICache
*/
* @throws ModuleDoesNotExistsException
*/
public function fopen($path, $mode) {
-
// check if the file is stored in the array cache, this means that we
// copy a file over to the versions folder, in this case we don't want to
// decrypt it
$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
// - copy the file cache update from $this->copyBetweenStorage to this method
$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
if ($this->isVersion($targetInternalPath) ||
use function stream_context_create;
class Encryption extends Wrapper {
-
/** @var \OC\Encryption\Util */
protected $util;
// only allow writes on seekable streams, or at the end of the encrypted stream
if (!$this->readOnly && ($resultFseek || $positionInFile === $this->size)) {
-
// switch the writeFlag so flush() will write the block
$this->writeFlag = true;
$this->fileUpdated = true;
$length += $remainingLength;
$data = '';
// if $data doesn't fit the current block, the fill the current block and reiterate
- // after the block is filled, it is flushed and $data is updatedxxx
+ // after the block is filled, it is flushed and $data is updatedxxx
} else {
$this->cache = substr($this->cache, 0, $blockPosition) .
substr($data, 0, $this->unencryptedBlockSize - $blockPosition);
// note: leading dot doesn't qualify as extension
if (strpos($fileName, '.') > 0) {
-
// remove versioning extension: name.v1508946057 and transfer extension: name.ocTransferId2057600214.part
$fileName = preg_replace('!((\.v\d+)|((\.ocTransferId\d+)?\.part))$!', '', $fileName);
* @package OC\Files\Type
*/
class Loader implements IMimeTypeLoader {
-
/** @var IDBConnection */
private $dbConnection;
->from('mimetypes')
->where(
$fetch->expr()->eq('mimetype', $fetch->createNamedParameter($mimetype)
- ));
+ ));
$result = $fetch->execute();
$row = $result->fetch();
} else {
$result = false;
}
- // moving a file/folder within the same mount point
+ // moving a file/folder within the same mount point
} elseif ($storage1 === $storage2) {
if ($storage1) {
$result = $storage1->rename($internalPath1, $internalPath2);
} else {
$result = false;
}
- // moving a file/folder between storages (from $storage1 to $storage2)
+ // moving a file/folder between storages (from $storage1 to $storage2)
} else {
$result = $storage2->moveFromStorage($storage1, $internalPath1, $internalPath2);
}
public function fromTmpFile($tmpFile, $path) {
$this->assertPathLength($path);
if (Filesystem::isValidPath($path)) {
-
// Get directory that the file is going into
$filePath = dirname($path);
* @return boolean
*/
private function targetIsNotShared(IStorage $targetStorage, string $targetInternalPath) {
-
// note: cannot use the view because the target is already locked
$fileId = (int)$targetStorage->getCache()->getId($targetInternalPath);
if ($fileId === -1) {
* @package OC\FullTextSearch
*/
class FullTextSearchManager implements IFullTextSearchManager {
-
-
/** @var IProviderService */
private $providerService;
* @package OC\FullTextSearch\Model
*/
final class DocumentAccess implements IDocumentAccess, JsonSerializable {
-
-
/** @var string */
private $ownerId;
* @package OC\FullTextSearch\Model
*/
class IndexDocument implements IIndexDocument, JsonSerializable {
-
-
/** @var string */
protected $id = '';
* @package OC\FullTextSearch\Model
*/
final class SearchOption implements ISearchOption, JsonSerializable {
-
-
/** @var string */
private $name = '';
* @package OC\FullTextSearch\Model
*/
final class SearchRequestSimpleQuery implements ISearchRequestSimpleQuery, JsonSerializable {
-
-
/** @var int */
private $type = 0;
* @package OC\FullTextSearch\Model
*/
final class SearchTemplate implements ISearchTemplate, JsonSerializable {
-
-
/** @var string */
private $icon = '';
use OCP\IConfig;
class Config implements \OCP\GlobalScale\IConfig {
-
/** @var IConfig */
private $config;
*/
class Database extends ABackend implements
IAddToGroupBackend,
- ICountDisabledInGroup,
- ICountUsersBackend,
- ICreateGroupBackend,
- IDeleteGroupBackend,
- IGetDisplayNameBackend,
- IGroupDetailsBackend,
- IRemoveFromGroupBackend,
- ISetDisplayNameBackend,
- INamedBackend {
-
+ ICountDisabledInGroup,
+ ICountUsersBackend,
+ ICreateGroupBackend,
+ IDeleteGroupBackend,
+ IGetDisplayNameBackend,
+ IGroupDetailsBackend,
+ IRemoveFromGroupBackend,
+ ISetDisplayNameBackend,
+ INamedBackend {
/** @var string[] */
private $groupCache = [];
* @deprecated 18.0.0 use events and the \OCP\EventDispatcher\IEventDispatcher service
*/
trait EmitterTrait {
-
/**
* @var callable[][] $listeners
*/
use function array_reduce;
class RequestManager {
-
/** @var Coordinator */
private $coordinator;
use Psr\Log\LoggerInterface;
class InitialStateService implements IInitialStateService {
-
/** @var LoggerInterface */
private $logger;
$hashes = $this->generateHashes($iterator, $path);
$signature = $this->createSignatureData($hashes, $certificate, $privateKey);
$this->fileAccessHelper->file_put_contents(
- $appInfoDir . '/signature.json',
+ $appInfoDir . '/signature.json',
json_encode($signature, JSON_PRETTY_PRINT)
);
} catch (\Exception $e) {
// Verify if certificate has proper CN. "core" CN is always trusted.
if ($x509->getDN(X509::DN_OPENSSL)['CN'] !== $certificateCN && $x509->getDN(X509::DN_OPENSSL)['CN'] !== 'core') {
throw new InvalidSignatureException(
- sprintf('Certificate is not valid for required scope. (Requested: %s, current: CN=%s)', $certificateCN, $x509->getDN(true)['CN'])
+ sprintf('Certificate is not valid for required scope. (Requested: %s, current: CN=%s)', $certificateCN, $x509->getDN(true)['CN'])
);
}
$path = $this->appLocator->getAppPath($appId);
}
$result = $this->verify(
- $path . '/appinfo/signature.json',
- $path,
- $appId,
- $forceVerify
+ $path . '/appinfo/signature.json',
+ $path,
+ $appId,
+ $forceVerify
);
} catch (\Exception $e) {
$result = [
public function verifyCoreSignature(): array {
try {
$result = $this->verify(
- $this->environmentHelper->getServerRoot() . '/core/signature.json',
- $this->environmentHelper->getServerRoot(),
- 'core'
+ $this->environmentHelper->getServerRoot() . '/core/signature.json',
+ $this->environmentHelper->getServerRoot(),
+ 'core'
);
} catch (\Exception $e) {
$result = [
* @method string getKnownUser()
*/
class KnownUser extends Entity {
-
/** @var string */
protected $knownTo;
* A factory that generates language instances
*/
class Factory implements IFactory {
-
/** @var string */
protected $requestLanguage = '';
use Symfony\Component\Translation\IdentityTranslator;
class L10N implements IL10N {
-
/** @var IFactory */
protected $factory;
return $forcedLang;
}
$this->next();
- /** @noinspection PhpMissingBreakStatementInspection */
- // no break
+ /** @noinspection PhpMissingBreakStatementInspection */
+ // no break
case 1:
$forcedLang = $this->config->getSystemValue('force_language', false);
if (is_string($forcedLang)
return $truncated;
}
$this->next();
- /** @noinspection PhpMissingBreakStatementInspection */
- // no break
+ /** @noinspection PhpMissingBreakStatementInspection */
+ // no break
case 2:
$userLang = $this->config->getUserValue($this->user->getUID(), 'core', 'lang', null);
if (is_string($userLang)) {
return $userLang;
}
$this->next();
- /** @noinspection PhpMissingBreakStatementInspection */
- // no break
+ /** @noinspection PhpMissingBreakStatementInspection */
+ // no break
case 3:
$userLang = $this->config->getUserValue($this->user->getUID(), 'core', 'lang', null);
if (is_string($userLang)
// no break
case 4:
return $this->config->getSystemValue('default_language', 'en');
- /** @noinspection PhpMissingBreakStatementInspection */
+ /** @noinspection PhpMissingBreakStatementInspection */
case 5:
$defaultLang = $this->config->getSystemValue('default_language', 'en');
if (($truncated = $this->getTruncatedLanguage($defaultLang)) !== $defaultLang) {
use OCP\IL10N;
class LazyL10N implements IL10N {
-
/** @var IL10N */
private $l;
* To be used when locking is disabled.
*/
class NoopLockingProvider implements ILockingProvider {
-
/**
* {@inheritdoc}
*/
// default to false to just process this once per request
$this->logConditionSatisfied = false;
if (!empty($logCondition)) {
-
// check for secret token in the request
if (isset($logCondition['shared_secret'])) {
$request = \OC::$server->getRequest();
use OCP\Log\IWriter;
class Errorlog extends LogDetails implements IWriter {
-
/** @var string */
protected $tag;
use OC\SystemConfig;
abstract class LogDetails {
-
/** @var SystemConfig */
private $config;
case 'file':
return $this->buildLogFile();
- // Backwards compatibility for old and fallback for unknown log types
+ // Backwards compatibility for old and fallback for unknown log types
case 'owncloud':
case 'nextcloud':
default:
use function array_merge;
final class PsrLoggerAdapter implements LoggerInterface, IDataLogger {
-
/** @var Log */
private $logger;
public function write(string $app, $message, int $level) {
$journal_level = $this->levels[$level];
sd_journal_send('PRIORITY='.$journal_level,
- 'SYSLOG_IDENTIFIER='.$this->syslogId,
- 'MESSAGE=' . $this->logDetailsAsJSON($app, $message, $level));
+ 'SYSLOG_IDENTIFIER='.$this->syslogId,
+ 'MESSAGE=' . $this->logDetailsAsJSON($app, $message, $level));
}
}
* @since 13.0.0
*/
class Attachment implements IAttachment {
-
/** @var \Swift_Mime_Attachment */
protected $swiftAttachment;
} elseif (!\OC::$server->get(IniGetWrapper::class)->getBool('apc.enable_cli') && \OC::$CLI) {
return false;
} elseif (
- version_compare(phpversion('apc') ?: '0.0.0', '4.0.6') === -1 &&
- version_compare(phpversion('apcu') ?: '0.0.0', '5.1.0') === -1
+ version_compare(phpversion('apc') ?: '0.0.0', '4.0.6') === -1 &&
+ version_compare(phpversion('apcu') ?: '0.0.0', '5.1.0') === -1
) {
return false;
} else {
* @package OC\Migration
*/
class ConsoleOutput implements IOutput {
-
/** @var OutputInterface */
private $output;
use OCP\Notification\IAction;
class Action implements IAction {
-
/** @var string */
protected $label;
* @package OC\OCS
*/
class CoreCapabilities implements ICapability {
-
/** @var IConfig */
private $config;
use OCP\OCS\IDiscoveryService;
class DiscoveryService implements IDiscoveryService {
-
/** @var ICache */
private $cache;
namespace OC\OCS;
class Exception extends \Exception {
-
/** @var Result */
private $result;
namespace OC\OCS;
class Result {
-
/** @var array */
protected $data;
* @package OC\Preview
*/
abstract class Bitmap extends ProviderV2 {
-
/**
* {@inheritDoc}
*/
* @return int[]
*/
private function calculateSize($width, $height, $crop, $mode, $maxWidth, $maxHeight) {
-
/*
* If we are not cropping we have to make sure the requested image
* respects the aspect ratio of the original.
* Very small wrapper class to make the generator fully unit testable
*/
class GeneratorHelper {
-
/** @var IRootFolder */
private $rootFolder;
use OCP\IImage;
abstract class Image extends ProviderV2 {
-
/**
* {@inheritDoc}
*/
use Psr\Log\LoggerInterface;
class Movie extends ProviderV2 {
-
/**
* @deprecated 23.0.0 pass option to \OCP\Preview\ProviderV2
* @var string
use OCP\Files\Node;
class WatcherConnector {
-
/** @var IRootFolder */
private $root;
use OCP\Profile\ILinkAction;
class EmailAction implements ILinkAction {
-
/** @var string */
private $value;
use OCP\Profile\ILinkAction;
class PhoneAction implements ILinkAction {
-
/** @var string */
private $value;
use OCP\Profile\ILinkAction;
class TwitterAction implements ILinkAction {
-
/** @var string */
private $value;
use OCP\Profile\ILinkAction;
class WebsiteAction implements ILinkAction {
-
/** @var string */
private $value;
use Psr\Log\LoggerInterface;
class ProfileManager {
-
/** @var IAccountManager */
private $accountManager;
use Throwable;
class Repair implements IOutput {
-
/** @var IRepairStep[] */
private array $repairSteps;
use OCP\Migration\IRepairStep;
class AddBruteForceCleanupJob implements IRepairStep {
-
/** @var IJobList */
protected $jobList;
use OCP\Migration\IRepairStep;
class AddCleanupUpdaterBackupsJob implements IRepairStep {
-
/** @var IJobList */
protected $jobList;
* @package OC\Repair
*/
class CleanTags implements IRepairStep {
-
/** @var IDBConnection */
protected $connection;
use OCP\Migration\IRepairStep;
class ClearFrontendCaches implements IRepairStep {
-
/** @var ICacheFactory */
protected $cacheFactory;
use OCP\Migration\IRepairStep;
class MoveUpdaterStepFile implements IRepairStep {
-
/** @var \OCP\IConfig */
protected $config;
use OCP\Migration\IRepairStep;
class FixMountStorages implements IRepairStep {
-
/** @var IDBConnection */
private $db;
use OCP\Migration\IRepairStep;
class AddLogRotateJob implements IRepairStep {
-
/** @var IJobList */
private $jobList;
use OCP\Migration\IRepairStep;
class AddPreviewBackgroundCleanupJob implements IRepairStep {
-
/** @var IJobList */
private $jobList;
use OCP\Migration\IRepairStep;
class AddClenupLoginFlowV2BackgroundJob implements IRepairStep {
-
/** @var IJobList */
private $jobList;
* photo could be returned for this vcard. These invalid files are removed by this migration step.
*/
class CleanupCardDAVPhotoCache implements IRepairStep {
-
/** @var IConfig */
private $config;
use OCP\Migration\IRepairStep;
class ClearCollectionsAccessCache implements IRepairStep {
-
/** @var IConfig */
private $config;
use OCP\Migration\IRepairStep;
class ResetGeneratedAvatarFlag implements IRepairStep {
-
/** @var IConfig */
private $config;
/** @var IDBConnection */
use OCP\Migration\IRepairStep;
class EncryptionLegacyCipher implements IRepairStep {
-
/** @var IConfig */
private $config;
/** @var IManager */
use OCP\Migration\IRepairStep;
class EncryptionMigration implements IRepairStep {
-
/** @var IConfig */
private $config;
/** @var IManager */
use OCP\Migration\IRepairStep;
class ShippedDashboardEnable implements IRepairStep {
-
/** @var IConfig */
private $config;
use OCP\Migration\IRepairStep;
class AddCheckForUserCertificatesJob implements IRepairStep {
-
/** @var IJobList */
protected $jobList;
/** @var IConfig */
use OCP\Migration\IRepairStep;
class ValidatePhoneNumber implements IRepairStep {
-
/** @var IConfig */
protected $config;
/** @var IUserManager */
use OCP\Share\IShare;
class OldGroupMembershipShares implements IRepairStep {
-
/** @var \OCP\IDBConnection */
protected $connection;
use OCP\Migration\IRepairStep;
class CleanPreviews implements IRepairStep {
-
/** @var IJobList */
private $jobList;
use OCP\Migration\IRepairStep;
class DropAccountTermsTable implements IRepairStep {
-
/** @var IDBConnection */
protected $db;
use OCP\DB\QueryBuilder\IQueryBuilder;
class MigrateOauthTables implements IRepairStep {
-
/** @var Connection */
protected $db;
use OCP\Migration\IRepairStep;
class MoveAvatars implements IRepairStep {
-
/** @var IJobList */
private $jobList;
use function is_resource;
class MoveAvatarsBackgroundJob extends QueuedJob {
-
/** @var IUserManager */
private $userManager;
* @since 11.0.0
*/
class Validator implements IValidator {
-
/** @var Definitions */
protected $definitions;
* @deprecated 20.0.0
*/
class File extends PagedProvider {
-
/**
* Search for files and folders matching the given query
*
* @deprecated 20.0.0
*/
class Audio extends File {
-
/**
* Type name; translated in templates
* @var string
* @deprecated 20.0.0
*/
class File extends \OCP\Search\Result {
-
/**
* Type name; translated in templates
* @var string
* @deprecated 20.0.0
*/
class Folder extends File {
-
/**
* Type name; translated in templates
* @var string
* @deprecated 20.0.0
*/
class Image extends File {
-
/**
* Type name; translated in templates
* @var string
* @see IProvider::search() for the arguments of the individual search requests
*/
class SearchComposer {
-
/** @var IProvider[] */
private $providers = [];
use OCP\IDBConnection;
class CleanupJob extends TimedJob {
-
/** @var IDBConnection */
private $connection;
* TODO: hookup all manager classes
*/
class Server extends ServerContainer implements IServerContainer {
-
/** @var string */
private $webRoot;
use OCP\ISession;
abstract class Session implements \ArrayAccess, ISession {
-
/**
* @var bool
*/
* @method getClass(): string
*/
class AuthorizedGroup extends Entity implements \JsonSerializable {
-
/** @var string $group_id */
protected $groupId;
use Psr\Log\LoggerInterface;
class Manager implements IManager {
-
/** @var LoggerInterface */
private $log;
use Psr\Log\LoggerInterface;
abstract class AbstractDatabase {
-
/** @var IL10N */
protected $trans;
/** @var string */
use OCP\Share\IShare;
class Constants {
-
/**
* @deprecated 17.0.0 - use IShare::TYPE_USER instead
*/
namespace OC\Share;
class Helper extends \OC\Share\Constants {
-
/**
* get default expire settings defined by the admin
* @return array contains 'defaultExpireDateSet', 'enforceExpireDate', 'expireAfterDays'
if (rtrim($normalizedServer1, '/') === rtrim($normalizedServer2, '/')) {
// FIXME this should be a method in the user management instead
\OCP\Util::emitHook(
- '\OCA\Files_Sharing\API\Server2Server',
- 'preLoginNameUsedAsUserName',
- ['uid' => &$user1]
+ '\OCA\Files_Sharing\API\Server2Server',
+ 'preLoginNameUsedAsUserName',
+ ['uid' => &$user1]
);
\OCP\Util::emitHook(
- '\OCA\Files_Sharing\API\Server2Server',
- 'preLoginNameUsedAsUserName',
- ['uid' => &$user2]
+ '\OCA\Files_Sharing\API\Server2Server',
+ 'preLoginNameUsedAsUserName',
+ ['uid' => &$user2]
);
if ($user1 === $user2) {
* - post_shared
*/
class Share extends Constants {
-
/** CRUDS permissions (Create, Read, Update, Delete, Share) using a bitmask
* Construct permissions for share() and setPermissions with Or (|) e.g.
* Give user read and update permissions: PERMISSION_READ | PERMISSION_UPDATE
* @package OC\Share20
*/
class DefaultShareProvider implements IShareProvider {
-
// Special share type for user modified group shares
public const SHARE_TYPE_USERGROUP = 2;
->where($qb->expr()->eq('id', $qb->createNamedParameter($share->getId())))
->execute();
} elseif ($share->getShareType() === IShare::TYPE_GROUP) {
-
// Check if there is a usergroup share
$qb = $this->dbConn->getQueryBuilder();
$stmt = $qb->select('id')
public function getSharesInFolder($userId, Folder $node, $reshares, $shallow = true) {
$qb = $this->dbConn->getQueryBuilder();
$qb->select('s.*',
- 'f.fileid', 'f.path', 'f.permissions AS f_permissions', 'f.storage', 'f.path_hash',
- 'f.parent AS f_parent', 'f.name', 'f.mimetype', 'f.mimepart', 'f.size', 'f.mtime', 'f.storage_mtime',
- 'f.encrypted', 'f.unencrypted_size', 'f.etag', 'f.checksum')
+ 'f.fileid', 'f.path', 'f.permissions AS f_permissions', 'f.storage', 'f.path_hash',
+ 'f.parent AS f_parent', 'f.name', 'f.mimetype', 'f.mimepart', 'f.size', 'f.mtime', 'f.storage_mtime',
+ 'f.encrypted', 'f.unencrypted_size', 'f.etag', 'f.checksum')
->from('share', 's')
->andWhere($qb->expr()->orX(
$qb->expr()->eq('item_type', $qb->createNamedParameter('file')),
use Symfony\Component\EventDispatcher\GenericEvent;
class LegacyHooks {
-
/** @var EventDispatcherInterface */
private $eventDispatcher;
* This class is the communication hub for all sharing related operations.
*/
class Manager implements IManager {
-
/** @var IProviderFactory */
private $factory;
private LoggerInterface $logger;
* @param IShare $share
*/
protected function setLinkParent(IShare $share) {
-
// No sense in checking if the method is not there.
if (method_exists($share, 'setParent')) {
$storage = $share->getNode()->getStorage();
* @package OC\Share20
*/
class ProviderFactory implements IProviderFactory {
-
/** @var IServerContainer */
private $serverContainer;
/** @var DefaultShareProvider */
use OCP\Share\IShare;
class Share implements IShare {
-
/** @var string */
private $id;
/** @var string */
use OCP\Share\IAttributes;
class ShareAttributes implements IAttributes {
-
/** @var array */
private $attributes;
use OCP\Share\IShareHelper;
class ShareHelper implements IShareHelper {
-
/** @var IManager */
private $shareManager;
* @template-implements IEventListener<UserRemovedEvent>
*/
class UserRemovedListener implements IEventListener {
-
/** @var IManager */
protected $shareManager;
* be included in the streamed file
*/
public function __construct(IRequest $request, int $size, int $numberOfFiles) {
-
/**
* zip32 constraints for a basic (without compression, volumes nor
* encryption) zip file according to the Zip specification:
use OCP\IUserManager;
class SubAdmin extends PublicEmitter implements ISubAdmin {
-
/** @var IUserManager */
private $userManager;
use function array_shift;
class Registry implements IRegistry {
-
/** @var string[] */
private $lazyReporters = [];
* fixes cyclic DI: AllConfig needs AppConfig needs Database needs AllConfig
*/
class SystemConfig {
-
/** @var array */
protected $sensitiveValues = [
'instanceid' => true,
* @since 9.0.0
*/
class ManagerFactory implements ISystemTagManagerFactory {
-
/**
* Server container
*
use OCP\SystemTag\ISystemTag;
class SystemTag implements ISystemTag {
-
/**
* @var string
*/
use Psr\Log\LoggerInterface;
class JSCombiner {
-
/** @var IAppData */
protected $appData;
use Psr\Log\LoggerInterface;
class JSResourceLocator extends ResourceLocator {
-
/** @var JSCombiner */
protected $jsCombiner;
* @param string $appId application id
*/
public function __construct($renderAs, $appId = '') {
-
/** @var IConfig */
$this->config = \OC::$server->get(IConfig::class);
* - failure(string $message)
*/
class Updater extends BasicEmitter {
-
/** @var LoggerInterface */
private $log;
use OCP\Util;
class VersionCheck {
-
/** @var IClientService */
private $clientService;
$this->dispatcher->dispatchTyped(new BeforeUserDeletedEvent($this));
$result = $this->backend->deleteUser($this->uid);
if ($result) {
-
// FIXME: Feels like an hack - suggestions?
$groupManager = \OC::$server->getGroupManager();
use Psr\Log\LoggerInterface;
class Manager implements IManager {
-
/** @var IServerContainer */
private $container;
use OCP\AppFramework\Http;
class OC_API {
-
/**
* api actions
*/
*/
public function enable(string $appId,
array $groups = []) {
-
// Check if app is already downloaded
/** @var Installer $installer */
$installer = \OC::$server->query(Installer::class);
* TODO: write example
*/
public static function emit($signalClass, $signalName, $params = []) {
-
// Return false if no hook handlers are listening to this
// emitting class
if (!array_key_exists($signalClass, self::$registered)) {
* Class for basic image manipulation
*/
class OC_Image implements \OCP\IImage {
-
// Default memory limit for images to load (256 MBytes).
protected const DEFAULT_MEMORY_LIMIT = 256;
$this->logger->debug('OC_Image->loadFromFile, webp images not supported: ' . $imagePath, ['app' => 'core']);
}
break;
- /*
- case IMAGETYPE_TIFF_II: // (intel byte order)
- break;
- case IMAGETYPE_TIFF_MM: // (motorola byte order)
- break;
- case IMAGETYPE_JPC:
- break;
- case IMAGETYPE_JP2:
- break;
- case IMAGETYPE_JPX:
- break;
- case IMAGETYPE_JB2:
- break;
- case IMAGETYPE_SWC:
- break;
- case IMAGETYPE_IFF:
- break;
- case IMAGETYPE_ICO:
- break;
- case IMAGETYPE_SWF:
- break;
- case IMAGETYPE_PSD:
- break;
- */
+ /*
+ case IMAGETYPE_TIFF_II: // (intel byte order)
+ break;
+ case IMAGETYPE_TIFF_MM: // (motorola byte order)
+ break;
+ case IMAGETYPE_JPC:
+ break;
+ case IMAGETYPE_JP2:
+ break;
+ case IMAGETYPE_JPX:
+ break;
+ case IMAGETYPE_JB2:
+ break;
+ case IMAGETYPE_SWC:
+ break;
+ case IMAGETYPE_IFF:
+ break;
+ case IMAGETYPE_ICO:
+ break;
+ case IMAGETYPE_SWF:
+ break;
+ case IMAGETYPE_PSD:
+ break;
+ */
default:
// this is mostly file created from encrypted file
*
*/
class OC_JSON {
-
/**
* Check if the app is enabled, send json error msg if not
* @param string $app
* This class provides the templates for ownCloud.
*/
class OC_Template extends \OC\Template\Base {
-
/** @var string */
private $renderAs; // Create a full page?
*/
public static function initTemplateEngine($renderAs) {
if (self::$initTemplateEngineFirstRun) {
-
// apps that started before the template initialization can load their own scripts/styles
// so to make sure this scripts/styles here are loaded first we put all core scripts first
// check lib/public/Util.php
/** @var IEventDispatcher $dispatcher */
$dispatcher = \OC::$server->get(IEventDispatcher::class);
$dispatcher->dispatchTyped(new UserLoggedInEvent(
- \OC::$server->get(IUserManager::class)->get($uid),
- $uid,
- null,
- false)
+ \OC::$server->get(IUserManager::class)->get($uid),
+ $uid,
+ null,
+ false)
);
//trigger creation of user home and /files folder
'hint' => $l->t('This can usually be fixed by giving the web server write access to the config directory. See %s',
[ $urlGenerator->linkToDocs('admin-dir_permissions') ]) . '. '
. $l->t('Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it. See %s',
- [ $urlGenerator->linkToDocs('admin-config') ])
+ [ $urlGenerator->linkToDocs('admin-config') ])
];
}
}
// Check if we are a user
if (!\OC::$server->getUserSession()->isLoggedIn()) {
header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute(
- 'core.login.showLoginForm',
- [
- 'redirect_url' => \OC::$server->getRequest()->getRequestUri(),
- ]
- )
+ 'core.login.showLoginForm',
+ [
+ 'redirect_url' => \OC::$server->getRequest()->getRequestUri(),
+ ]
+ )
);
exit();
}
* @since 15.0.0
*/
interface IAccount extends \JsonSerializable {
-
/**
* Set a property with data
*
*
*/
interface IAccountManager {
-
/**
* Contact details visible locally only
*
* @since 15.0.0
*/
interface IAccountProperty extends \JsonSerializable {
-
/**
* Set the value of a property
*
* @since 22.0.0
*/
interface IAccountPropertyCollection extends JsonSerializable {
-
/**
* retuns the collection name
*
*
*/
class PropertyDoesNotExistException extends \Exception {
-
/**
* Constructor
* @param string $msg the error message
* @since 11.0
*/
interface IEventMerger {
-
/**
* Combines two events when possible to have grouping:
*
* @since 11.0.0
*/
interface IFilter {
-
/**
* @return string Lowercase a-z and underscore only identifier
* @since 11.0.0
* @since 11.0.0
*/
interface ISetting {
-
/**
* @return string Lowercase a-z and underscore only identifier
* @since 11.0.0
* @since 8.0.0
*/
interface IAppManager {
-
/**
* Returns the app information from "appinfo/info.xml".
*
* @since 6.0.0
*/
class App {
-
/** @var IAppContainer */
private $container;
* @since 14.0.0
*/
abstract class AuthPublicShareController extends PublicShareController {
-
/** @var IURLGenerator */
protected $urlGenerator;
* @since 20.0.0
*/
interface IBootContext {
-
/**
* Get hold of the app's container
*
* @since 20.0.0
*/
interface IBootstrap {
-
/**
* @param IRegistrationContext $context
*
* @see IBootstrap::register()
*/
interface IRegistrationContext {
-
/**
* @param string $capability
* @psalm-param class-string<ICapability> $capability
* @since 6.0.0
*/
abstract class Controller {
-
/**
* app name
* @var string
* @since 7.0.0
*/
class DoesNotExistException extends \Exception implements IMapperException {
-
/**
* Constructor
* @param string $msg the error message
* @since 7.0.0
*/
class MultipleObjectsReturnedException extends \Exception implements IMapperException {
-
/**
* Constructor
* @param string $msg the error message
* @template T of Entity
*/
abstract class QBMapper {
-
/** @var string */
protected $tableName;
* @since 24.0.0
*/
trait TTransactional {
-
/**
* Run an atomic database operation
*
* @since 8.1.0
*/
class DataDisplayResponse extends Response {
-
/**
* response data
* @var string
* @since 8.0.0
*/
class DataResponse extends Response {
-
/**
* response data
* @var array|int|float|string|bool|object
* @since 17.0.0
*/
class EmptyFeaturePolicy {
-
/** @var string[] of allowed domains to autoplay media */
protected $autoplayDomains = null;
* @since 11.0.0
*/
class FileDisplayResponse extends Response implements ICallbackResponse {
-
/** @var \OCP\Files\File|\OCP\Files\SimpleFS\ISimpleFile */
private $file;
* @since 8.1.0
*/
interface ICallbackResponse {
-
/**
* Outputs the content that should be printed
*
* @since 8.1.0
*/
interface IOutput {
-
/**
* @param string $out
* @since 8.1.0
* @since 6.0.0
*/
class JSONResponse extends Response {
-
/**
* response data
* @var array|object
* @since 8.1.0
*/
class NotFoundResponse extends TemplateResponse {
-
/**
* @since 8.1.0
*/
* @since 6.0.0
*/
class Response {
-
/**
* Headers - defaults to ['Cache-Control' => 'no-cache, no-store, must-revalidate']
* @var array
* @deprecated 17.0.0
*/
class StrictEvalContentSecurityPolicy extends ContentSecurityPolicy {
-
/**
* @since 14.0.0
*/
* @deprecated 17.0.0
*/
class StrictInlineContentSecurityPolicy extends ContentSecurityPolicy {
-
/**
* @since 14.0.0
*/
* @since 14.0.0
*/
class ExternalShareMenuAction extends SimpleMenuAction {
-
/** @var string */
private $owner;
* @since 14.0
*/
interface IMenuAction {
-
/**
* @since 14.0.0
* @return string
* @since 14.0.0
*/
class LinkMenuAction extends SimpleMenuAction {
-
/**
* LinkMenuAction constructor.
*
* @since 14.0.0
*/
class SimpleMenuAction implements IMenuAction {
-
/** @var string */
private $id;
* @since 19.0.0
*/
class TooManyRequestsResponse extends Response {
-
/**
* @since 19.0.0
*/
* @since 6.0.0
*/
interface IAppContainer extends ContainerInterface, IContainer {
-
/**
* used to return the appname of the set application
* @return string the name of your application
* @since 6.0.0
*/
abstract class Middleware {
-
-
/**
* This is being run in normal order before the controller is being
* called which allows several modifications and checks
$corsAllowedHeaders = 'Authorization, Content-Type, Accept, OCS-APIRequest',
$corsMaxAge = 1728000) {
parent::__construct($appName, $request, $corsMethods,
- $corsAllowedHeaders, $corsMaxAge);
+ $corsAllowedHeaders, $corsMaxAge);
$this->registerResponder('json', function ($data) {
return $this->buildOCSResponse('json', $data);
});
* @since 14.0.0
*/
abstract class PublicShareController extends Controller {
-
/** @var ISession */
protected $session;
* @since 20.0.0
*/
interface IInitialState {
-
/**
* Allows an app to provide its initial state to the template system.
* Use this if you know your initial state sill be used for example if
* @since 21.0.0
*/
abstract class InitialStateProvider implements \JsonSerializable {
-
/**
* @since 21.0.0
*/
* @see https://help.nextcloud.com/t/how-should-we-use-php8-attributes/104278
*/
interface IControllerMethodReflector {
-
/**
* @param object $object an object or classname
* @param string $method the method which we want to inspect
* @since 8.0.0
*/
interface ITimeFactory {
-
/**
* @return int the result of a call to time()
* @since 8.0.0
* @since 19.0.0
*/
class LoginFailedEvent extends Event {
-
/** @var string */
private $uid;
* @since 20.0.0
*/
interface IAlternativeLogin {
-
/**
* Label shown on the login option
* @return string
* @since 6.0.0
*/
interface IApacheBackend {
-
/**
* In case the user has been authenticated by a module true is returned.
*
* @since 23.0.0
*/
interface IProvideUserSecretBackend {
-
/**
* Optionally returns a stable per-user secret. This secret is for
* instance used to secure file encryption keys.
* @since 12
*/
interface ICredentials {
-
/**
* Get the user UID
*
* @since 12
*/
interface IStore {
-
/**
* Get login credentials of the currently logged in user
*
* @since 17.0.0
*/
interface IActivatableAtLogin extends IProvider {
-
/**
* @param IUser $user
*
* @since 15.0.0
*/
interface IActivatableByAdmin extends IProvider {
-
/**
* Enable this provider for the given user.
*
* @since 15.0.0
*/
interface IDeactivatableByAdmin extends IProvider {
-
/**
* Disable this provider for the given user.
*
* @since 17.0.0
*/
interface ILoginSetupProvider {
-
/**
* @return Template
*
* @since 15.0.0
*/
interface IPersonalProviderSettings {
-
/**
* @return Template
*
* @since 9.1.0
*/
interface IProvider {
-
/**
* @since 14.0.0
* @deprecated 22.0.0
* @since 13.0.0
*/
interface IProvidesCustomCSP {
-
/**
* @return ContentSecurityPolicy
*
* @since 15.0.0
*/
interface IProvidesIcons extends IProvider {
-
/**
* Get the path to the light (white) icon of this provider
*
* @since 15.0.0
*/
interface IProvidesPersonalSettings extends IProvider {
-
/**
* @param IUser $user
*
* @since 15.0.0
*/
class RegistryEvent extends Event {
-
/** @var IProvider */
private $provider;
* @since 20.0.0
*/
final class TwoFactorProviderDisabled extends Event {
-
/** @var string */
private $providerId;
* @since 15.0.0
*/
abstract class QueuedJob extends Job {
-
/**
* Run the job, then remove it from the joblist
*
* @since 18.0.0
*/
interface IBroadcastEvent {
-
/**
* @return string the name of the event
* @since 18.0.0
* @since 13.0.0
*/
interface ICalendar {
-
/**
* @return string defining the technical unique key
* @since 13.0.0
* @since 23.0.0
*/
interface ICalendarProvider {
-
/**
* @param string $principalUri URI of the principal
* @param string[] $calendarUris optionally specify which calendars to load, or all if this array is empty
* @since 23.0.0
*/
interface ICalendarQuery {
-
/**
* @since 24.0.0
*/
* @since 23.0.0
*/
interface ICreateFromString extends ICalendar {
-
/**
* @since 23.0.0
*
* @since 26.0.0
*/
interface IHandleImipMessage extends ICalendar {
-
/**
* Handle an iMIP VEvent for validation and processing
*
* @since 13.0.0
*/
interface IManager {
-
/**
* This function is used to search and find objects within the user's calendars.
* In case $pattern is empty all events/journals/todos will be returned.
* @since 17.0.0
*/
interface IMetadataProvider {
-
/**
* Get a list of all metadata keys available for this room
*
* @since 14.0.0
*/
interface IBackend {
-
/**
* get a list of all resources in this backend
*
* @deprecated 24.0.0
*/
interface IManager {
-
/**
* Registers a resource backend
*
* @since 14.0.0
*/
interface IResource {
-
/**
* get the resource id
*
* @since 17.0.0
*/
interface IResourceMetadata {
-
/**
* Type of resource
*
* @since 14.0.0
*/
interface IBackend {
-
/**
* get a list of all rooms in this backend
*
* @deprecated 24.0.0
*/
interface IManager {
-
/**
* Registers a room backend
*
* @since 14.0.0
*/
interface IRoom {
-
/**
* Get a unique ID for the room
*
* @since 17.0.0
*/
interface IRoomMetadata {
-
/**
* Type of room
*
* @since 8.2.0
*/
interface ICapability {
-
/**
* Function an app uses to return the capabilities
*
* @since 16.0.0
*/
class AutoCompleteEvent extends GenericEvent {
-
/**
* @param array $arguments
* @since 16.0.0
* @since 13.0.0
*/
interface ISorter {
-
/**
* @return string The ID of the sorter, e.g. commenters
* @since 13.0.0
* @since 25.0.0
*/
interface IReference extends JsonSerializable {
-
/**
* @since 25.0.0
*/
* @since 16.0.0
*/
interface ICollection {
-
/**
* @return int
* @since 16.0.0
* @since 16.0.0
*/
interface IManager extends IProvider {
-
/**
* @param int $id
* @return ICollection
* @since 16.0.0
*/
interface IProvider {
-
/**
* Get the resource type of the provider
*
* @since 18.0.0
*/
interface IProviderManager {
-
/**
* @return IProvider[] list of resource providers
* @since 18.0.0
* @since 16.0.0
*/
interface IResource {
-
/**
* @return string
* @since 16.0.0
* @since 9.0.0
*/
class CommentsEvent extends Event {
-
/**
* @deprecated 22.0.0
*/
* @since 11.0.0
*/
interface ICommentsEventHandler {
-
/**
* @param CommentsEvent $event
* @since 11.0.0
* @since 9.0.0
*/
interface ICommentsManager {
-
/**
* @const DELETED_USER type and id for a user that has been deleted
* @see deleteReferencesOfActor
* @since 9.0.0
*/
interface ICommentsManagerFactory {
-
/**
* Constructor for the comments manager factory
*
* @since 9.0.0
*/
class ConsoleEvent extends Event {
-
/**
* @deprecated 22.0.0
*/
* @since 12.0
*/
interface IAction extends JsonSerializable {
-
/**
* @param string $icon absolute URI to an icon
* @since 12.0
* @since 12.0
*/
interface IActionFactory {
-
/**
* Construct and return a new link action for the contacts menu
*
* @since 13.0.0
*/
interface IContactsStore {
-
-
/**
* @param IUser $user
* @param string|null $filter
* @since 12.0
*/
interface IEntry extends JsonSerializable {
-
/**
* @since 12.0
* @return string
* @since 12.0
*/
interface ILinkAction extends IAction {
-
/**
* @param string $href the target URL of the action
* @since 12.0
* @since 12.0
*/
interface IProvider {
-
/**
* @since 12.0
* @param IEntry $entry
* @since 19.0.0
*/
class ContactInteractedWithEvent extends Event {
-
/** @var IUser */
private $actor;
* @since 6.0.0
*/
interface IManager {
-
/**
* This function is used to search and find contacts within the users address books.
* In case $pattern is empty all contacts will be returned.
* @since 21.0.0
*/
class Exception extends BaseException {
-
/**
* Nextcloud lost connection to the database
*
* @since 21.0.0
*/
interface IPreparedStatement {
-
/**
* @return true
*
* @since 21.0.0
*/
interface IResult {
-
/**
* @return true
*
* @since 13.0.0
*/
interface ISchemaWrapper {
-
/**
* @param string $tableName
*
* @psalm-taint-specialize
*/
interface IQueryBuilder {
-
/**
* @since 9.0.0
*/
* @since 22.0.0
*/
interface IAPIWidget extends IWidget {
-
/**
* @return \OCP\Dashboard\Model\WidgetItem[] The widget items
* @since 22.0.0
* @since 26.0.0
*/
interface IConditionalWidget extends IWidget {
-
/**
* @return bool Whether the widget is enabled and should be registered
* @since 26.0.0
* @since 20.0.0
*/
interface IManager {
-
/**
* @param string $widgetClass
* @since 20.0.0
* @since 20.0.0
*/
interface IWidget {
-
/**
* @return string Unique id that identifies the widget, e.g. the app id
* @since 20.0.0
* @since 6.0.0
*/
class Defaults {
-
/**
* \OC_Defaults instance to retrieve the defaults
* @since 6.0.0
* @since 18.0.0
*/
abstract class ACreateEmpty {
-
/**
* Unique id for the creator to filter templates
*
* @since 18.0.0
*/
abstract class ACreateFromTemplate extends ACreateEmpty {
-
/**
* List of available templates for the create from template action
*
* @since 18.0.0
*/
abstract class ATemplate implements JsonSerializable {
-
/**
* Return a unique id so the app can identify the template
*
* @since 18.0.0
*/
interface IEditor {
-
/**
* Return a unique identifier for the editor
*
* @since 18.0.0
*/
interface IManager {
-
/**
* Register a new editor
*
* @since 18.0.0
*/
interface IToken {
-
/**
* Extend the token validity time
*
* @since 18.0.0
*/
class RegisterDirectEditorEvent extends Event {
-
/**
* @var IManager
*/
* @since 8.1.0
*/
class GenericEncryptionException extends HintException {
-
/**
* @param string $message
* @param string $hint
* @since 8.1.0
*/
interface IEncryptionModule {
-
/**
* @return string defining the technical unique id
* @since 8.1.0
* @since 8.1.0
*/
interface IFile {
-
/**
* get list of users with access to the file
*
* @since 8.1.0
*/
interface IManager {
-
/**
* Check if encryption is available (at least one encryption module needs to be enabled)
*
* @since 8.1.0
*/
interface IStorage {
-
/**
* get user specific key
*
* @since 18.0.0
*/
abstract class ABroadcastedEvent extends Event implements JsonSerializable {
-
/**
* @since 18.0.0
*/
* @since 17.0.0
*/
class Event implements StoppableEventInterface {
-
/**
* @var bool
*
* @since 17.0.0
*/
interface IEventDispatcher {
-
/**
* @template T of \OCP\EventDispatcher\Event
* @param string $eventName preferably the fully-qualified class name of the Event sub class
* @template T of Event
*/
interface IEventListener {
-
/**
* @param Event $event
* @psalm-param T $event
* @since 14.0.0
*/
class ActionNotSupportedException extends HintException {
-
/**
* ActionNotSupportedException constructor.
*
* @since 14.0.0
*/
class AuthenticationFailedException extends HintException {
-
/**
* BadRequestException constructor.
*
* @since 14.0.0
*/
class ProviderAlreadyExistsException extends HintException {
-
/**
* ProviderAlreadyExistsException constructor.
*
* @since 14.0.0
*/
class ProviderCouldNotAddShareException extends HintException {
-
/**
* ProviderCouldNotAddShareException constructor.
*
* @since 14.0.0
*/
class ProviderDoesNotExistsException extends HintException {
-
/**
* ProviderDoesNotExistsException constructor.
*
* @since 14.0.0
*/
interface ICloudFederationFactory {
-
/**
* get a CloudFederationShare Object to prepare a share you want to send
*
* @since 14.0.0
*/
interface ICloudFederationNotification {
-
/**
* add a message to the notification
*
*/
interface ICloudFederationProvider {
-
/**
* get the name of the share type, handled by this provider
*
*
*/
interface ICloudFederationProviderManager {
-
/**
* Registers an callback function which must return an cloud federation provider
*
* @since 14.0.0
*/
interface ICloudFederationShare {
-
/**
* set uid of the recipient
*
* @since 25.0.0
*/
interface IAppDataFactory {
-
/**
* Get the AppData folder for the specified $appId
* @param string $appId
* @since 18.0.0
*/
class BeforeFileScannedEvent extends Event {
-
/** @var string */
private $absolutePath;
* @since 18.0.0
*/
class BeforeFolderScannedEvent extends Event {
-
/** @var string */
private $absolutePath;
* @since 18.0.0
*/
class FileCacheUpdated extends Event {
-
/** @var IStorage */
private $storage;
* @since 18.0.0
*/
class FileScannedEvent extends Event {
-
/** @var string */
private $absolutePath;
* @since 18.0.0
*/
class FolderScannedEvent extends Event {
-
/** @var string */
private $absolutePath;
* @since 20.0.0
*/
abstract class AbstractNodeEvent extends Event {
-
/** @var Node */
private $node;
* @since 20.0.0
*/
abstract class AbstractNodesEvent extends Event {
-
/** @var Node */
private $source;
/** @var Node */
* @since 18.0.0
*/
class NodeAddedToCache extends Event {
-
/** @var IStorage */
private $storage;
* @since 18.0.0
*/
class NodeRemovedFromCache extends Event {
-
/** @var IStorage */
private $storage;
* @since 9.0.0
*/
class ForbiddenException extends \Exception {
-
/** @var bool */
private $retry;
* Interface to handle mimetypes (detection and icon retrieval)
**/
interface IMimeTypeDetector {
-
/**
* detect mimetype only based on filename, content of file is not used
* @param string $path
* Interface to load mimetypes
**/
interface IMimeTypeLoader {
-
/**
* Get a mimetype from its ID
*
* @since 8.0.0
*/
interface IRootFolder extends Folder, Emitter {
-
/**
* Returns a view to user's files folder
*
* @since 24.0.0
*/
interface ILock {
-
/**
* User owned manual lock
*
* @since 24.0.0
*/
interface ILockManager extends ILockProvider {
-
/**
* @throws PreConditionNotMetException if there is already a lock provider registered
* @since 24.0.0
* @since 24.0.0
*/
interface ILockProvider {
-
/**
* @throws PreConditionNotMetException
* @throws NoLockProviderException
* @since 8.2.0
*/
interface IMountManager {
-
/**
* Add a new mount
*
* @since 8.0.0
*/
interface IMountPoint {
-
/**
* get complete path to the mount point
*
* @since 7.0.0
*/
interface IObjectStore {
-
/**
* @return string the container or bucket name where objects are stored
* @since 7.0.0
* @since 11.0.0
*/
interface ISimpleFile {
-
/**
* Get the name
*
* @since 9.0.0
*/
class StorageAuthException extends StorageNotAvailableException {
-
/**
* StorageAuthException constructor.
*
* @since 9.0.0
*/
class StorageBadConfigException extends StorageNotAvailableException {
-
/**
* ExtStorageBadConfigException constructor.
*
* @since 9.0.0
*/
class StorageConnectionException extends StorageNotAvailableException {
-
/**
* StorageConnectionException constructor.
*
* @since 9.0.0
*/
class StorageTimeoutException extends StorageNotAvailableException {
-
/**
* StorageTimeoutException constructor.
*
* @since 21.0.0
*/
interface ITemplateManager {
-
/**
* Register a template type support
*
* @since 21.0.0
*/
final class Template implements \JsonSerializable {
-
/** @var string */
private $templateType;
/** @var string */
*
*/
abstract class AFilesDocument extends IndexDocument {
-
-
/**
* Returns the owner of the document/file.
*
*
*/
interface IFullTextSearchManager {
-
-
/**
* Register a IProviderService.
*
*
*/
interface IFullTextSearchPlatform {
-
-
/**
* Must returns a unique Id used to identify the Search Platform.
* Id must contains only alphanumeric chars, with no space.
*
*/
interface IFullTextSearchProvider {
-
-
/**
* Must returns a unique Id used to identify the Content Provider.
* Id must contains only alphanumeric chars, with no space.
*
*/
interface IDocumentAccess {
-
-
/**
* Owner of the document can be set at the init of the object.
*
*
*/
interface IIndexOptions {
-
-
/**
* Get the value (as a string) for an option.
*
*
*/
interface ISearchOption {
-
-
/**
* @since 16.0.0
*/
*
*/
interface ISearchRequest {
-
-
/**
* Get the maximum number of results to be returns by the Search Platform.
*
*
*/
interface ISearchResult {
-
-
/**
* Get the original SearchRequest.
*
*
*/
interface ISearchTemplate {
-
-
/**
* Set the class of the icon to be displayed in the left panel of the
* FullTextSearch navigation page, in front of the related Content Provider.
*
*/
interface IIndexService {
-
-
/**
* Create an Index
*
*
*/
interface IProviderService {
-
-
/**
* Check if the provider $providerId is already indexed.
*
*
*/
interface ISearchService {
-
-
/**
* generate a search request, based on an array:
*
* @since 12.0.1
*/
interface IConfig {
-
/**
* check if global scale is enabled
*
* @since 14.0.0
*/
abstract class ABackend implements GroupInterface {
-
/**
* @deprecated 14.0.0
*
* @since 14.0.0
*/
interface IAddToGroupBackend {
-
/**
* @since 14.0.0
*/
* @since 14.0.0
*/
interface ICountDisabledInGroup {
-
/**
* @since 14.0.0
*/
* @since 14.0.0
*/
interface ICountUsersBackend {
-
/**
* @since 14.0.0
*/
* @since 14.0.0
*/
interface ICreateGroupBackend {
-
/**
* @since 14.0.0
*/
* @since 14.0.0
*/
interface IDeleteGroupBackend {
-
/**
* @since 14.0.0
*/
* @since 17.0.0
*/
interface IGetDisplayNameBackend {
-
/**
* @param string $gid
* @return string
* @since 14.0.0
*/
interface IGroupDetailsBackend {
-
/**
* @since 14.0.0
*/
* @since 14.0.0
*/
interface IIsAdminBackend {
-
/**
* @since 14.0.0
*/
* @since 22.0.0
*/
interface INamedBackend {
-
/**
* Backend name to be shown in group management
* @return string the name of the backend to be shown
* @since 14.0.0
*/
interface IRemoveFromGroupBackend {
-
/**
* @since 14.0.0
*/
* @since 18.0.0
*/
interface ISetDisplayNameBackend {
-
/**
* @param string $gid
* @param string $displayName
* @since 18.0.0
*/
class BeforeGroupCreatedEvent extends Event {
-
/** @var string */
private $name;
* @since 18.0.0
*/
class BeforeGroupDeletedEvent extends Event {
-
/** @var IGroup */
private $group;
* @since 18.0.0
*/
class BeforeUserAddedEvent extends Event {
-
/** @var IGroup */
private $group;
* https://github.com/nextcloud/server/issues
*/
class BeforeUserRemovedEvent extends Event {
-
/** @var IGroup */
private $group;
* @since 18.0.0
*/
class GroupCreatedEvent extends Event {
-
/** @var IGroup */
private $group;
* @since 18.0.0
*/
class GroupDeletedEvent extends Event {
-
/** @var IGroup */
private $group;
* @since 21.0.0
*/
class SubAdminAddedEvent extends Event {
-
/** @var IGroup */
private $group;
* @since 21.0.0
*/
class SubAdminRemovedEvent extends Event {
-
/** @var IGroup */
private $group;
* @since 18.0.0
*/
class UserAddedEvent extends Event {
-
/** @var IGroup */
private $group;
* @since 18.0.0
*/
class UserRemovedEvent extends Event {
-
/** @var IGroup */
private $group;
* @since 16.0.0
*/
interface ISubAdmin {
-
/**
* add a SubAdmin
* @param IUser $user user to be SubAdmin
* @since 4.5.0
*/
interface GroupInterface {
-
/**
* actions that user backends can define
*/
* @since 8.1.0
*/
interface IClient {
-
/**
* Sends a GET request
* @param string $uri
* @since 21.0.0
*/
final class GenericResponse implements IResponse {
-
/** @var Response */
private $response;
* @since 21.0.0
*/
interface IHandler {
-
/**
* @param string $service the name of the well known service, e.g. 'webfinger'
* @param IRequestContext $context
* @since 21.0.0
*/
interface IRequestContext {
-
/**
* @return IRequest
*
* @since 21.0.0
*/
interface IResponse {
-
/**
* @since 21.0.0
*/
* @since 21.0.0
*/
final class JrdResponse implements IResponse {
-
/** @var string */
private $subject;
* @since 5.0.0
*/
interface IAddressBook {
-
/**
* @return string defining the technical unique key
* @since 5.0.0
* @since 6.0.0
*/
interface IAvatar {
-
/**
* Get the users avatar
*
*/
interface IAvatarManager {
-
/**
* Return a user specific instance of \OCP\IAvatar
* @see IAvatar
* @since 6.0.0
*/
interface ICache {
-
/**
* Get a value from the user cache
* @param string $key
* @deprecated 20.0.0 use \Psr\Container\ContainerInterface
*/
interface IContainer extends ContainerInterface {
-
/**
* @template T
*
* @since 6.0.0
*/
interface INavigationManager {
-
/**
* Navigation entries of the app navigation
* @since 16.0.0
* @since 6.0.0
*/
interface IPreview {
-
/**
* @since 9.2.0
* @deprecated 22.0.0
* @deprecated 20.0.0
*/
interface ISearch {
-
/**
* Search all providers for $query
* @param string $query
* @since 6.0.0
*/
interface IServerContainer extends ContainerInterface, IContainer {
-
/**
* The calendar manager will act as a broker between consumers for calendar information and
* providers which actual deliver the calendar information.
* @since 6.0.0
*/
interface ISession {
-
/**
* Set a value in the session
*
* @since 6.0.0
*/
interface ITagManager {
-
/**
* Create a new \OCP\ITags instance and load tags from db for the current user.
*
* @since 6.0.0
*/
interface IURLGenerator {
-
/**
* Regex for matching http(s) urls
*
* @since 8.0.0
*/
interface IUser {
-
/**
* get the user id
*
* @since 8.0.0
*/
interface IUserBackend {
-
/**
* Backend name to be shown in user management
* @return string the name of the backend to be shown
* @since 8.0.0
*/
interface IUserManager {
-
/**
* @since 26.0.0
*/
* @since 14.0.0
*/
interface ILanguageIterator extends \Iterator {
-
/**
* Return the current element
*
* @since 11.0.0
*/
interface ILDAPProviderFactory {
-
/**
* Constructor for the LDAP provider factory
*
* @since 8.1.0
*/
class LockedException extends \Exception {
-
/**
* Locked path
*
* @since 18.0.0
*/
class ManuallyLockedException extends LockedException {
-
-
/**
* owner of the lock
*
* @since 22.0.0
*/
class CriticalActionPerformedEvent extends Event {
-
/** @var string */
private $logMessage;
* @since 18.0.1
*/
interface IDataLogger {
-
/**
* allows to log custom data, similar to how logException works
*
* @since 14.0.0
*/
trait RotationTrait {
-
/**
* @var string
* @since 14.0.0
* @since 19.0.0
*/
class BeforeMessageSent extends Event {
-
/** @var IMessage */
private $message;
* @since 26.0.0
*/
final class AutoSubmitted {
-
/**
* Name of the Header as used in the final message later
*
* @since 13.0.0
*/
interface IAttachment {
-
/**
* @param string $filename
* @return IAttachment
* @since 12.0.0
*/
interface IEMailTemplate {
-
/**
* Sets the subject of the email
*
* @since 13.0.0
*/
interface IMessage {
-
/**
* @param IAttachment $attachment
* @return IMessage
* @since 13.0.0
*/
abstract class BigIntMigration extends SimpleMigrationStep {
-
/**
* @return array Returns an array with the following structure
* ['table1' => ['column1', 'column2'], ...]
* @since 9.1.0
*/
interface IOutput {
-
/**
* @param string $message
* @return void
* @since 9.1.0
*/
interface IRepairStep {
-
/**
* Returns the step's name
*
* @since 17.0.0
*/
class AlreadyProcessedException extends \RuntimeException {
-
/**
* @since 17.0.0
*/
* @since 9.0.0
*/
interface IAction {
-
/**
* @since 17.0.0
*/
* @since 18.0.0
*/
interface IDismissableNotifier extends INotifier {
-
/**
* @param INotification $notification
* @throws \InvalidArgumentException In case the handler can't handle the notification
* @since 9.0.0
*/
interface INotifier {
-
/**
* Identifier of the notifier, only use [a-z0-9_]
*
* @since 12.0.0
*/
interface IDiscoveryService {
-
/**
* Discover OCS end-points
*
* @since 23.0.0
*/
interface ILinkAction {
-
/**
* Preload the user specific value required by the action
*
* @since 23.0.0
*/
class ParameterDoesNotExistException extends \Exception {
-
/**
* @since 23.0.0
*/
* @since 11.0.0
*/
interface IValidator {
-
/**
* @param string $subject
* @param array[] $parameters
* @deprecated 9.0.0
*/
interface IRouter {
-
/**
* Create a \OCP\Route\IRoute.
*
* @since 8.2.0
*/
class SabrePluginEvent extends Event {
-
/** @var int */
protected $statusCode;
* @since 8.2.0
*/
class SabrePluginException extends Exception {
-
/**
* Returns the HTTP statuscode for this exception
*
* @since 20.0.0
*/
interface IProvider {
-
/**
* Get the unique ID of this search provider
*
* @since 20.0.0
*/
interface ISearchQuery {
-
/**
* @since 20.0.0
*/
* @deprecated 20.0.0
*/
abstract class PagedProvider extends Provider {
-
/**
* show all results
* @since 8.0.0
* @deprecated 20.0.0
*/
abstract class Provider {
-
/**
* @since 8.0.0
* @deprecated 20.0.0
* @deprecated 20.0.0
*/
class Result {
-
/**
* A unique identifier for the result, usually given as the item ID in its
* corresponding application.
* @since 20.0.0
*/
final class SearchResult implements JsonSerializable {
-
/** @var string */
private $name;
* @since 20.0.0
*/
class SearchResultEntry implements JsonSerializable {
-
/**
* @var string
* @since 20.0.0
* @since 17.0.0
*/
class AddContentSecurityPolicyEvent extends Event {
-
/** @var ContentSecurityPolicyManager */
private $policyManager;
* @since 18.0.0
*/
class GenerateSecurePasswordEvent extends Event {
-
/** @var null|string */
private $password;
* @since 18.0.0
*/
class ValidatePasswordPolicyEvent extends Event {
-
/** @var string */
private $password;
* @since 17.0.0
*/
class AddFeaturePolicyEvent extends Event {
-
/** @var FeaturePolicyManager */
private $policyManager;
* @since 8.2.0
*/
interface ICredentialsManager {
-
/**
* Store a set of credentials
*
* @since 8.0.0
*/
interface ICrypto {
-
/**
* @param string $message The message to authenticate
* @param string $password Password to use (defaults to `secret` in config.php)
* @since 26.0.0
*/
interface IRemoteHostValidator {
-
/**
* Validate if a host may be connected to
*
* @since 8.0.0
*/
interface ISecureRandom {
-
/**
* Flags for characters that can be used for <code>generate($length, $characters)</code>
*/
* @since 23.0.0
*/
interface IVerificationToken {
-
/**
* Checks whether the a provided tokent matches a stored token and its
* constraints. An InvalidTokenException is thrown on issues, otherwise
/** @since 23.0.0 */
class InvalidTokenException extends \Exception {
-
/**
* @since 23.0.0
*/
* @since 9.1
*/
interface ISettings {
-
/**
* @return TemplateResponse returns the instance with all parameters set, ready to be rendered
* @since 9.1
* @deprecated 17.0.0
*/
class Share extends \OC\Share\Constants {
-
/**
* Get the item of item type shared with a given user by source
* @param string $itemType
*/
public static function getItemsShared($itemType, $format = self::FORMAT_NONE, $parameters = null,
$limit = -1, $includeCollections = false) {
-
// only used by AppVNCSafe app (https://github.com/vnc-biz/nextcloud-appvncsafe/issues/2) - only here to not break apps syntax
}
* @since 18.0.0
*/
class ShareCreatedEvent extends Event {
-
/** @var IShare */
private $share;
* @since 21.0.0
*/
class ShareDeletedEvent extends Event {
-
/** @var IShare */
private $share;
* @since 19.0.0
*/
class VerifyMountPointEvent extends Event {
-
/** @var IShare */
private $share;
/** @var View */
* @since 9.0.0
*/
class GenericShareException extends HintException {
-
/**
* @param string $message
* @param string $hint
* @since 9.0.0
*/
class ShareNotFound extends GenericShareException {
-
/**
* @param string $message
* @param string $hint
* @since 25.0.0
*/
interface IAttributes {
-
/**
* Sets an attribute enabled/disabled. If the key did not exist before it will be created.
*
* @since 9.0.0
*/
interface IManager {
-
/**
* Create a Share
*
* @since 9.0.0
*/
interface IProviderFactory {
-
/**
* @param string $id
* @return IShareProvider
* @since 9.0.0
*/
interface IShare {
-
/**
* @since 17.0.0
*/
* @since 12
*/
interface IShareHelper {
-
/**
* @param Node $node
* @return array [ users => [Mapping $uid => $pathForUser], remotes => [Mapping $cloudId => $pathToMountRoot]]
* @since 9.0.0
*/
interface IShareProvider {
-
/**
* Return the identifier of this provider.
*
* @since 5.0.0
*/
interface Share_Backend {
-
/**
* Check if this $itemSource exist for the user
* @param string $itemSource
* @since 15.0.0
*/
interface ICollectBreadcrumbs extends IReporter {
-
/**
* Collect breadcrumbs for crash reports
*
* @since 17.0.0
*/
interface IMessageReporter extends IReporter {
-
/**
* Report a (error) message
*
* @deprecated used internally only
*/
interface IRegistry {
-
/**
* Register a reporter instance
*
* @since 13.0.0
*/
interface IReporter {
-
/**
* Report an (unhandled) exception
*
* @since 17.0.0
*/
interface IRegistry {
-
/**
* Register a subscription instance. In case it is called multiple times an
* exception is thrown
* @since 17.0.0
*/
interface ISubscription {
-
/**
* Indicates if a valid subscription is available
*
* @since 17.0.0
*/
interface ISupportedApps extends ISubscription {
-
/**
* Fetches the list of app IDs that are supported by the subscription
*
* @since 9.0.0
*/
interface ISystemTagManager {
-
/**
* Returns the tag objects matching the given tag ids.
*
* @since 9.0.0
*/
interface ISystemTagManagerFactory {
-
/**
* Constructor for the system tag manager factory
*
* @since 9.0.0
*/
interface ISystemTagObjectMapper {
-
/**
* Get a list of tag ids for the given object ids.
*
* @since 9.0.0
*/
class ManagerEvent extends Event {
-
/**
* @deprecated 22.0.0
*/
* @since 9.0.0
*/
class MapperEvent extends Event {
-
/**
* @deprecated 22.0.0
*/
* @since 9.1.0
*/
class SystemTagsEntityEvent extends Event {
-
/**
* @deprecated 22.0.0
*/
* @since 9.0.0
*/
class TagNotFoundException extends \RuntimeException {
-
/** @var string[] */
protected $tags;
* @since 24.0.0
*/
interface IBroker {
-
/**
* Check if the Talk backend is available
*
* @since 24.0.0
*/
interface IConversation {
-
/**
* Get the unique token that identifies this conversation
*
* @since 24.0.0
*/
interface IConversationOptions {
-
/**
* Will the conversation be public?
*
* @since 24.0.0
*/
interface ITalkBackend {
-
/**
* @param string $name
* @param IUser[] $moderators
* @since 14.0.0
*/
abstract class ABackend implements IUserBackend, UserInterface {
-
/**
* @deprecated 14.0.0
*
* @since 14.0.0
*/
interface ICreateUserBackend {
-
/**
* @since 14.0.0
*
* @since 14.0.0
*/
interface IGetDisplayNameBackend {
-
/**
* @since 14.0.0
*
* @since 14.0.0
*/
interface IGetHomeBackend {
-
/**
* @since 14.0.0
*
* @since 17.0.0
*/
interface IGetRealUIDBackend {
-
/**
* Some backends accept different UIDs than what is the internal UID to be used.
* For example the database backend accepts different cased UIDs in all the functions
* @since 15.0.0
*/
interface IPasswordConfirmationBackend {
-
/**
* @since 15.0.0
*/
* @since 14.0.0
*/
interface IProvideAvatarBackend {
-
/**
* @since 14.0.0
*
* @since 21.0.1
*/
interface ISearchKnownUsersBackend {
-
/**
* @param string $searcher
* @param string $pattern
* @since 14.0.0
*/
interface ISetDisplayNameBackend {
-
/**
* @since 14.0.0
*
* @since 14.0.0
*/
interface ISetPasswordBackend {
-
/**
* @since 14.0.0
*
* @since 18.0.0
*/
class BeforePasswordUpdatedEvent extends Event {
-
/** @var IUser */
private $user;
* @since 18.0.0
*/
class BeforeUserCreatedEvent extends Event {
-
/** @var string */
private $uid;
* @since 18.0.0
*/
class BeforeUserDeletedEvent extends Event {
-
/** @var IUser */
private $user;
* @since 18.0.0
*/
class BeforeUserLoggedInEvent extends Event {
-
/** @var string */
private $username;
* @since 18.0.0
*/
class BeforeUserLoggedInWithCookieEvent extends Event {
-
/** @var string */
private $username;
* @since 18.0.0
*/
class BeforeUserLoggedOutEvent extends Event {
-
/** @var IUser|null */
private $user;
* @since 18.0.0
*/
class PasswordUpdatedEvent extends Event {
-
/** @var IUser */
private $user;
* @since 18.0.0
*/
class PostLoginEvent extends Event {
-
/** @var IUser */
private $user;
* @since 18.0.0
*/
class UserCreatedEvent extends Event {
-
/** @var IUser */
private $user;
* @since 18.0.0
*/
class UserDeletedEvent extends Event {
-
/** @var IUser */
private $user;
* @since 20.0.0
*/
class UserLiveStatusEvent extends Event {
-
/**
* @var string
* @since 20.0.0
* @since 18.0.0
*/
class UserLoggedInEvent extends Event {
-
/** @var IUser */
private $user;
* @since 18.0.0
*/
class UserLoggedInWithCookieEvent extends Event {
-
/** @var IUser */
private $user;
* @since 18.0.0
*/
class UserLoggedOutEvent extends Event {
-
/** @var IUser|null */
private $user;
* @since 4.5.0
*/
interface UserInterface {
-
/**
* Check if backend implements actions
* @param int $actions bitwise-or'ed actions
* @since 24.0.0
*/
interface IExportDestination {
-
/**
* Adds a file to the export
*
* @since 24.0.0
*/
interface IMigrator {
-
/**
* Export user data
*
* @since 20.0.0
*/
interface IManager {
-
/**
* Gets the statuses for all users in $users
*
* @since 20.0.0
*/
interface IProvider {
-
/**
* Gets the statuses for all users in $users
*
* @since 20.0.0
*/
interface IUserStatus {
-
/**
* @var string
* @since 20.0.0
* @since 20.0.0
*/
interface IContextPortation {
-
/**
* All relevant context identifiers that are needed to restore the state
* of an entity shall be returned with this method. The resulting array
* @since 18.0.0
*/
interface IDisplayText {
-
/**
* returns translated text used for display to the end user. For instance,
* it can describe the event in a human readable way.
* @since 18.0.0
*/
class RegisterChecksEvent extends Event {
-
/** @var IManager */
private $manager;
* @since 18.0.0
*/
class RegisterEntitiesEvent extends Event {
-
/** @var IManager */
private $manager;
* @since 18.0.0
*/
class RegisterOperationsEvent extends Event {
-
/** @var IManager */
private $manager;
* @since 18.0.0
*/
class GenericEntityEvent implements IEntityEvent {
-
/** @var string */
private $displayName;
/** @var string */
* @since 18.0.0
*/
interface IComplexOperation extends IOperation {
-
/**
* As IComplexOperation chooses the triggering events itself, a hint has
* to be shown to the user so make clear when this operation is becoming
* @since 18.0.0
*/
interface IEntity {
-
/**
* returns a translated name to be presented in the web interface.
*
* @since 18.0.0
*/
interface ISpecificOperation extends IOperation {
-
/**
* returns the id of the entity the operator is designed for
*
* @group DB
*/
class AppsDisableTest extends TestCase {
-
/** @var CommandTester */
private $commandTester;
* @group DB
*/
class AppsEnableTest extends TestCase {
-
/** @var CommandTester */
private $commandTester;
use Test\TestCase;
class ChangeKeyStorageRootTest extends TestCase {
-
/** @var ChangeKeyStorageRoot */
protected $changeKeyStorageRoot;
}
public function testMoveAllKeys() {
-
/** @var \OC\Core\Command\Encryption\ChangeKeyStorageRoot $changeKeyStorageRoot */
$changeKeyStorageRoot = $this->getMockBuilder('OC\Core\Command\Encryption\ChangeKeyStorageRoot')
->setConstructorArgs(
use Test\TestCase;
class DecryptAllTest extends TestCase {
-
/** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\IConfig */
protected $config;
}
public function testMaintenanceAndTrashbin() {
-
// on construct we enable single-user-mode and disable the trash bin
$this->config->expects($this->at(1))
->method('setSystemValue')
use Test\TestCase;
class EncryptAllTest extends TestCase {
-
/** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\IConfig */
protected $config;
use Test\TestCase;
class AddTest extends TestCase {
-
/** @var IGroupManager|\PHPUnit\Framework\MockObject\MockObject */
private $groupManager;
use Test\TestCase;
class AddUserTest extends TestCase {
-
/** @var IGroupManager|\PHPUnit\Framework\MockObject\MockObject */
private $groupManager;
use Test\TestCase;
class DeleteTest extends TestCase {
-
/** @var IGroupManager|\PHPUnit\Framework\MockObject\MockObject */
private $groupManager;
use Test\TestCase;
class InfoTest extends TestCase {
-
/** @var IGroupManager|\PHPUnit\Framework\MockObject\MockObject */
private $groupManager;
use Test\TestCase;
class ListCommandTest extends TestCase {
-
/** @var IGroupManager|\PHPUnit\Framework\MockObject\MockObject */
private $groupManager;
use Test\TestCase;
class RemoveUserTest extends TestCase {
-
/** @var IGroupManager|\PHPUnit\Framework\MockObject\MockObject */
private $groupManager;
use Test\TestCase;
class AddTest extends TestCase {
-
/** @var ISystemTagManager|\PHPUnit\Framework\MockObject\MockObject */
private $systemTagManager;
use Test\TestCase;
class DeleteTest extends TestCase {
-
/** @var ISystemTagManager|\PHPUnit\Framework\MockObject\MockObject */
private $systemTagManager;
use Test\TestCase;
class EditTest extends TestCase {
-
/** @var ISystemTagManager|\PHPUnit\Framework\MockObject\MockObject */
private $systemTagManager;
use Test\TestCase;
class ListCommandTest extends TestCase {
-
/** @var ISystemTagManager|\PHPUnit\Framework\MockObject\MockObject */
private $systemTagManager;
use Test\TestCase;
class CleanupTest extends TestCase {
-
/** @var IRegistry|MockObject */
private $registry;
use Test\TestCase;
class DisableTest extends TestCase {
-
/** @var ProviderManager|MockObject */
private $providerManager;
use Test\TestCase;
class EnableTest extends TestCase {
-
/** @var ProviderManager|MockObject */
private $providerManager;
use Test\TestCase;
class EnforceTest extends TestCase {
-
/** @var MandatoryTwoFactor|MockObject */
private $mandatoryTwoFactor;
use Test\TestCase;
class StateTest extends TestCase {
-
/** @var IRegistry|MockObject */
private $registry;
use Test\TestCase;
class AppPasswordControllerTest extends TestCase {
-
/** @var ISession|MockObject */
private $session;
use Test\TestCase;
class CSRFTokenControllerTest extends TestCase {
-
/** @var CSRFTokenController */
private $controller;
use Test\TestCase;
class ClientFlowLoginV2ControllerTest extends TestCase {
-
/** @var IRequest|MockObject */
private $request;
/** @var LoginFlowV2Service|MockObject */
use Test\TestCase;
class ContactsMenuControllerTest extends TestCase {
-
/** @var IUserSession|MockObject */
private $userSession;
use Test\TestCase;
class CssControllerTest extends TestCase {
-
/** @var IAppData|\PHPUnit\Framework\MockObject\MockObject */
private $appData;
* This class provides tests for the guest avatar controller.
*/
class GuestAvatarControllerTest extends \Test\TestCase {
-
/**
* @var GuestAvatarController
*/
use Test\TestCase;
class JsControllerTest extends TestCase {
-
/** @var IAppData|\PHPUnit\Framework\MockObject\MockObject */
private $appData;
use Test\TestCase;
class LoginControllerTest extends TestCase {
-
/** @var LoginController */
private $loginController;
use Test\TestCase;
class NavigationControllerTest extends TestCase {
-
/** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */
private $request;
use OCP\IRequest;
class PreviewControllerTest extends \Test\TestCase {
-
/** @var IRootFolder|\PHPUnit\Framework\MockObject\MockObject */
private $rootFolder;
use Test\TestCase;
class TwoFactorChallengeControllerTest extends TestCase {
-
/** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */
private $request;
use Test\TestCase;
class UserControllerTest extends TestCase {
-
/** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
private $userManager;
use Test\TestCase;
class WellKnownControllerTest extends TestCase {
-
/** @var IRequest|MockObject */
private $request;
use Test\TestCase;
class WipeControllerTest extends TestCase {
-
/** @var RemoteWipe|MockObject */
private $remoteWipe;
use Test\TestCase;
class TwoFactorMiddlewareTest extends TestCase {
-
/** @var Manager|MockObject */
private $twoFactorManager;
use Test\TestCase;
class CleanPreviewsTest extends TestCase {
-
-
/** @var IJobList|\PHPUnit_Framework_MockObject_MockObject */
private $jobList;
*/
public function iSeeThatTheSectionIsShown($section) {
if (!WaitFor::elementToBeEventuallyShown(
- $this->actor,
- self::appNavigationSectionItemFor($section),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::appNavigationSectionItemFor($section),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The section $section in the app navigation is not shown yet after $timeout seconds");
}
}
*/
public function iSeeThatTheSectionIsNotShown($section) {
if (!WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::appNavigationSectionItemFor($section),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::appNavigationSectionItemFor($section),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The section $section in the app navigation is still shown after $timeout seconds");
}
}
*/
public function iSeeThatTheSectionDoesNotHaveACount($section) {
if (!WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::counterForTheSection($section),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::counterForTheSection($section),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The counter for section $section is still shown after $timeout seconds");
}
}
*/
public function iSeeThatTheSettingsAreOpened() {
if (!WaitFor::elementToBeEventuallyShown(
- $this->actor,
- self::appSettingsContent(),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::appSettingsContent(),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The app settings are not open yet after $timeout seconds");
}
}
*/
public function iSeeThatThereSomeAppsListedFromTheAppStore() {
if (!WaitFor::elementToBeEventuallyShown(
- $this->actor,
- self::appEntries(),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::appEntries(),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The apps from the app store were not shown yet after $timeout seconds");
}
}
*/
public function iSeeThatThereAreNoComments() {
if (!WaitFor::elementToBeEventuallyShown(
- $this->actor,
- self::emptyContent(),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::emptyContent(),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The no comments message is not visible yet after $timeout seconds");
}
}
*/
public function iSeeACommentWithAsMessage($commentText) {
Assert::assertTrue(
- $this->actor->find(self::commentWithText($commentText), 10)->isVisible());
+ $this->actor->find(self::commentWithText($commentText), 10)->isVisible());
}
/**
public function iSeeThatThereIsNoCommentWithAsMessage($commentText) {
try {
Assert::assertFalse(
- $this->actor->find(self::commentWithText($commentText))->isVisible());
+ $this->actor->find(self::commentWithText($commentText))->isVisible());
} catch (NoSuchElementException $exception) {
}
}
*/
public function iSeeThatTheContactsMenuIsShown() {
Assert::assertTrue(
- $this->actor->find(self::contactsMenu(), 10)->isVisible());
+ $this->actor->find(self::contactsMenu(), 10)->isVisible());
}
/**
*/
public function iSeeThatTheContactsMenuSearchInputIsShown() {
Assert::assertTrue(
- $this->actor->find(self::contactsMenuSearchInput(), 10)->isVisible());
+ $this->actor->find(self::contactsMenuSearchInput(), 10)->isVisible());
}
/**
*/
public function iSeeThatTheNoResultsMessageInTheContactsMenuIsShown() {
Assert::assertTrue(
- $this->actor->find(self::noResultsMessage(), 10)->isVisible());
+ $this->actor->find(self::noResultsMessage(), 10)->isVisible());
}
/**
*/
public function iSeeThatTheContactInTheContactsMenuIsShown($contactName) {
Assert::assertTrue(
- $this->actor->find(self::menuItemFor($contactName), 10)->isVisible());
+ $this->actor->find(self::menuItemFor($contactName), 10)->isVisible());
}
/**
try {
Assert::assertFalse(
- $this->actor->find(self::menuItemFor($contactName))->isVisible());
+ $this->actor->find(self::menuItemFor($contactName))->isVisible());
} catch (NoSuchElementException $exception) {
}
}
$this->iSeeThatThecontactsMenuIsShown();
if (!WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::menuItemFor($contactName),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::menuItemFor($contactName),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The $contactName contact in Contacts menu is still shown after $timeout seconds");
}
}
*/
public function iSeeThatTheConfirmationDialogIsShown() {
if (!WaitFor::elementToBeEventuallyShown(
- $this->actor,
- self::theDialog(),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::theDialog(),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The confirmation dialog was not shown yet after $timeout seconds");
}
}
*/
public function iSeeThatTheConfirmationDialogIsNotShown() {
if (!WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::theDialog(),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::theDialog(),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The confirmation dialog is still shown after $timeout seconds");
}
}
* "setFileListAncestorForActor" when needed.
*/
trait FileListAncestorSetter {
-
/**
* @var FileListContext
*/
use PHPUnit\Framework\Assert;
class FileListContext implements Context, ActorAwareInterface {
-
/**
* @var Actor
*/
*/
public function iSeeThatTheFileListIsEventuallyLoaded() {
if (!WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::mainWorkingIcon($this->fileListAncestor),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::mainWorkingIcon($this->fileListAncestor),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The main working icon for the file list is still shown after $timeout seconds");
}
}
*/
public function iSeeThatTheFileListDoesNotContainAFileNamed($fileName) {
if (!WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::rowForFile($this->fileListAncestor, $fileName),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::rowForFile($this->fileListAncestor, $fileName),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The file list still contains a file named $fileName after $timeout seconds");
}
}
*/
public function iSeeThatTheCurrentPageIsTheFilesApp() {
Assert::assertStringStartsWith(
- $this->actor->locatePath("/apps/files/"),
- $this->actor->getSession()->getCurrentUrl());
+ $this->actor->locatePath("/apps/files/"),
+ $this->actor->getSession()->getCurrentUrl());
$this->setFileListAncestorForActor(self::currentSectionMainView(), $this->actor);
}
// waited for it to be visible instead of relying on the implicit wait
// made to find the element.
if (!WaitFor::elementToBeEventuallyShown(
- $this->actor,
- self::detailsView(),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::detailsView(),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The details view is not open yet after $timeout seconds");
}
}
*/
public function iSeeThatTheDetailsViewIsClosed() {
if (!WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::detailsView(),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::detailsView(),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The details view is not closed yet after $timeout seconds");
}
}
*/
public function iSeeThatTheFileNameShownInTheDetailsViewIs($fileName) {
Assert::assertEquals(
- $this->actor->find(self::fileNameInDetailsView(), 10)->getText(), $fileName);
+ $this->actor->find(self::fileNameInDetailsView(), 10)->getText(), $fileName);
}
/**
*/
public function iSeeThatTheFileIsMarkedAsFavoriteInTheDetailsView() {
Assert::assertNotNull(
- $this->actor->find(self::favoritedStateIconInFileDetailsInDetailsView(), 10));
+ $this->actor->find(self::favoritedStateIconInFileDetailsInDetailsView(), 10));
}
/**
*/
public function iSeeThatTheFileIsNotMarkedAsFavoriteInTheDetailsView() {
Assert::assertNotNull(
- $this->actor->find(self::notFavoritedStateIconInFileDetailsInDetailsView(), 10));
+ $this->actor->find(self::notFavoritedStateIconInFileDetailsInDetailsView(), 10));
}
/**
*/
public function iSeeThatTheInputFieldForTagsInTheDetailsViewIsShown() {
Assert::assertTrue(
- $this->actor->find(self::inputFieldForTagsInDetailsView(), 10)->isVisible());
+ $this->actor->find(self::inputFieldForTagsInDetailsView(), 10)->isVisible());
}
/**
*/
public function iSeeThatTheInputFieldForTagsInTheDetailsViewContainsTheTag($tag) {
Assert::assertTrue(
- $this->actor->find(self::itemInInputFieldForTagsInDetailsViewForTag($tag), 10)->isVisible());
+ $this->actor->find(self::itemInInputFieldForTagsInDetailsViewForTag($tag), 10)->isVisible());
}
/**
try {
Assert::assertFalse(
- $this->actor->find(self::itemInInputFieldForTagsInDetailsViewForTag($tag))->isVisible());
+ $this->actor->find(self::itemInInputFieldForTagsInDetailsViewForTag($tag))->isVisible());
} catch (NoSuchElementException $exception) {
}
}
*/
public function iSeeThatTheTagInTheDropdownForTagsInTheDetailsViewIsChecked($tag) {
Assert::assertTrue(
- $this->actor->find(self::checkmarkInItemInDropdownForTag($tag), 10)->isVisible());
+ $this->actor->find(self::checkmarkInItemInDropdownForTag($tag), 10)->isVisible());
}
/**
*/
public function iSeeThatTheTagInTheDropdownForTagsInTheDetailsViewIsNotChecked($tag) {
Assert::assertTrue(
- $this->actor->find(self::itemInDropdownForTag($tag), 10)->isVisible());
+ $this->actor->find(self::itemInDropdownForTag($tag), 10)->isVisible());
Assert::assertFalse(
- $this->actor->find(self::checkmarkInItemInDropdownForTag($tag))->isVisible());
+ $this->actor->find(self::checkmarkInItemInDropdownForTag($tag))->isVisible());
}
/**
*/
public function iSeeThatTheTabInTheDetailsViewIsEventuallyLoaded($tabName) {
if (!WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::loadingIconForTabInDetailsViewNamed($tabName),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::loadingIconForTabInDetailsViewNamed($tabName),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The $tabName tab in the details view has not been loaded after $timeout seconds");
}
}
// Close the share link menu if it is open to ensure that it does not
// cover the copy link button.
if (!WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::shareLinkMenu($shareLinkMenuTriggerElement),
- $timeout = 2 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::shareLinkMenu($shareLinkMenuTriggerElement),
+ $timeout = 2 * $this->actor->getFindTimeoutMultiplier())) {
// It may not be possible to click on the menu button (due to the
// menu itself covering it), so "Enter" key is pressed instead.
$this->actor->find(self::shareLinkMenuButton(), 2)->getWrappedElement()->keyPress(13);
*/
public function iSeeThatTheFileIsSharedWithMeBy($sharedByName) {
Assert::assertEquals(
- $this->actor->find(self::sharedByLabel(), 10)->getText(), "Shared with you by $sharedByName");
+ $this->actor->find(self::sharedByLabel(), 10)->getText(), "Shared with you by $sharedByName");
}
/**
*/
public function iSeeThatTheFileIsSharedWith($sharedWithName) {
Assert::assertTrue(
- $this->actor->find(self::sharedWithRow($sharedWithName), 10)->isVisible());
+ $this->actor->find(self::sharedWithRow($sharedWithName), 10)->isVisible());
}
/**
*/
public function iSeeThatTheFileIsNotSharedWith($sharedWithName) {
if (!WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::sharedWithRow($sharedWithName),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::sharedWithRow($sharedWithName),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The shared with $sharedWithName row is still shown after $timeout seconds");
}
}
*/
public function iSeeThatResharingTheFileIsNotAllowed() {
Assert::assertEquals(
- $this->actor->find(self::shareWithInput(), 10)->getWrappedElement()->getAttribute("disabled"), "disabled");
+ $this->actor->find(self::shareWithInput(), 10)->getWrappedElement()->getAttribute("disabled"), "disabled");
Assert::assertEquals(
- $this->actor->find(self::shareWithInput(), 10)->getWrappedElement()->getAttribute("placeholder"), "Resharing is not allowed");
+ $this->actor->find(self::shareWithInput(), 10)->getWrappedElement()->getAttribute("placeholder"), "Resharing is not allowed");
}
/**
*/
public function iSeeThatResharingTheFileByLinkIsNotAvailable() {
if (!WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::shareLinkAddNewButton(),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::shareLinkAddNewButton(),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The add new share link button is still shown after $timeout seconds");
}
}
$shareWithMenuTriggerElement = $this->actor->find(self::shareWithMenuTrigger($sharedWithName), 10);
Assert::assertEquals(
- $this->actor->find(self::canEditCheckboxInput($sharedWithName, $shareWithMenuTriggerElement), 10)->getWrappedElement()->getAttribute("disabled"), "disabled");
+ $this->actor->find(self::canEditCheckboxInput($sharedWithName, $shareWithMenuTriggerElement), 10)->getWrappedElement()->getAttribute("disabled"), "disabled");
}
/**
$shareWithMenuTriggerElement = $this->actor->find(self::shareWithMenuTrigger($sharedWithName), 10);
Assert::assertTrue(
- $this->actor->find(self::canEditCheckboxInput($sharedWithName, $shareWithMenuTriggerElement), 10)->isChecked());
+ $this->actor->find(self::canEditCheckboxInput($sharedWithName, $shareWithMenuTriggerElement), 10)->isChecked());
}
/**
$shareWithMenuTriggerElement = $this->actor->find(self::shareWithMenuTrigger($sharedWithName), 10);
Assert::assertFalse(
- $this->actor->find(self::canEditCheckboxInput($sharedWithName, $shareWithMenuTriggerElement), 10)->isChecked());
+ $this->actor->find(self::canEditCheckboxInput($sharedWithName, $shareWithMenuTriggerElement), 10)->isChecked());
}
/**
$shareWithMenuTriggerElement = $this->actor->find(self::shareWithMenuTrigger($sharedWithName), 10);
Assert::assertEquals(
- $this->actor->find(self::canCreateCheckboxInput($sharedWithName, $shareWithMenuTriggerElement), 10)->getWrappedElement()->getAttribute("disabled"), "disabled");
+ $this->actor->find(self::canCreateCheckboxInput($sharedWithName, $shareWithMenuTriggerElement), 10)->getWrappedElement()->getAttribute("disabled"), "disabled");
}
/**
$shareWithMenuTriggerElement = $this->actor->find(self::shareWithMenuTrigger($sharedWithName), 10);
Assert::assertTrue(
- $this->actor->find(self::canCreateCheckboxInput($sharedWithName, $shareWithMenuTriggerElement), 10)->isChecked());
+ $this->actor->find(self::canCreateCheckboxInput($sharedWithName, $shareWithMenuTriggerElement), 10)->isChecked());
}
/**
$shareWithMenuTriggerElement = $this->actor->find(self::shareWithMenuTrigger($sharedWithName), 10);
Assert::assertFalse(
- $this->actor->find(self::canCreateCheckboxInput($sharedWithName, $shareWithMenuTriggerElement), 10)->isChecked());
+ $this->actor->find(self::canCreateCheckboxInput($sharedWithName, $shareWithMenuTriggerElement), 10)->isChecked());
}
/**
$shareWithMenuTriggerElement = $this->actor->find(self::shareWithMenuTrigger($sharedWithName), 10);
if (!WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::canReshareCheckbox($sharedWithName, $shareWithMenuTriggerElement),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::canReshareCheckbox($sharedWithName, $shareWithMenuTriggerElement),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The resharing checkbox for $sharedWithName is still shown after $timeout seconds");
}
}
$shareWithMenuTriggerElement = $this->actor->find(self::shareWithMenuTrigger($sharedWithName), 10);
Assert::assertTrue(
- $this->actor->find(self::canReshareCheckboxInput($sharedWithName, $shareWithMenuTriggerElement), 10)->isChecked());
+ $this->actor->find(self::canReshareCheckboxInput($sharedWithName, $shareWithMenuTriggerElement), 10)->isChecked());
}
/**
$shareWithMenuTriggerElement = $this->actor->find(self::shareWithMenuTrigger($sharedWithName), 10);
Assert::assertFalse(
- $this->actor->find(self::canReshareCheckboxInput($sharedWithName, $shareWithMenuTriggerElement), 10)->isChecked());
+ $this->actor->find(self::canReshareCheckboxInput($sharedWithName, $shareWithMenuTriggerElement), 10)->isChecked());
}
/**
}
if (!WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::disabledPasswordProtectField($shareLinkMenuTriggerElement),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::disabledPasswordProtectField($shareLinkMenuTriggerElement),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The password protect field is still disabled after $timeout seconds");
}
}
$shareLinkMenuTriggerElement = $this->actor->find(self::shareLinkMenuTrigger(), 10);
try {
Assert::assertFalse(
- $this->actor->find(self::passwordProtectByTalkCheckbox($shareLinkMenuTriggerElement))->isVisible());
+ $this->actor->find(self::passwordProtectByTalkCheckbox($shareLinkMenuTriggerElement))->isVisible());
} catch (NoSuchElementException $exception) {
}
}
// case it is in the process of being hidden due to a previous action,
// in which case it is shown again.
if (WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::shareLinkMenu($shareLinkMenuTriggerElement),
- $timeout = 2 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::shareLinkMenu($shareLinkMenuTriggerElement),
+ $timeout = 2 * $this->actor->getFindTimeoutMultiplier())) {
$this->actor->find(self::shareLinkMenuButton(), 10)->click();
}
}
// case it is in the process of being hidden due to a previous action,
// in which case it is shown again.
if (WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::shareWithMenu($shareWithName, $shareWithMenuTriggerElement),
- $timeout = 2 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::shareWithMenu($shareWithName, $shareWithMenuTriggerElement),
+ $timeout = 2 * $this->actor->getFindTimeoutMultiplier())) {
$this->actor->find(self::shareWithMenuButton($shareWithName), 10)->click();
}
}
*/
public function iSeeThatTheCurrentPageIsTheLoginPage() {
Assert::assertStringStartsWith(
- $this->actor->locatePath("/login"),
- $this->actor->getSession()->getCurrentUrl());
+ $this->actor->locatePath("/login"),
+ $this->actor->getSession()->getCurrentUrl());
}
/**
*/
public function iSeeThatAWrongPasswordMessageIsShown() {
Assert::assertTrue(
- $this->actor->find(self::wrongPasswordMessage(), 10)->isVisible());
+ $this->actor->find(self::wrongPasswordMessage(), 10)->isVisible());
}
/**
*/
public function iSeeThatTheDisabledUserMessageIsShown() {
Assert::assertTrue(
- $this->actor->find(self::userDisabledMessage(), 10)->isVisible());
+ $this->actor->find(self::userDisabledMessage(), 10)->isVisible());
}
/**
*/
public function iSeeThatTheCurrentPageIsTheAuthenticatePageForTheSharedLinkIWroteDown() {
Assert::assertEquals(
- $this->actor->getSharedNotebook()["shared link"] . "/authenticate/showShare",
- $this->actor->getSession()->getCurrentUrl());
+ $this->actor->getSharedNotebook()["shared link"] . "/authenticate/showShare",
+ $this->actor->getSession()->getCurrentUrl());
}
/**
*/
public function iSeeThatTheCurrentPageIsTheAuthenticatePageForTheDirectDownloadSharedLinkIWroteDown() {
Assert::assertEquals(
- $this->actor->getSharedNotebook()["shared link"] . "/authenticate/downloadShare",
- $this->actor->getSession()->getCurrentUrl());
+ $this->actor->getSharedNotebook()["shared link"] . "/authenticate/downloadShare",
+ $this->actor->getSession()->getCurrentUrl());
}
/**
*/
public function iSeeThatTheCurrentPageIsTheSharedLinkIWroteDown() {
Assert::assertEquals(
- $this->actor->getSharedNotebook()["shared link"],
- $this->actor->getSession()->getCurrentUrl());
+ $this->actor->getSharedNotebook()["shared link"],
+ $this->actor->getSession()->getCurrentUrl());
$this->setFileListAncestorForActor(null, $this->actor);
}
*/
public function iSeeThatTheCurrentPageIsTheDirectDownloadSharedLinkIWroteDown() {
Assert::assertEquals(
- $this->actor->getSharedNotebook()["shared link"] . "/download",
- $this->actor->getSession()->getCurrentUrl());
+ $this->actor->getSharedNotebook()["shared link"] . "/download",
+ $this->actor->getSession()->getCurrentUrl());
}
/**
*/
public function iSeeThatAWrongPasswordForTheSharedFileMessageIsShown() {
Assert::assertTrue(
- $this->actor->find(self::wrongPasswordMessage(), 10)->isVisible());
+ $this->actor->find(self::wrongPasswordMessage(), 10)->isVisible());
}
/**
// the element could be found when it was no made visible yet due to the
// command not having been processed by the browser.
if (!WaitFor::elementToBeEventuallyShown(
- $this->actor, self::shareMenu(), $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor, self::shareMenu(), $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The Share menu is not visible yet after $timeout seconds");
}
// download item should not be shown in the menu (although it will be in
// the DOM).
Assert::assertFalse(
- $this->actor->find(self::downloadItemInShareMenu())->isVisible(),
- "Download item in share menu is visible");
+ $this->actor->find(self::downloadItemInShareMenu())->isVisible(),
+ "Download item in share menu is visible");
Assert::assertTrue(
- $this->actor->find(self::directLinkItemInShareMenu())->isVisible(),
- "Direct link item in share menu is not visible");
+ $this->actor->find(self::directLinkItemInShareMenu())->isVisible(),
+ "Direct link item in share menu is not visible");
Assert::assertTrue(
- $this->actor->find(self::saveItemInShareMenu())->isVisible(),
- "Save item in share menu is not visible");
+ $this->actor->find(self::saveItemInShareMenu())->isVisible(),
+ "Save item in share menu is not visible");
}
/**
public function iSeeThatTheShareMenuButtonIsNotShown() {
try {
Assert::assertFalse(
- $this->actor->find(self::shareMenuButton())->isVisible());
+ $this->actor->find(self::shareMenuButton())->isVisible());
} catch (NoSuchElementException $exception) {
}
}
*/
public function iSeeThatTheDownloadButtonIsShown() {
if (!WaitFor::elementToBeEventuallyShown(
- $this->actor, self::downloadButton(), $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor, self::downloadButton(), $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The download button is not visible yet after $timeout seconds");
}
}
public function iSeeThatTheDownloadButtonIsNotShown() {
try {
Assert::assertFalse(
- $this->actor->find(self::downloadButton())->isVisible());
+ $this->actor->find(self::downloadButton())->isVisible());
} catch (NoSuchElementException $exception) {
}
}
*/
public function iSeeThatTheSearchResultIs($number, $name) {
Assert::assertEquals(
- $name, $this->actor->find(self::searchResultName($number), 10)->getText());
+ $name, $this->actor->find(self::searchResultName($number), 10)->getText());
}
/**
*/
public function iSeeThatTheSearchResultWasFoundIn($number, $path) {
Assert::assertEquals(
- $path, $this->actor->find(self::searchResultPath($number), 10)->getText());
+ $path, $this->actor->find(self::searchResultPath($number), 10)->getText());
}
}
*/
public function iSeeThatSharesAreAcceptedByDefault() {
Assert::assertTrue(
- $this->actor->find(self::acceptSharesByDefaultCheckboxInput(), 10)->isChecked());
+ $this->actor->find(self::acceptSharesByDefaultCheckboxInput(), 10)->isChecked());
}
/**
*/
public function iSeeThatResharingIsEnabled() {
Assert::assertTrue(
- $this->actor->find(self::allowResharingCheckboxInput(), 10)->isChecked());
+ $this->actor->find(self::allowResharingCheckboxInput(), 10)->isChecked());
}
/**
*/
public function iSeeThatResharingIsDisabled() {
Assert::assertFalse(
- $this->actor->find(self::allowResharingCheckboxInput(), 10)->isChecked());
+ $this->actor->find(self::allowResharingCheckboxInput(), 10)->isChecked());
}
/**
*/
public function iSeeThatUsernameAutocompletionIsRestrictedToGroups() {
Assert::assertTrue(
- $this->actor->find(self::restrictUsernameAutocompletionToGroupsCheckboxInput(), 10)->isChecked());
+ $this->actor->find(self::restrictUsernameAutocompletionToGroupsCheckboxInput(), 10)->isChecked());
}
/**
*/
public function iSeeThatUsernameAutocompletionIsNotRestrictedToGroups() {
Assert::assertFalse(
- $this->actor->find(self::restrictUsernameAutocompletionToGroupsCheckboxInput(), 10)->isChecked());
+ $this->actor->find(self::restrictUsernameAutocompletionToGroupsCheckboxInput(), 10)->isChecked());
}
/**
*/
public function iSeeThatSharesAreNotAcceptedByDefault() {
Assert::assertFalse(
- $this->actor->find(self::acceptSharesByDefaultCheckboxInput(), 10)->isChecked());
+ $this->actor->find(self::acceptSharesByDefaultCheckboxInput(), 10)->isChecked());
}
/**
*/
public function iSeeThatTheSettingsMenuIsShown() {
Assert::assertTrue(
- $this->actor->find(self::settingsMenu(), 10)->isVisible());
+ $this->actor->find(self::settingsMenu(), 10)->isVisible());
}
/**
*/
public function iSeeThatTheItemInTheSettingsMenuIsShown($itemText) {
Assert::assertTrue(
- $this->actor->find(self::menuItemFor($itemText), 10)->isVisible());
+ $this->actor->find(self::menuItemFor($itemText), 10)->isVisible());
}
/**
try {
Assert::assertFalse(
- $this->actor->find(self::menuItemFor($itemText))->isVisible());
+ $this->actor->find(self::menuItemFor($itemText))->isVisible());
} catch (NoSuchElementException $exception) {
}
}
*/
public function iSeeThatTheToastIsShown($message) {
Assert::assertTrue($this->actor->find(
- self::toastMessage($message), 10)->isVisible());
+ self::toastMessage($message), 10)->isVisible());
}
}
*/
public function iSeeThatTheListOfUsersContainsTheUser($user) {
if (!WaitFor::elementToBeEventuallyShown(
- $this->actor,
- self::rowForUser($user),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::rowForUser($user),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The user $user in the list of users is not shown yet after $timeout seconds");
}
}
*/
public function iSeeThatTheListOfUsersDoesNotContainsTheUser($user) {
if (!WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::rowForUser($user),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::rowForUser($user),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The user $user in the list of users is still shown after $timeout seconds");
}
}
*/
public function iSeeThatTheNewUserFormIsShown() {
if (!WaitFor::elementToBeEventuallyShown(
- $this->actor,
- self::newUserForm(),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::newUserForm(),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The new user form is not shown yet after $timeout seconds");
}
}
}
if (!WaitFor::elementToBeEventuallyNotShown(
- $this->actor,
- self::classCellForUser($cell . ' icon-loading-small', $user),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::classCellForUser($cell . ' icon-loading-small', $user),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The loading icon for user $user is still shown after $timeout seconds");
}
}
*/
public function iSeeThatTheEditModeIsOn($user) {
if (!WaitFor::elementToBeEventuallyShown(
- $this->actor,
- self::editModeOn($user),
- $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
+ $this->actor,
+ self::editModeOn($user),
+ $timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
Assert::fail("The edit mode for user $user in the list of users is not on yet after $timeout seconds");
}
}
* Helper class with common "wait for" functions.
*/
class WaitFor {
-
/**
* Waits for the element to be visible.
*
* performs them.
*/
class Actor {
-
/**
* @var string
*/
*/
trait ActorAware {
-
/**
* @var Actor
*/
*/
interface ActorAwareInterface {
-
/**
* @param Actor $actor
*/
* are stopped after each scenario is run.
*/
class ActorContext extends RawMinkContext {
-
/**
* @var array
*/
* NoSuchElementException is thrown.
*/
class ElementFinder {
-
/**
* Finds an element in the given Mink Session.
*
* the ElementWrapper).
*/
class ElementWrapper {
-
/**
* @var ElementFinder
*/
* fluent interface with Locator::forThe().
*/
class Locator {
-
/**
* @var string
*/
}
class LocatorBuilder {
-
/**
* @param string $selector
* @param string|array $locator
}
class LocatorBuilderSecondStep {
-
/**
* @var string
*/
}
class LocatorBuilderThirdStep {
-
/**
* @var string
*/
* - second-parameter-value
*/
class NextcloudTestServerContext implements Context {
-
/**
* @var NextcloudTestServerHelper
*/
* nothing to be explicitly catched a plain base Exception is used.
*/
interface NextcloudTestServerHelper {
-
/**
* Sets up the Nextcloud test server.
*
* server can be got from "getBaseUrl".
*/
class NextcloudTestServerLocalApacheHelper implements NextcloudTestServerHelper {
-
/**
* @var string
*/
* server can be got from "getBaseUrl".
*/
class NextcloudTestServerLocalBuiltInHelper implements NextcloudTestServerHelper {
-
/**
* @var string
*/
* Exception to signal that the element looked for could not be found.
*/
class NoSuchElementException extends \Exception {
-
/**
* @param string $message
* @param null|\Exception $previous
*/
class Utils {
-
/**
* Waits at most $timeout seconds for the given condition to be true,
* checking it again every $timeoutStep seconds.
use OCP\IRequest;
class APITest extends \Test\TestCase {
-
// Helps build a response variable
/**
* @group DB
*/
class HooksTest extends TestCase {
-
/** @var LoggerInterface|MockObject */
private $logger;
use Test\TestCase;
class ManagerTest extends TestCase {
-
/** @var \OC\Activity\Manager */
private $activityManager;
use OCP\IDBConnection;
class AllConfigTest extends \Test\TestCase {
-
/** @var \OCP\IDBConnection */
protected $connection;
$config->deleteUserValue('userDelete', 'appDelete', 'keyDelete');
$result = $this->connection->executeQuery(
- 'SELECT COUNT(*) AS `count` FROM `*PREFIX*preferences` WHERE `userid` = ?',
- ['userDelete']
- )->fetch();
+ 'SELECT COUNT(*) AS `count` FROM `*PREFIX*preferences` WHERE `userid` = ?',
+ ['userDelete']
+ )->fetch();
$actualCount = $result['count'];
$this->assertEquals(0, $actualCount, 'There was one value in the database and after the tests there should be no entry left.');
use Test\TestCase;
class CompareVersionTest extends TestCase {
-
/** @var CompareVersion */
private $compare;
use Test\TestCase;
class DependencyAnalyzerTest extends TestCase {
-
/** @var Platform|\PHPUnit\Framework\MockObject\MockObject */
private $platformMock;
use OC;
class PlatformRepositoryTest extends \Test\TestCase {
-
/**
* @dataProvider providesVersions
* @param $expected
use Test\TestCase;
class BootContextTest extends TestCase {
-
/** @var IAppContainer|MockObject */
private $appContainer;
use Test\TestCase;
class CoordinatorTest extends TestCase {
-
/** @var IAppManager|MockObject */
private $appManager;
}
class FunctionInjectorTest extends TestCase {
-
/** @var SimpleContainer */
private $container;
use Test\TestCase;
class RegistrationContextTest extends TestCase {
-
/** @var LoggerInterface|MockObject */
private $logger;
use OCP\IURLGenerator;
class AuthPublicShareControllerTest extends \Test\TestCase {
-
/** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */
private $request;
/** @var ISession|\PHPUnit\Framework\MockObject\MockObject */
};
class ControllerTest extends \Test\TestCase {
-
/**
* @var Controller
*/
use OCP\ISession;
class TestController extends PublicShareController {
-
/** @var string */
private $hash;
}
class PublicShareControllerTest extends \Test\TestCase {
-
/** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */
private $request;
/** @var ISession|\PHPUnit\Framework\MockObject\MockObject */
* @package Test\AppFramework\Db
*/
class QBMapperTest extends \Test\TestCase {
-
/**
* @var \PHPUnit\Framework\MockObject\MockObject|IDBConnection
*/
use Test\TestCase;
class TransactionalTest extends TestCase {
-
/** @var IDBConnection|MockObject */
private IDBConnection $db;
* @group DB
*/
class DIContainerTest extends \Test\TestCase {
-
/** @var DIContainer|\PHPUnit\Framework\MockObject\MockObject */
private $container;
}
class DIIntergrationTests extends TestCase {
-
/** @var DIContainer */
private $container;
* @package OC\AppFramework\Http
*/
class ContentSecurityPolicyTest extends \Test\TestCase {
-
/** @var ContentSecurityPolicy */
private $contentSecurityPolicy;
use OCP\IRequest;
class DataResponseTest extends \Test\TestCase {
-
/**
* @var DataResponse
*/
* @package OC\AppFramework\Http
*/
class EmptyContentSecurityPolicyTest extends \Test\TestCase {
-
/** @var EmptyContentSecurityPolicy */
private $contentSecurityPolicy;
use OCP\AppFramework\Http\EmptyFeaturePolicy;
class EmptyFeaturePolicyTest extends \Test\TestCase {
-
/** @var EmptyFeaturePolicy */
private $policy;
use OCP\AppFramework\Http\FeaturePolicy;
class FeaturePolicyTest extends \Test\TestCase {
-
/** @var EmptyFeaturePolicy */
private $policy;
use OCP\AppFramework\Http\JSONResponse;
class JSONResponseTest extends \Test\TestCase {
-
/**
* @var JSONResponse
*/
use OCP\AppFramework\Http\RedirectResponse;
class RedirectResponseTest extends \Test\TestCase {
-
/**
* @var RedirectResponse
*/
use OCP\AppFramework\Utility\ITimeFactory;
class ResponseTest extends \Test\TestCase {
-
/**
* @var \OCP\AppFramework\Http\Response
*/
use OCP\AppFramework\Http\StreamResponse;
class StreamResponseTest extends \Test\TestCase {
-
/** @var IOutput */
private $output;
use OCP\AppFramework\Http\TemplateResponse;
class TemplateResponseTest extends \Test\TestCase {
-
/**
* @var \OCP\AppFramework\Http\TemplateResponse
*/
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class AdditionalScriptsMiddlewareTest extends \Test\TestCase {
-
/** @var EventDispatcherInterface|MockObject */
private $legacyDispatcher;
/** @var IUserSession|MockObject */
use OCP\IRequest;
class CompressionMiddlewareTest extends \Test\TestCase {
-
/** @var IRequest */
private $request;
/** @var Controller */
class MiddlewareTest extends \Test\TestCase {
-
/**
* @var Middleware
*/
use OCP\IRequest;
class NotModifiedMiddlewareTest extends \Test\TestCase {
-
/** @var IRequest */
private $request;
/** @var Controller */
use OCP\IRequest;
class OCSMiddlewareTest extends \Test\TestCase {
-
/**
* @var IRequest
*/
use OCP\IURLGenerator;
class PublicShareMiddlewareTest extends \Test\TestCase {
-
/** @var IRequest|\PHPUnit\Framework\MockObject\MockObject */
private $request;
/** @var ISession|\PHPUnit\Framework\MockObject\MockObject */
use OCP\IRequestId;
class CORSMiddlewareTest extends \Test\TestCase {
-
/** @var ControllerMethodReflector */
private $reflector;
/** @var Session|\PHPUnit\Framework\MockObject\MockObject */
use PHPUnit\Framework\MockObject\MockObject;
class CSPMiddlewareTest extends \Test\TestCase {
-
/** @var CSPMiddleware|MockObject */
private $middleware;
/** @var Controller|MockObject */
use PHPUnit\Framework\MockObject\MockObject;
class FeaturePolicyMiddlewareTest extends \Test\TestCase {
-
/** @var FeaturePolicyMiddleware|MockObject */
private $middleware;
/** @var Controller|MockObject */
use Test\TestCase;
class SameSiteCookieMiddlewareTest extends TestCase {
-
/** @var SameSiteCookieMiddleware */
private $middleware;
use Psr\Log\LoggerInterface;
class SecurityMiddlewareTest extends \Test\TestCase {
-
/** @var SecurityMiddleware|\PHPUnit\Framework\MockObject\MockObject */
private $middleware;
/** @var Controller|\PHPUnit\Framework\MockObject\MockObject */
use OCP\AppFramework\Http\Response;
class SessionMiddlewareTest extends \Test\TestCase {
-
/** @var ControllerMethodReflector */
private $reflector;
class BaseResponseTest extends \Test\TestCase {
public function testToXml(): void {
-
/** @var BaseResponse $response */
$response = $this->createMock(BaseResponse::class);
use OC\AppFramework\Utility\ControllerMethodReflector;
class BaseController {
-
/**
* @Annotation
*/
}
class MiddleController extends BaseController {
-
/**
* @NoAnnotation
*/
}
class ControllerMethodReflectorTest extends \Test\TestCase {
-
-
/**
* @Annotation
*/
public function testConstructorComplexInterface() {
$this->container->registerParameter('test', 'abc');
$this->container->registerService(
- 'Test\AppFramework\Utility\IInterfaceConstructor', function ($c) {
- return $c->query('Test\AppFramework\Utility\ClassSimpleConstructor');
- });
+ 'Test\AppFramework\Utility\IInterfaceConstructor', function ($c) {
+ return $c->query('Test\AppFramework\Utility\ClassSimpleConstructor');
+ });
$object = $this->container->query(
'Test\AppFramework\Utility\ClassInterfaceConstructor'
);
public function testOverrideService() {
$this->container->registerService(
- 'Test\AppFramework\Utility\IInterfaceConstructor', function ($c) {
- return $c->query('Test\AppFramework\Utility\ClassSimpleConstructor');
- });
+ 'Test\AppFramework\Utility\IInterfaceConstructor', function ($c) {
+ return $c->query('Test\AppFramework\Utility\ClassSimpleConstructor');
+ });
$this->container->registerService(
- 'Test\AppFramework\Utility\IInterfaceConstructor', function ($c) {
- return $c->query('Test\AppFramework\Utility\ClassEmptyConstructor');
- });
+ 'Test\AppFramework\Utility\IInterfaceConstructor', function ($c) {
+ return $c->query('Test\AppFramework\Utility\ClassEmptyConstructor');
+ });
$object = $this->container->query(
'Test\AppFramework\Utility\IInterfaceConstructor'
);
use Test\TestCase;
class RemoteWipeActivityListenerTest extends TestCase {
-
/** @var IActivityManager|MockObject */
private $activityManager;
use Test\TestCase;
class RemoteWipeEmailListenerTest extends TestCase {
-
/** @var IMailer|MockObject */
private $mailer;
use Test\TestCase;
class RemoteWipeNotificationsListenerTest extends TestCase {
-
/** @var INotificationManager|MockObject */
private $notificationManager;
use Test\TestCase;
class UserDeletedTokenCleanupListenerTest extends TestCase {
-
-
/** @var Manager|MockObject */
private $manager;
use Test\TestCase;
abstract class ALoginCommandTest extends TestCase {
-
/** @var IRequest|MockObject */
protected $request;
use PHPUnit\Framework\MockObject\MockObject;
class ClearLostPasswordTokensCommandTest extends ALoginCommandTest {
-
/** @var IConfig|MockObject */
private $config;
use PHPUnit\Framework\MockObject\MockObject;
class CompleteLoginCommandTest extends ALoginCommandTest {
-
/** @var Session|MockObject */
private $session;
use PHPUnit\Framework\MockObject\MockObject;
class CreateSessionTokenCommandTest extends ALoginCommandTest {
-
/** @var IConfig|MockObject */
private $config;
use PHPUnit\Framework\MockObject\MockObject;
class EmailLoginCommandTest extends ALoginCommandTest {
-
/** @var IUserManager|MockObject */
private $userManager;
use PHPUnit\Framework\MockObject\MockObject;
class FinishRememberedLoginCommandTest extends ALoginCommandTest {
-
/** @var Session|MockObject */
private $userSession;
/** @var IConfig|MockObject */
use Psr\Log\LoggerInterface;
class LoggedInCheckCommandTest extends ALoginCommandTest {
-
/** @var LoggerInterface|MockObject */
private $logger;
use PHPUnit\Framework\MockObject\MockObject;
class PreLoginHookCommandTest extends ALoginCommandTest {
-
/** @var IUserManager|MockObject */
private $userManager;
use PHPUnit\Framework\MockObject\MockObject;
class SetUserTimezoneCommandTest extends ALoginCommandTest {
-
/** @var IConfig|MockObject */
private $config;
use PHPUnit\Framework\MockObject\MockObject;
class TwoFactorCommandTest extends ALoginCommandTest {
-
/** @var Manager|MockObject */
private $twoFactorManager;
use PHPUnit\Framework\MockObject\MockObject;
class UidLoginCommandTest extends ALoginCommandTest {
-
/** @var Manager|MockObject */
private $userManager;
use PHPUnit\Framework\MockObject\MockObject;
class UpdateLastPasswordConfirmCommandTest extends ALoginCommandTest {
-
/** @var ISession|MockObject */
private $session;
use Psr\Log\LoggerInterface;
class UserDisabledCheckCommandTest extends ALoginCommandTest {
-
/** @var IUserManager|MockObject */
private $userManager;
use Test\TestCase;
class CredentialsTest extends TestCase {
-
/** @var string */
private $uid;
use function json_encode;
class StoreTest extends TestCase {
-
/** @var ISession|\PHPUnit\Framework\MockObject\MockObject */
private $session;
* @group DB
*/
class PublicKeyTokenMapperTest extends TestCase {
-
/** @var PublicKeyTokenMapper */
private $mapper;
use Test\TestCase;
class RemoteWipeTest extends TestCase {
-
/** @var ITokenProvider|MockObject */
private $tokenProvider;
* @group DB
*/
class ProviderUserAssignmentDaoTest extends TestCase {
-
/** @var IDBConnection */
private $dbConn;
use Test\TestCase;
class ManagerTest extends TestCase {
-
/** @var IUser|MockObject */
private $user;
use Test\TestCase;
class MandatoryTwoFactorTest extends TestCase {
-
/** @var IConfig|MockObject */
private $config;
use Test\TestCase;
class ProviderLoaderTest extends TestCase {
-
/** @var IAppManager|MockObject */
private $appManager;
use Test\TestCase;
class ProviderManagerTest extends TestCase {
-
/** @var ProviderLoader|MockObject */
private $providerLoader;
use Test\TestCase;
class ProviderSetTest extends TestCase {
-
/** @var ProviderSet */
private $providerSet;
use Test\TestCase;
class RegistryTest extends TestCase {
-
/** @var ProviderUserAssignmentDao|MockObject */
private $dao;
}
class ManagerTest extends TestCase {
-
/** @var Coordinator|MockObject */
private $coordinator;
use Test\TestCase;
class ManagerTest extends TestCase {
-
/** @var Coordinator|MockObject */
private $coordinator;
use Test\TestCase;
class ManagerTest extends TestCase {
-
/** @var Coordinator|MockObject */
private $coordinator;
use Psr\Log\LoggerInterface;
class CapabilitiesManagerTest extends TestCase {
-
/** @var CapabilitiesManager */
private $manager;
use Test\TestCase;
class LookupPluginTest extends TestCase {
-
/** @var IConfig|MockObject */
protected $config;
/** @var IClientService|MockObject */
use Test\TestCase;
class RemotePluginTest extends TestCase {
-
/** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
protected $userManager;
use Test\TestCase;
class ManagerTest extends TestCase {
-
/** @var LoggerInterface */
protected $logger;
/** @var IProviderManager */
use Test\TestCase;
class ProviderManagerTest extends TestCase {
-
/** @var IServerContainer */
protected $serverContainer;
/** @var LoggerInterface */
use Test\TestCase;
class CommentTest extends TestCase {
-
/**
* @throws \OCP\Comments\IllegalIDChangeException
*/
use Test\TestCase;
class ActionProviderStoreTest extends TestCase {
-
/** @var IServerContainer|MockObject */
private $serverContainer;
use Test\TestCase;
class ManagerTest extends TestCase {
-
/** @var ContactsStore|MockObject */
private $contactsStore;
use Test\TestCase;
class EMailproviderTest extends TestCase {
-
/** @var IActionFactory|MockObject */
private $actionFactory;
use Test\TestCase;
class LocalTimeProviderTest extends TestCase {
-
/** @var IActionFactory|MockObject */
private $actionFactory;
/** @var IL10N|MockObject */
use OCP\IAddressBook;
class ContactsManagerTest extends \Test\TestCase {
-
/** @var \OC\ContactsManager */
private $cm;
use OC\DB\Exceptions\DbalException;
class DbalExceptionTest extends \Test\TestCase {
-
/** @var TheDriverException */
protected $driverException;
use Test\TestCase;
class EventLoggerTest extends TestCase {
-
/** @var \OC\Diagnostics\EventLogger */
private $logger;
use Test\TestCase;
class QueryLoggerTest extends TestCase {
-
/** @var \OC\Diagnostics\QueryLogger */
private $logger;
use OCP\IEmojiHelper;
class EmojiHelperTest extends TestCase {
-
/** @var IDBConnection|\PHPUnit\Framework\MockObject\MockObject */
private $db;
* @package Test\Encryption
*/
class DecryptAllTest extends TestCase {
-
/** @var \PHPUnit\Framework\MockObject\MockObject | IUserManager */
protected $userManager;
* @dataProvider dataTestDecryptAllUsersFiles
*/
public function testDecryptAllUsersFiles($user) {
-
/** @var DecryptAll | \PHPUnit\Framework\MockObject\MockObject | $instance */
$instance = $this->getMockBuilder('OC\Encryption\DecryptAll')
->setConstructorArgs(
use Test\TestCase;
class EncryptionWrapperTest extends TestCase {
-
/** @var EncryptionWrapper */
private $instance;
use Test\TestCase;
class ManagerTest extends TestCase {
-
/** @var Manager */
private $manager;
use OCP\Encryption\IEncryptionModule;
class UpdateTest extends TestCase {
-
/** @var \OC\Encryption\Update */
private $update;
use Psr\Log\LoggerInterface;
class ErrorHandlerTest extends TestCase {
-
/** @var MockObject */
private LoggerInterface $logger;
use Test\TestCase;
class SymfonyAdapterTest extends TestCase {
-
/** @var EventDispatcher|MockObject */
private $eventDispatcher;
* @package Test\Files\Cache
*/
class WatcherTest extends \Test\TestCase {
-
/**
* @var \OC\Files\Storage\Storage[] $storages
*/
use OCP\IUser;
class ObjectHomeMountProviderTest extends \Test\TestCase {
-
/** @var ObjectHomeMountProvider */
protected $provider;
* The DB permission is needed for the fake root storage initialization
*/
class ObjectStorePreviewCacheMountProviderTest extends \Test\TestCase {
-
/** @var ObjectStorePreviewCacheMountProvider */
protected $provider;
use OCP\IUser;
class MapperTest extends \Test\TestCase {
-
/** @var IUser|\PHPUnit\Framework\MockObject\MockObject */
private $user;
use Test\TestCase;
abstract class ObjectStoreTest extends TestCase {
-
/** @var string[] */
private $cleanup = [];
* @package Test\Files
*/
class PathVerificationTest extends \Test\TestCase {
-
/**
* @var \OC\Files\View
*/
use OCP\Files\StorageNotAvailableException;
class AvailabilityTest extends \Test\TestCase {
-
/** @var \PHPUnit\Framework\MockObject\MockObject|StorageCache */
protected $storageCache;
/** @var \PHPUnit\Framework\MockObject\MockObject|Temporary */
use Test\Files\Storage\Storage;
class EncryptionTest extends Storage {
-
/**
* block size will always be 8192 for a PHP stream
* @see https://bugs.php.net/bug.php?id=21641
$this->encryptionManager->expects($this->any())->method('isEnabled')->willReturn($encryptionEnabled);
$encryptionStorage = new \OC\Files\Storage\Wrapper\Encryption(
- [
- 'storage' => $sourceStorage,
- 'root' => 'foo',
- 'mountPoint' => '/mountPoint',
- 'mount' => $this->mount
- ],
- $this->encryptionManager, $util, $this->logger, $this->file, null, $this->keyStore, $this->update
+ [
+ 'storage' => $sourceStorage,
+ 'root' => 'foo',
+ 'mountPoint' => '/mountPoint',
+ 'mount' => $this->mount
+ ],
+ $this->encryptionManager, $util, $this->logger, $this->file, null, $this->keyStore, $this->update
);
*/
public function testParseRawHeader($rawHeader, $expected) {
$instance = new \OC\Files\Storage\Wrapper\Encryption(
- [
- 'storage' => $this->sourceStorage,
- 'root' => 'foo',
- 'mountPoint' => '/',
- 'mount' => $this->mount
- ],
- $this->encryptionManager, $this->util, $this->logger, $this->file, null, $this->keyStore, $this->update, $this->mountManager, $this->arrayCache
+ [
+ 'storage' => $this->sourceStorage,
+ 'root' => 'foo',
+ 'mountPoint' => '/',
+ 'mount' => $this->mount
+ ],
+ $this->encryptionManager, $this->util, $this->logger, $this->file, null, $this->keyStore, $this->update, $this->mountManager, $this->arrayCache
- );
+ );
$result = $this->invokePrivate($instance, 'parseRawHeader', [$rawHeader]);
$this->assertSameSize($expected, $result);
namespace Test\Files\Storage\Wrapper;
class JailTest extends \Test\Files\Storage\Storage {
-
/**
* @var \OC\Files\Storage\Temporary
*/
* @group DB
*/
class PermissionsMaskTest extends \Test\Files\Storage\Storage {
-
/**
* @var \OC\Files\Storage\Temporary
*/
namespace Test\Files\Stream;
class DummyEncryptionWrapper extends \OC\Files\Stream\Encryption {
-
/**
* simulate a non-seekable stream wrapper by always return false
*
$expectedSize,
$expectedUnencryptedSize,
$expectedReadOnly) {
-
// build mocks
$encryptionModuleMock = $this->getMockBuilder('\OCP\Encryption\IEncryptionModule')
->disableOriginalConstructor()->getMock();
namespace Test\Files\Stream;
class QuotaTest extends \Test\TestCase {
-
/**
* @param string $mode
* @param integer $limit
use Test\TestCase;
class ConfigTest extends TestCase {
-
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
private $config;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class GroupTest extends \Test\TestCase {
-
/** @var EventDispatcherInterface|MockObject */
protected $dispatcher;
case 'user33': return true;
default:
return null;
- }
+ }
});
$this->userManager->expects($this->any())
->method('inGroup')
->willReturnCallback(function ($uid, $gid) {
switch ($uid) {
- case 'user1': return false;
- case 'user2': return true;
- case 'user3': return false;
- case 'user33': return true;
- case 'user333': return true;
- default:
- return null;
- }
+ case 'user1': return false;
+ case 'user2': return true;
+ case 'user3': return false;
+ case 'user33': return true;
+ case 'user333': return true;
+ default:
+ return null;
+ }
});
$this->userManager->expects($this->any())
->method('inGroup')
->willReturnCallback(function ($uid) {
switch ($uid) {
- case 'user1': return false;
- case 'user2': return true;
- case 'user3': return false;
- case 'user33': return true;
- case 'user333': return true;
- default:
- return null;
- }
+ case 'user1': return false;
+ case 'user2': return true;
+ case 'user3': return false;
+ case 'user33': return true;
+ case 'user333': return true;
+ default:
+ return null;
+ }
});
$this->userManager->expects($this->any())
use function get_class;
class RequestManagerTest extends TestCase {
-
/** @var Coordinator|MockObject */
private $coordinator;
use stdClass;
class InitialStateServiceTest extends TestCase {
-
/** @var InitialStateService */
private $service;
->expects($this->once())
->method('file_put_contents')
->with(
- $this->equalTo(\OC::$SERVERROOT . '/tests/data/integritycheck/app//appinfo/signature.json'),
- $this->callback(function ($signature) use ($expectedSignatureFileData) {
- $expectedArray = json_decode($expectedSignatureFileData, true);
- $actualArray = json_decode($signature, true);
- $this->assertEquals($expectedArray, $actualArray);
- return true;
- })
+ $this->equalTo(\OC::$SERVERROOT . '/tests/data/integritycheck/app//appinfo/signature.json'),
+ $this->callback(function ($signature) use ($expectedSignatureFileData) {
+ $expectedArray = json_decode($expectedSignatureFileData, true);
+ $actualArray = json_decode($signature, true);
+ $this->assertEquals($expectedArray, $actualArray);
+ return true;
+ })
);
$keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/SomeApp.crt');
->expects($this->once())
->method('file_put_contents')
->with(
- \OC::$SERVERROOT . '/tests/data/integritycheck/app//core/signature.json',
- $this->callback(function ($signature) use ($expectedSignatureFileData) {
- $expectedArray = json_decode($expectedSignatureFileData, true);
- $actualArray = json_decode($signature, true);
- $this->assertEquals($expectedArray, $actualArray);
- return true;
- })
+ \OC::$SERVERROOT . '/tests/data/integritycheck/app//core/signature.json',
+ $this->callback(function ($signature) use ($expectedSignatureFileData) {
+ $expectedArray = json_decode($expectedSignatureFileData, true);
+ $actualArray = json_decode($signature, true);
+ $this->assertEquals($expectedArray, $actualArray);
+ return true;
+ })
);
$keyBundle = file_get_contents(__DIR__ .'/../../data/integritycheck/core.crt');
->expects($this->once())
->method('file_put_contents')
->with(
- \OC::$SERVERROOT . '/tests/data/integritycheck/htaccessUnmodified//core/signature.json',
+ \OC::$SERVERROOT . '/tests/data/integritycheck/htaccessUnmodified//core/signature.json',
$this->callback(function ($signature) use ($expectedSignatureFileData) {
$expectedArray = json_decode($expectedSignatureFileData, true);
$actualArray = json_decode($signature, true);
->expects($this->once())
->method('file_put_contents')
->with(
- \OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithInvalidModifiedContent//core/signature.json',
+ \OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithInvalidModifiedContent//core/signature.json',
$this->callback(function ($signature) use ($expectedSignatureFileData) {
$expectedArray = json_decode($expectedSignatureFileData, true);
$actualArray = json_decode($signature, true);
->expects($this->once())
->method('file_put_contents')
->with(
- \OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithValidModifiedContent/core/signature.json',
+ \OC::$SERVERROOT . '/tests/data/integritycheck/htaccessWithValidModifiedContent/core/signature.json',
$this->callback(function ($signature) use ($expectedSignatureFileData) {
$expectedArray = json_decode($expectedSignatureFileData, true);
$actualArray = json_decode($signature, true);
use Test\TestCase;
class FactoryTest extends TestCase {
-
/** @var IConfig|MockObject */
protected $config;
$viewMock->expects($this->exactly(2))
->method('file_exists')
->withConsecutive(
- // Conflict on filename.ext
- ['dir/filename.ext'],
- ['dir/filename (2).ext'],
+ // Conflict on filename.ext
+ ['dir/filename.ext'],
+ ['dir/filename (2).ext'],
)
->will($this->onConsecutiveCalls(true, false));
$this->assertEquals('dir/filename (2).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename.ext', $viewMock));
$viewMock->expects($this->exactly(3))
->method('file_exists')
->withConsecutive(
- ['dir/filename.ext'],
- ['dir/filename (2).ext'],
- ['dir/filename (3).ext'],
+ ['dir/filename.ext'],
+ ['dir/filename (2).ext'],
+ ['dir/filename (3).ext'],
)
->will($this->onConsecutiveCalls(true, true, false));
$this->assertEquals('dir/filename (3).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename.ext', $viewMock));
$viewMock->expects($this->exactly(2))
->method('file_exists')
->withConsecutive(
- ['dir/filename (1).ext'],
- ['dir/filename (2).ext'],
+ ['dir/filename (1).ext'],
+ ['dir/filename (2).ext'],
)
->will($this->onConsecutiveCalls(true, false));
$this->assertEquals('dir/filename (2).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename (1).ext', $viewMock));
$viewMock->expects($this->exactly(2))
->method('file_exists')
->withConsecutive(
- ['dir/filename (2).ext'],
- ['dir/filename (3).ext'],
+ ['dir/filename (2).ext'],
+ ['dir/filename (3).ext'],
)
->will($this->onConsecutiveCalls(true, false));
$this->assertEquals('dir/filename (3).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename (2).ext', $viewMock));
$viewMock->expects($this->exactly(3))
->method('file_exists')
->withConsecutive(
- ['dir/filename (2).ext'],
- ['dir/filename (3).ext'],
- ['dir/filename (4).ext'],
+ ['dir/filename (2).ext'],
+ ['dir/filename (3).ext'],
+ ['dir/filename (4).ext'],
)
->will($this->onConsecutiveCalls(true, true, false));
$this->assertEquals('dir/filename (4).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename (2).ext', $viewMock));
$viewMock->expects($this->exactly(2))
->method('file_exists')
->withConsecutive(
- ['dir/filename(1).ext'],
- ['dir/filename(2).ext'],
+ ['dir/filename(1).ext'],
+ ['dir/filename(2).ext'],
)
->will($this->onConsecutiveCalls(true, false));
$this->assertEquals('dir/filename(2).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename(1).ext', $viewMock));
$viewMock->expects($this->exactly(2))
->method('file_exists')
->withConsecutive(
- ['dir/filename(1) (1).ext'],
- ['dir/filename(1) (2).ext'],
+ ['dir/filename(1) (1).ext'],
+ ['dir/filename(1) (2).ext'],
)
->will($this->onConsecutiveCalls(true, false));
$this->assertEquals('dir/filename(1) (2).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename(1) (1).ext', $viewMock));
$viewMock->expects($this->exactly(3))
->method('file_exists')
->withConsecutive(
- ['dir/filename(1) (1).ext'],
- ['dir/filename(1) (2).ext'],
- ['dir/filename(1) (3).ext'],
+ ['dir/filename(1) (1).ext'],
+ ['dir/filename(1) (2).ext'],
+ ['dir/filename(1) (3).ext'],
)
->will($this->onConsecutiveCalls(true, true, false));
$this->assertEquals('dir/filename(1) (3).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename(1) (1).ext', $viewMock));
$viewMock->expects($this->exactly(2))
->method('file_exists')
->withConsecutive(
- ['dir/filename(1) (2) (3).ext'],
- ['dir/filename(1) (2) (4).ext'],
+ ['dir/filename(1) (2) (3).ext'],
+ ['dir/filename(1) (2) (4).ext'],
)
->will($this->onConsecutiveCalls(true, false));
$this->assertEquals('dir/filename(1) (2) (4).ext', OC_Helper::buildNotExistingFileNameForView('dir', 'filename(1) (2) (3).ext', $viewMock));
use OC\Memcache\ArrayCache;
class MemcacheLockingProviderTest extends LockingProvider {
-
/**
* @var \OCP\IMemcache
*/
use OCP\Files\FileInfo;
class NulLCacheTest extends \Test\TestCase {
-
/** @var NullCache */
private $cache;
use Test\TestCase;
class NullStorageTest extends TestCase {
-
/** @var NullStorage */
private $storage;
use PHPUnit\Framework\MockObject\MockObject;
class LoggerTest extends TestCase implements IWriter {
-
/** @var SystemConfig|MockObject */
private $config;
use Test\TestCase;
class TestRepairStep implements IRepairStep {
-
/**
* Returns the step's name
*
}
class BackgroundRepairTest extends TestCase {
-
/** @var JobList|MockObject */
private $jobList;
namespace Test;
class NaturalSortTest extends \Test\TestCase {
-
/**
* @dataProvider naturalSortDataProvider
*/
use OCP\Notification\INotification;
class DummyApp implements IApp {
-
/**
* @param INotification $notification
* @throws \InvalidArgumentException When the notification is not valid
use OCP\Notification\INotifier;
class DummyNotifier implements INotifier {
-
/**
* Identifier of the notifier, only use [a-z0-9_]
*
use Test\TestCase;
class DiscoveryServiceTest extends TestCase {
-
/** @var \PHPUnit\Framework\MockObject\MockObject | ICacheFactory */
private $cacheFactory;
use OCP\AppFramework\Http;
class MapStatusCodeTest extends \Test\TestCase {
-
/**
* @dataProvider providesStatusCodes
*/
use Symfony\Component\EventDispatcher\GenericEvent;
class GeneratorTest extends \Test\TestCase {
-
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
private $config;
use OC\Files\Node\File;
abstract class Provider extends \Test\TestCase {
-
/** @var string */
protected $imgPath;
/** @var int */
* @see \OC\Repair\CleanTags
*/
class CleanTagsTest extends \Test\TestCase {
-
/** @var \OC\Repair\CleanTags */
protected $repair;
use OCP\Migration\IOutput;
class ClearFrontendCachesTest extends \Test\TestCase {
-
/** @var ICacheFactory */
private $cacheFactory;
use OCP\Migration\IOutput;
class ClearGeneratedAvatarCacheTest extends \Test\TestCase {
-
/** @var AvatarManager */
private $avatarManager;
* @group DB
*/
class FixMountStoragesTest extends TestCase {
-
/** @var IDBConnection */
private $db;
* @package Test\Repair
*/
class OldGroupMembershipSharesTest extends \Test\TestCase {
-
/** @var OldGroupMembershipShares */
protected $repair;
* @see \OC\Repair\RepairMimeTypes
*/
class RepairCollationTest extends TestCase {
-
/**
* @var TestCollationRepair
*/
use function in_array;
class RepairDavSharesTest extends TestCase {
-
/** @var IOutput|\PHPUnit\Framework\MockObject\MockObject */
protected $output;
/** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
* @see \OC\Repair\RepairInvalidShares
*/
class RepairInvalidSharesTest extends TestCase {
-
/** @var IRepairStep */
private $repair;
* @see \OC\Repair\RepairMimeTypes
*/
class RepairMimeTypesTest extends \Test\TestCase {
-
/** @var IRepairStep */
private $repair;
* @group DB
*/
class RepairSqliteAutoincrementTest extends \Test\TestCase {
-
/**
* @var \OC\Repair\SqliteAutoincrement
*/
use OC\Security\Certificate;
class CertificateTest extends \Test\TestCase {
-
/** @var Certificate That contains a valid certificate */
protected $goodCertificate;
/** @var Certificate That contains an invalid certificate */
* @group DB
*/
class CredentialsManagerTest extends \Test\TestCase {
-
/**
* @dataProvider credentialsProvider
*/
* Class HasherTest
*/
class HasherTest extends \Test\TestCase {
-
/**
* @return array
*/
use Test\TestCase;
class SignerTest extends TestCase {
-
/** @var string */
private $private = '-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDImc6QvHBjBIoo
use Test\TestCase;
class RemoteHostValidatorIntegrationTest extends TestCase {
-
/** @var IConfig|IConfig&MockObject|MockObject */
private IConfig $config;
private RemoteHostValidator $validator;
use Test\TestCase;
class RemoteHostValidatorTest extends TestCase {
-
/** @var IConfig|IConfig&MockObject|MockObject */
private IConfig $config;
/** @var HostnameClassifier|HostnameClassifier&MockObject|MockObject */
use Psr\Log\LoggerInterface;
class SetupTest extends \Test\TestCase {
-
/** @var SystemConfig|MockObject */
protected $config;
/** @var \bantu\IniGetWrapper\IniGetWrapper|MockObject */
* @group DB
*/
class DefaultShareProviderTest extends \Test\TestCase {
-
/** @var IDBConnection */
protected $dbConn;
use Test\TestCase;
class LegacyHooksTest extends TestCase {
-
/** @var LegacyHooks */
private $hooks;
* @group DB
*/
class ManagerTest extends \Test\TestCase {
-
/** @var Manager */
protected $manager;
/** @var LoggerInterface|MockObject */
/** @var ValidatePasswordPolicyEvent $event */
$this->assertSame('password', $event->getPassword());
}
- );
+ );
$result = self::invokePrivate($this->manager, 'verifyPassword', ['password']);
$this->assertNull($result);
$this->assertSame('password', $event->getPassword());
throw new HintException('message', 'password not accepted');
}
- );
+ );
self::invokePrivate($this->manager, 'verifyPassword', ['password']);
}
}
class DummyFactory implements IProviderFactory {
-
/** @var IShareProvider */
protected $provider;
* @group DB
*/
class ShareByMailProviderTest extends TestCase {
-
/** @var IDBConnection */
protected $dbConn;
use Test\TestCase;
class ShareHelperTest extends TestCase {
-
/** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
private $manager;
* @group DB
*/
class SubAdminTest extends \Test\TestCase {
-
/** @var \OCP\IUserManager */
private $userManager;
use Test\TestCase;
class RegistryTest extends TestCase {
-
/** @var IServerContainer|\PHPUnit\Framework\MockObject\MockObject */
private $serverContainer;
namespace Test\Support\Subscription;
class DummySubscription implements \OCP\Support\Subscription\ISubscription {
-
/** @var bool */
private $hasValidSubscription;
/** @var bool */
use Test\TestCase;
class RegistryTest extends TestCase {
-
/** @var Registry */
private $registry;
* @package Test\SystemTag
*/
class SystemTagManagerTest extends TestCase {
-
/**
* @var ISystemTagManager
**/
* @package Test\SystemTag
*/
class SystemTagObjectMapperTest extends TestCase {
-
/**
* @var ISystemTagManager
**/
$conn = \OC::$server->getDatabaseConnection();
$statement = $conn->prepare(
- 'INSERT INTO `*PREFIX*vcategory_to_object` ' .
- '(`objid`, `categoryid`, `type`) VALUES ' .
- '(?, ?, ?)'
+ 'INSERT INTO `*PREFIX*vcategory_to_object` ' .
+ '(`objid`, `categoryid`, `type`) VALUES ' .
+ '(?, ?, ?)'
);
// insert lots of entries
$logger = $this->createMock(LoggerInterface::class);
$tmpManager = self::invokePrivate(
$this->getManager($logger),
- 'buildFileNameWithSuffix',
+ 'buildFileNameWithSuffix',
['/tmp/myTemporaryFile', '']
);
->expects($this->once())
->method('putContent')
->with($this->callback(
- function ($content) {
- $deps = json_decode($content, true);
- return array_key_exists(__DIR__ . '/data//1.js', $deps)
- && array_key_exists(__DIR__ . '/data//2.js', $deps);
- }))
+ function ($content) {
+ $deps = json_decode($content, true);
+ return array_key_exists(__DIR__ . '/data//1.js', $deps)
+ && array_key_exists(__DIR__ . '/data//2.js', $deps);
+ }))
->willThrowException(new NotPermittedException());
$actual = self::invokePrivate($this->jsCombiner, 'cache', [$path, 'combine.json', $folder]);
* Test moveable mount for mocking
*/
class TestMoveableMountPoint extends Mount\MountPoint implements Mount\MoveableMount {
-
/**
* Move the mount point to $target
*
* @package Test
*/
class UrlGeneratorTest extends \Test\TestCase {
-
/** @var \PHPUnit\Framework\MockObject\MockObject|IConfig */
private $config;
/** @var \PHPUnit\Framework\MockObject\MockObject|IUserSession */
* @package Test\User
*/
class ManagerTest extends TestCase {
-
/** @var IConfig */
private $config;
/** @var EventDispatcherInterface */
* @package Test\User
*/
class UserTest extends TestCase {
-
/** @var EventDispatcherInterface|MockObject */
protected $dispatcher;
}
public function testDeleteWithDifferentHome() {
-
/** @var ObjectHomeMountProvider $homeProvider */
$homeProvider = \OC::$server->get(ObjectHomeMountProvider::class);
$user = $this->createMock(IUser::class);