diff --git a/tests/stubs/doctrine_dbal_driver_exception.php b/tests/stubs/doctrine_dbal_driver_exception.php index df5e40120..cf824a5f5 100644 --- a/tests/stubs/doctrine_dbal_driver_exception.php +++ b/tests/stubs/doctrine_dbal_driver_exception.php @@ -15,7 +15,5 @@ interface Exception extends Throwable * * @return string|null */ - public function getSQLState() - { - } + public function getSQLState(); } diff --git a/tests/stubs/doctrine_dbal_schema_constraint.php b/tests/stubs/doctrine_dbal_schema_constraint.php index 977468928..f47ee1fd1 100644 --- a/tests/stubs/doctrine_dbal_schema_constraint.php +++ b/tests/stubs/doctrine_dbal_schema_constraint.php @@ -12,14 +12,10 @@ interface Constraint { /** @return string */ - public function getName() - { - } + public function getName(); /** @return string */ - public function getQuotedName(AbstractPlatform $platform) - { - } + public function getQuotedName(AbstractPlatform $platform); /** * Returns the names of the referencing table columns @@ -27,9 +23,7 @@ public function getQuotedName(AbstractPlatform $platform) * * @return string[] */ - public function getColumns() - { - } + public function getColumns(); /** * Returns the quoted representation of the column names @@ -43,7 +37,5 @@ public function getColumns() * * @return string[] */ - public function getQuotedColumns(AbstractPlatform $platform) - { - } + public function getQuotedColumns(AbstractPlatform $platform); } diff --git a/tests/stubs/oc.php b/tests/stubs/oc.php index d75dc744e..e7c8d81a6 100644 --- a/tests/stubs/oc.php +++ b/tests/stubs/oc.php @@ -75,78 +75,78 @@ class OC { * the app path list is empty or contains an invalid path */ public static function initPaths(): void - { - } + { + } public static function checkConfig(): void - { - } + { + } public static function checkInstalled(\OC\SystemConfig $systemConfig): void - { - } + { + } public static function checkMaintenanceMode(\OC\SystemConfig $systemConfig): void - { - } + { + } public static function initSession(): void - { - } + { + } /** * @return bool true if the session expiry should only be done by gc instead of an explicit timeout */ public static function hasSessionRelaxedExpiry(): bool - { - } + { + } /** * Try to set some values to the required Nextcloud default */ public static function setRequiredIniValues(): void - { - } + { + } public static function init(): void - { - } + { + } /** * register hooks for the cleanup of cache and bruteforce protection */ public static function registerCleanupHooks(\OC\SystemConfig $systemConfig): void - { - } + { + } /** * register hooks for sharing */ public static function registerShareHooks(\OC\SystemConfig $systemConfig): void - { - } + { + } /** * Handle the request */ public static function handleRequest(): void - { - } + { + } /** * Check login: apache auth, auth token, basic auth */ public static function handleLogin(OCP\IRequest $request): bool - { - } + { + } protected static function handleAuthHeaders(): void - { - } + { + } protected static function tryAppAPILogin(OCP\IRequest $request): bool - { - } + { + } } OC::init(); diff --git a/tests/stubs/oc_appframework_bootstrap_aregistration.php b/tests/stubs/oc_appframework_bootstrap_aregistration.php index 775ffe867..8dd330309 100644 --- a/tests/stubs/oc_appframework_bootstrap_aregistration.php +++ b/tests/stubs/oc_appframework_bootstrap_aregistration.php @@ -13,13 +13,13 @@ */ abstract class ARegistration { public function __construct(string $appId) - { - } + { + } /** * @return string */ public function getAppId(): string - { - } + { + } } diff --git a/tests/stubs/oc_appframework_bootstrap_coordinator.php b/tests/stubs/oc_appframework_bootstrap_coordinator.php index d88c47843..4b438e36f 100644 --- a/tests/stubs/oc_appframework_bootstrap_coordinator.php +++ b/tests/stubs/oc_appframework_bootstrap_coordinator.php @@ -40,22 +40,22 @@ public function __construct( } public function runInitialRegistration(): void - { - } + { + } public function runLazyRegistration(string $appId): void - { - } + { + } public function getRegistrationContext(): ?RegistrationContext - { - } + { + } public function bootApp(string $appId): void - { - } + { + } public function isBootable(string $appId) - { - } + { + } } diff --git a/tests/stubs/oc_appframework_bootstrap_registrationcontext.php b/tests/stubs/oc_appframework_bootstrap_registrationcontext.php index a409347c9..ce20857ec 100644 --- a/tests/stubs/oc_appframework_bootstrap_registrationcontext.php +++ b/tests/stubs/oc_appframework_bootstrap_registrationcontext.php @@ -48,440 +48,440 @@ class RegistrationContext { public function __construct(LoggerInterface $logger) - { - } + { + } public function for(string $appId): IRegistrationContext - { - } + { + } /** * @psalm-param class-string $capability */ public function registerCapability(string $appId, string $capability): void - { - } + { + } /** * @psalm-param class-string $reporterClass */ public function registerCrashReporter(string $appId, string $reporterClass): void - { - } + { + } /** * @psalm-param class-string $panelClass */ public function registerDashboardPanel(string $appId, string $panelClass): void - { - } + { + } public function registerService(string $appId, string $name, callable $factory, bool $shared = true): void - { - } + { + } public function registerServiceAlias(string $appId, string $alias, string $target): void - { - } + { + } public function registerParameter(string $appId, string $name, $value): void - { - } + { + } public function registerEventListener(string $appId, string $event, string $listener, int $priority = 0): void - { - } + { + } /** * @psalm-param class-string $class */ public function registerMiddleware(string $appId, string $class, bool $global): void - { - } + { + } public function registerSearchProvider(string $appId, string $class) - { - } + { + } public function registerAlternativeLogin(string $appId, string $class): void - { - } + { + } public function registerInitialState(string $appId, string $class): void - { - } + { + } public function registerWellKnown(string $appId, string $class): void - { - } + { + } public function registerSpeechToTextProvider(string $appId, string $class): void - { - } + { + } public function registerTextProcessingProvider(string $appId, string $class): void - { - } + { + } public function registerTextToImageProvider(string $appId, string $class): void - { - } + { + } public function registerTemplateProvider(string $appId, string $class): void - { - } + { + } public function registerTranslationProvider(string $appId, string $class): void - { - } + { + } public function registerNotifierService(string $appId, string $class): void - { - } + { + } public function registerTwoFactorProvider(string $appId, string $class): void - { - } + { + } public function registerPreviewProvider(string $appId, string $class, string $mimeTypeRegex): void - { - } + { + } public function registerCalendarProvider(string $appId, string $class): void - { - } + { + } public function registerReferenceProvider(string $appId, string $class): void - { - } + { + } /** * @psalm-param class-string $actionClass */ public function registerProfileLinkAction(string $appId, string $actionClass): void - { - } + { + } /** * @psalm-param class-string $backend */ public function registerTalkBackend(string $appId, string $backend) - { - } + { + } public function registerCalendarResourceBackend(string $appId, string $class) - { - } + { + } public function registerCalendarRoomBackend(string $appId, string $class) - { - } + { + } /** * @psalm-param class-string $class */ public function registerTeamResourceProvider(string $appId, string $class) - { - } + { + } /** * @psalm-param class-string $migratorClass */ public function registerUserMigrator(string $appId, string $migratorClass): void - { - } + { + } public function registerSensitiveMethods(string $appId, string $class, array $methods): void - { - } + { + } public function registerPublicShareTemplateProvider(string $appId, string $class): void - { - } + { + } /** * @psalm-param class-string $setupCheckClass */ public function registerSetupCheck(string $appId, string $setupCheckClass): void - { - } + { + } /** * @psalm-param class-string $declarativeSettingsClass */ public function registerDeclarativeSettings(string $appId, string $declarativeSettingsClass): void - { - } + { + } /** * @psalm-param class-string<\OCP\TaskProcessing\IProvider> $declarativeSettingsClass */ public function registerTaskProcessingProvider(string $appId, string $taskProcessingProviderClass): void - { - } + { + } /** * @psalm-param class-string<\OCP\TaskProcessing\ITaskType> $declarativeSettingsClass */ public function registerTaskProcessingTaskType(string $appId, string $taskProcessingTaskTypeClass) - { - } + { + } /** * @psalm-param class-string<\OCP\Files\Conversion\IConversionProvider> $class */ public function registerFileConversionProvider(string $appId, string $class): void - { - } + { + } /** * @psalm-param class-string $migratorClass */ public function registerMailProvider(string $appId, string $class): void - { - } + { + } /** * @psalm-param class-string $configLexiconClass */ public function registerConfigLexicon(string $appId, string $configLexiconClass): void - { - } + { + } /** * @param App[] $apps */ public function delegateCapabilityRegistrations(array $apps): void - { - } + { + } /** * @param App[] $apps */ public function delegateCrashReporterRegistrations(array $apps, Registry $registry): void - { - } + { + } public function delegateDashboardPanelRegistrations(IManager $dashboardManager): void - { - } + { + } public function delegateEventListenerRegistrations(IEventDispatcher $eventDispatcher): void - { - } + { + } /** * @param App[] $apps */ public function delegateContainerRegistrations(array $apps): void - { - } + { + } /** * @return MiddlewareRegistration[] */ public function getMiddlewareRegistrations(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getSearchProviders(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getAlternativeLogins(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getInitialStates(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getWellKnownHandlers(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getSpeechToTextProviders(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getTextProcessingProviders(): array - { - } + { + } /** * @return ServiceRegistration<\OCP\TextToImage\IProvider>[] */ public function getTextToImageProviders(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getTemplateProviders(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getTranslationProviders(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getNotifierServices(): array - { - } + { + } /** * @return ServiceRegistration<\OCP\Authentication\TwoFactorAuth\IProvider>[] */ public function getTwoFactorProviders(): array - { - } + { + } /** * @return PreviewProviderRegistration[] */ public function getPreviewProviders(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getCalendarProviders(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getReferenceProviders(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getProfileLinkActions(): array - { - } + { + } /** * @return ServiceRegistration|null * @psalm-return ServiceRegistration|null */ public function getTalkBackendRegistration(): ?ServiceRegistration - { - } + { + } /** * @return ServiceRegistration[] * @psalm-return ServiceRegistration[] */ public function getCalendarResourceBackendRegistrations(): array - { - } + { + } /** * @return ServiceRegistration[] * @psalm-return ServiceRegistration[] */ public function getCalendarRoomBackendRegistrations(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getUserMigrators(): array - { - } + { + } /** * @return ParameterRegistration[] */ public function getSensitiveMethods(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getPublicShareTemplateProviders(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getSetupChecks(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getTeamResourceProviders(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getDeclarativeSettings(): array - { - } + { + } /** * @return ServiceRegistration<\OCP\TaskProcessing\IProvider>[] */ public function getTaskProcessingProviders(): array - { - } + { + } /** * @return ServiceRegistration<\OCP\TaskProcessing\ITaskType>[] */ public function getTaskProcessingTaskTypes(): array - { - } + { + } /** * @return ServiceRegistration<\OCP\Files\Conversion\IConversionProvider>[] */ public function getFileConversionProviders(): array - { - } + { + } /** * @return ServiceRegistration[] */ public function getMailProviders(): array - { - } + { + } /** * returns IConfigLexicon registered by the app. @@ -492,6 +492,6 @@ public function getMailProviders(): array * @return ILexicon|null */ public function getConfigLexicon(string $appId): ?ILexicon - { - } + { + } } diff --git a/tests/stubs/oc_appframework_bootstrap_serviceregistration.php b/tests/stubs/oc_appframework_bootstrap_serviceregistration.php index 5c7b71de4..5b7df1427 100644 --- a/tests/stubs/oc_appframework_bootstrap_serviceregistration.php +++ b/tests/stubs/oc_appframework_bootstrap_serviceregistration.php @@ -17,13 +17,13 @@ class ServiceRegistration extends ARegistration { * @psalm-param class-string $service */ public function __construct(string $appId, string $service) - { - } + { + } /** * @psalm-return class-string */ public function getService(): string - { - } + { + } } diff --git a/tests/stubs/oc_appframework_middleware_security_exceptions_notloggedinexception.php b/tests/stubs/oc_appframework_middleware_security_exceptions_notloggedinexception.php index 5ea2900e0..8f9c71526 100644 --- a/tests/stubs/oc_appframework_middleware_security_exceptions_notloggedinexception.php +++ b/tests/stubs/oc_appframework_middleware_security_exceptions_notloggedinexception.php @@ -17,6 +17,6 @@ */ class NotLoggedInException extends SecurityException { public function __construct() - { - } + { + } } diff --git a/tests/stubs/oc_appframework_utility_simplecontainer.php b/tests/stubs/oc_appframework_utility_simplecontainer.php index 214b6cd19..d95e086c8 100644 --- a/tests/stubs/oc_appframework_utility_simplecontainer.php +++ b/tests/stubs/oc_appframework_utility_simplecontainer.php @@ -29,8 +29,8 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer { public static bool $useLazyObjects = false; public function __construct() - { - } + { + } /** * @template T @@ -41,36 +41,36 @@ public function __construct() * @psalm-return (S is class-string ? T : mixed) */ public function get(string $id): mixed - { - } + { + } public function has(string $id): bool - { - } + { + } /** * @inheritDoc * @param list $chain */ public function resolve($name, array $chain = []) - { - } + { + } /** * @inheritDoc * @param list $chain */ public function query(string $name, bool $autoload = true, array $chain = []) - { - } + { + } /** * @param string $name * @param mixed $value */ public function registerParameter($name, $value) - { - } + { + } /** * The given closure is call the first time the given service is queried. @@ -82,8 +82,8 @@ public function registerParameter($name, $value) * @param bool $shared */ public function registerService($name, Closure $closure, $shared = true) - { - } + { + } /** * Shortcut for returning a service from a service under a different key, @@ -93,48 +93,48 @@ public function registerService($name, Closure $closure, $shared = true) * @param string $target the target that should be resolved instead */ public function registerAlias($alias, $target): void - { - } + { + } protected function registerDeprecatedAlias(string $alias, string $target): void - { - } + { + } /** * @param string $name * @return string */ protected function sanitizeName($name) - { - } + { + } /** * @deprecated 20.0.0 use \Psr\Container\ContainerInterface::has */ public function offsetExists($id): bool - { - } + { + } /** * @deprecated 20.0.0 use \Psr\Container\ContainerInterface::get * @return mixed */ #[\ReturnTypeWillChange] - public function offsetGet($id) - { - } + public function offsetGet($id) + { + } /** * @deprecated 20.0.0 use \OCP\IContainer::registerService */ public function offsetSet($offset, $value): void - { - } + { + } /** * @deprecated 20.0.0 */ public function offsetUnset($offset): void - { - } + { + } } diff --git a/tests/stubs/oc_core_command_base.php b/tests/stubs/oc_core_command_base.php index b60f7fae4..d5c07f7fe 100644 --- a/tests/stubs/oc_core_command_base.php +++ b/tests/stubs/oc_core_command_base.php @@ -26,40 +26,40 @@ class Base extends Command implements CompletionAwareInterface { protected string $defaultOutputFormat = self::OUTPUT_FORMAT_PLAIN; protected function configure() - { - } + { + } protected function writeArrayInOutputFormat(InputInterface $input, OutputInterface $output, iterable $items, string $prefix = ' - '): void - { - } + { + } protected function writeTableInOutputFormat(InputInterface $input, OutputInterface $output, array $items): void - { - } + { + } protected function writeStreamingTableInOutputFormat(InputInterface $input, OutputInterface $output, \Iterator $items, int $tableGroupSize): void - { - } + { + } protected function writeStreamingJsonArray(InputInterface $input, OutputInterface $output, \Iterator $items): void - { - } + { + } public function chunkIterator(\Iterator $iterator, int $count): \Iterator - { - } + { + } /** * @param mixed $item */ protected function writeMixedInOutputFormat(InputInterface $input, OutputInterface $output, $item) - { - } + { + } protected function valueToString($value, bool $returnNull = true): ?string - { - } + { + } /** * Throw InterruptedException when interrupted by user @@ -67,8 +67,8 @@ protected function valueToString($value, bool $returnNull = true): ?string * @throws InterruptedException */ protected function abortIfInterrupted() - { - } + { + } /** * Changes the status of the command to "interrupted" if ctrl-c has been pressed @@ -76,12 +76,12 @@ protected function abortIfInterrupted() * Gives a chance to the command to properly terminate what it's doing */ public function cancelOperation(): void - { - } + { + } public function run(InputInterface $input, OutputInterface $output): int - { - } + { + } /** * @param string $optionName @@ -89,8 +89,8 @@ public function run(InputInterface $input, OutputInterface $output): int * @return string[] */ public function completeOptionValues($optionName, CompletionContext $context) - { - } + { + } /** * @param string $argumentName @@ -98,6 +98,6 @@ public function completeOptionValues($optionName, CompletionContext $context) * @return string[] */ public function completeArgumentValues($argumentName, CompletionContext $context) - { - } + { + } } diff --git a/tests/stubs/oc_db_connection.php b/tests/stubs/oc_db_connection.php index 3bb1b9cc1..cf8ccf378 100644 --- a/tests/stubs/oc_db_connection.php +++ b/tests/stubs/oc_db_connection.php @@ -106,37 +106,37 @@ class Connection extends PrimaryReadReplicaConnection { * @throws \Exception */ public function __construct(private array $params, Driver $driver, ?Configuration $config = null, ?EventManager $eventManager = null) - { - } + { + } /** * @return IDBConnection[] */ public function getShardConnections(): array - { - } + { + } /** * @throws Exception */ public function connect($connectionName = null) - { - } + { + } protected function performConnect(?string $connectionName = null): bool - { - } + { + } public function getStats(): array - { - } + { + } /** * Returns a QueryBuilder for the connection. */ public function getQueryBuilder(): IQueryBuilder - { - } + { + } /** * Gets the QueryBuilder for the connection. @@ -145,8 +145,8 @@ public function getQueryBuilder(): IQueryBuilder * @deprecated 8.0.0 please use $this->getQueryBuilder() instead */ public function createQueryBuilder() - { - } + { + } /** * Gets the ExpressionBuilder for the connection. @@ -155,8 +155,8 @@ public function createQueryBuilder() * @deprecated 8.0.0 please use $this->getQueryBuilder()->expr() instead */ public function getExpressionBuilder() - { - } + { + } /** * Get the file and line that called the method where `getCallerBacktrace()` was used @@ -164,15 +164,15 @@ public function getExpressionBuilder() * @return string */ protected function getCallerBacktrace() - { - } + { + } /** * @return string */ public function getPrefix() - { - } + { + } /** * Prepares an SQL statement. @@ -185,8 +185,8 @@ public function getPrefix() * @throws Exception */ public function prepare($sql, $limit = null, $offset = null): Statement - { - } + { + } /** * Executes an, optionally parametrized, SQL query. @@ -204,15 +204,15 @@ public function prepare($sql, $limit = null, $offset = null): Statement * @throws \Doctrine\DBAL\Exception */ public function executeQuery(string $sql, array $params = [], $types = [], ?QueryCacheProfile $qcp = null): Result - { - } + { + } /** * @throws Exception */ public function executeUpdate(string $sql, array $params = [], array $types = []): int - { - } + { + } /** * Executes an SQL INSERT/UPDATE/DELETE query with the given parameters @@ -229,12 +229,12 @@ public function executeUpdate(string $sql, array $params = [], array $types = [] * @throws \Doctrine\DBAL\Exception */ public function executeStatement($sql, array $params = [], array $types = []): int - { - } + { + } protected function logQueryToFile(string $sql, array $params): void - { - } + { + } /** * Returns the ID of the last inserted row, or the last value from a sequence object, @@ -250,16 +250,16 @@ protected function logQueryToFile(string $sql, array $params): void * @throws Exception */ public function lastInsertId($name = null): int - { - } + { + } /** * @internal * @throws Exception */ public function realLastInsertId($seqName = null) - { - } + { + } /** * Insert a row if the matching row does not exists. To accomplish proper race condition avoidance @@ -276,12 +276,12 @@ public function realLastInsertId($seqName = null) * @deprecated 15.0.0 - use unique index and "try { $db->insert() } catch (UniqueConstraintViolationException $e) {}" instead, because it is more reliable and does not have the risk for deadlocks - see https://github.com/nextcloud/server/pull/12371 */ public function insertIfNotExist($table, $input, ?array $compare = null) - { - } + { + } public function insertIgnoreConflict(string $table, array $values): int - { - } + { + } /** * Insert or update a row value @@ -295,8 +295,8 @@ public function insertIgnoreConflict(string $table, array $values): int * @throws PreConditionNotMetException */ public function setValues(string $table, array $keys, array $values, array $updatePreconditionValues = []): int - { - } + { + } /** * Create an exclusive read+write lock on a table @@ -308,8 +308,8 @@ public function setValues(string $table, array $keys, array $values, array $upda * @since 9.1.0 */ public function lockTable($tableName) - { - } + { + } /** * Release a previous acquired lock again @@ -318,8 +318,8 @@ public function lockTable($tableName) * @since 9.1.0 */ public function unlockTable() - { - } + { + } /** * returns the error code and message as a string for logging @@ -327,16 +327,16 @@ public function unlockTable() * @return string */ public function getError() - { - } + { + } public function errorCode() - { - } + { + } public function errorInfo() - { - } + { + } /** * Drop a table from the database if it exists @@ -346,8 +346,8 @@ public function errorInfo() * @throws Exception */ public function dropTable($table) - { - } + { + } /** * Truncate a table data if it exists @@ -358,8 +358,8 @@ public function dropTable($table) * @throws Exception */ public function truncateTable(string $table, bool $cascade) - { - } + { + } /** * Check if a table exists @@ -370,12 +370,12 @@ public function truncateTable(string $table, bool $cascade) * @throws Exception */ public function tableExists($table) - { - } + { + } protected function finishQuery(string $statement): string - { - } + { + } // internal use /** @@ -383,8 +383,8 @@ protected function finishQuery(string $statement): string * @return string */ protected function replaceTablePrefix($statement) - { - } + { + } /** * Check if a transaction is active @@ -393,8 +393,8 @@ protected function replaceTablePrefix($statement) * @since 8.2.0 */ public function inTransaction() - { - } + { + } /** * Escape a parameter to be used in a LIKE query @@ -403,8 +403,8 @@ public function inTransaction() * @return string */ public function escapeLikeParameter($param) - { - } + { + } /** * Check whether or not the current database support 4byte wide unicode @@ -413,8 +413,8 @@ public function escapeLikeParameter($param) * @since 11.0.0 */ public function supports4ByteText() - { - } + { + } /** @@ -424,8 +424,8 @@ public function supports4ByteText() * @throws Exception */ public function createSchema() - { - } + { + } /** * Migrate the database to the given schema @@ -438,35 +438,35 @@ public function createSchema() * @return string|null Returns a string only if $dryRun is true. */ public function migrateToSchema(Schema $toSchema, bool $dryRun = false) - { - } + { + } public function beginTransaction() - { - } + { + } public function commit() - { - } + { + } public function rollBack() - { - } + { + } /** * @return IDBConnection::PLATFORM_MYSQL|IDBConnection::PLATFORM_ORACLE|IDBConnection::PLATFORM_POSTGRES|IDBConnection::PLATFORM_SQLITE|IDBConnection::PLATFORM_MARIADB */ public function getDatabaseProvider(bool $strict = false): string - { - } + { + } /** * @internal Should only be used inside the QueryBuilder, ExpressionBuilder and FunctionBuilder * All apps and API code should not need this and instead use provided functionality from the above. */ public function getServerVersion(): string - { - } + { + } /** * Log a database exception if enabled @@ -475,14 +475,14 @@ public function getServerVersion(): string * @return void */ public function logDatabaseException(\Exception $exception): void - { - } + { + } public function getShardDefinition(string $name): ?ShardDefinition - { - } + { + } public function getCrossShardMoveHelper(): CrossShardMoveHelper - { - } + { + } } diff --git a/tests/stubs/oc_db_connectionadapter.php b/tests/stubs/oc_db_connectionadapter.php index 29ea3c19d..520125b08 100644 --- a/tests/stubs/oc_db_connectionadapter.php +++ b/tests/stubs/oc_db_connectionadapter.php @@ -24,159 +24,159 @@ */ class ConnectionAdapter implements IDBConnection { public function __construct(Connection $inner) - { - } + { + } public function getQueryBuilder(): IQueryBuilder - { - } + { + } public function prepare($sql, $limit = null, $offset = null): IPreparedStatement - { - } + { + } public function executeQuery(string $sql, array $params = [], $types = []): IResult - { - } + { + } public function executeUpdate(string $sql, array $params = [], array $types = []): int - { - } + { + } public function executeStatement($sql, array $params = [], array $types = []): int - { - } + { + } public function lastInsertId(string $table): int - { - } + { + } public function insertIfNotExist(string $table, array $input, ?array $compare = null) - { - } + { + } public function insertIgnoreConflict(string $table, array $values): int - { - } + { + } public function setValues($table, array $keys, array $values, array $updatePreconditionValues = []): int - { - } + { + } public function lockTable($tableName): void - { - } + { + } public function unlockTable(): void - { - } + { + } public function beginTransaction(): void - { - } + { + } public function inTransaction(): bool - { - } + { + } public function commit(): void - { - } + { + } public function rollBack(): void - { - } + { + } public function getError(): string - { - } + { + } public function errorCode() - { - } + { + } public function errorInfo() - { - } + { + } public function connect(): bool - { - } + { + } public function close(): void - { - } + { + } public function quote($input, $type = IQueryBuilder::PARAM_STR) - { - } + { + } /** * @todo we are leaking a 3rdparty type here */ public function getDatabasePlatform(): AbstractPlatform - { - } + { + } public function dropTable(string $table): void - { - } + { + } public function truncateTable(string $table, bool $cascade): void - { - } + { + } public function tableExists(string $table): bool - { - } + { + } public function escapeLikeParameter(string $param): string - { - } + { + } public function supports4ByteText(): bool - { - } + { + } /** * @todo leaks a 3rdparty type */ public function createSchema(): Schema - { - } + { + } public function migrateToSchema(Schema $toSchema): void - { - } + { + } public function getInner(): Connection - { - } + { + } /** * @return self::PLATFORM_MYSQL|self::PLATFORM_ORACLE|self::PLATFORM_POSTGRES|self::PLATFORM_SQLITE|self::PLATFORM_MARIADB */ public function getDatabaseProvider(bool $strict = false): string - { - } + { + } /** * @internal Should only be used inside the QueryBuilder, ExpressionBuilder and FunctionBuilder * All apps and API code should not need this and instead use provided functionality from the above. */ public function getServerVersion(): string - { - } + { + } public function logDatabaseException(\Exception $exception) - { - } + { + } public function getShardDefinition(string $name): ?ShardDefinition - { - } + { + } public function getCrossShardMoveHelper(): CrossShardMoveHelper - { - } + { + } } diff --git a/tests/stubs/oc_db_querybuilder_querybuilder.php b/tests/stubs/oc_db_querybuilder_querybuilder.php index 3ca2f6256..0e165608e 100644 --- a/tests/stubs/oc_db_querybuilder_querybuilder.php +++ b/tests/stubs/oc_db_querybuilder_querybuilder.php @@ -19,12 +19,14 @@ use OC\DB\QueryBuilder\FunctionBuilder\SqliteFunctionBuilder; use OC\SystemConfig; use OCP\DB\IResult; +use OCP\DB\QueryBuilder\ConflictResolutionMode; use OCP\DB\QueryBuilder\ICompositeExpression; use OCP\DB\QueryBuilder\ILiteral; use OCP\DB\QueryBuilder\IParameter; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\DB\QueryBuilder\IQueryFunction; use OCP\IDBConnection; +use Override; use Psr\Log\LoggerInterface; class QueryBuilder implements IQueryBuilder { @@ -38,8 +40,8 @@ class QueryBuilder implements IQueryBuilder { * @param SystemConfig $systemConfig */ public function __construct(ConnectionAdapter $connection, SystemConfig $systemConfig, LoggerInterface $logger) - { - } + { + } /** * Enable/disable automatic prefixing of table names with the oc_ prefix @@ -49,8 +51,8 @@ public function __construct(ConnectionAdapter $connection, SystemConfig $systemC * @since 8.2.0 */ public function automaticTablePrefix($enabled) - { - } + { + } /** * Gets an ExpressionBuilder used for object-oriented construction of query expressions. @@ -69,8 +71,8 @@ public function automaticTablePrefix($enabled) * @return \OCP\DB\QueryBuilder\IExpressionBuilder */ public function expr() - { - } + { + } /** * Gets an FunctionBuilder used for object-oriented construction of query functions. @@ -89,8 +91,8 @@ public function expr() * @return \OCP\DB\QueryBuilder\IFunctionBuilder */ public function func() - { - } + { + } /** * Gets the type of the currently built query. @@ -98,8 +100,8 @@ public function func() * @return integer */ public function getType() - { - } + { + } /** * Gets the associated DBAL Connection for this query builder. @@ -107,8 +109,8 @@ public function getType() * @return \OCP\IDBConnection */ public function getConnection() - { - } + { + } /** * Gets the state of this query builder instance. @@ -118,16 +120,16 @@ public function getConnection() * and we can not fix this in our wrapper. */ public function getState() - { - } + { + } public function executeQuery(?IDBConnection $connection = null): IResult - { - } + { + } public function executeStatement(?IDBConnection $connection = null): int - { - } + { + } /** @@ -143,8 +145,8 @@ public function executeStatement(?IDBConnection $connection = null): int * @return string The SQL query string. */ public function getSQL() - { - } + { + } /** * Sets a query parameter for the query being constructed. @@ -164,8 +166,8 @@ public function getSQL() * @return $this This QueryBuilder instance. */ public function setParameter($key, $value, $type = null) - { - } + { + } /** * Sets a collection of query parameters for the query being constructed. @@ -187,8 +189,8 @@ public function setParameter($key, $value, $type = null) * @return $this This QueryBuilder instance. */ public function setParameters(array $params, array $types = []) - { - } + { + } /** * Gets all defined query parameters for the query being constructed indexed by parameter index or name. @@ -196,8 +198,8 @@ public function setParameters(array $params, array $types = []) * @return array The currently defined query parameters indexed by parameter index or name. */ public function getParameters() - { - } + { + } /** * Gets a (previously set) query parameter of the query being constructed. @@ -207,8 +209,8 @@ public function getParameters() * @return mixed The value of the bound parameter. */ public function getParameter($key) - { - } + { + } /** * Gets all defined query parameter types for the query being constructed indexed by parameter index or name. @@ -216,8 +218,8 @@ public function getParameter($key) * @return array The currently defined query parameter types indexed by parameter index or name. */ public function getParameterTypes() - { - } + { + } /** * Gets a (previously set) query parameter type of the query being constructed. @@ -227,8 +229,8 @@ public function getParameterTypes() * @return mixed The value of the bound parameter type. */ public function getParameterType($key) - { - } + { + } /** * Sets the position of the first result to retrieve (the "offset"). @@ -238,8 +240,8 @@ public function getParameterType($key) * @return $this This QueryBuilder instance. */ public function setFirstResult($firstResult) - { - } + { + } /** * Gets the position of the first result the query object was set to retrieve (the "offset"). @@ -248,8 +250,8 @@ public function setFirstResult($firstResult) * @return int The position of the first result. */ public function getFirstResult() - { - } + { + } /** * Sets the maximum number of results to retrieve (the "limit"). @@ -263,8 +265,8 @@ public function getFirstResult() * @return $this This QueryBuilder instance. */ public function setMaxResults($maxResults) - { - } + { + } /** * Gets the maximum number of results the query object was set to retrieve (the "limit"). @@ -273,8 +275,8 @@ public function setMaxResults($maxResults) * @return int|null The maximum number of results. */ public function getMaxResults() - { - } + { + } /** * Specifies an item that is to be returned in the query result. @@ -292,8 +294,8 @@ public function getMaxResults() * '@return $this This QueryBuilder instance. */ public function select(...$selects) - { - } + { + } /** * Specifies an item that is to be returned with a different name in the query result. @@ -311,8 +313,8 @@ public function select(...$selects) * @return $this This QueryBuilder instance. */ public function selectAlias($select, $alias) - { - } + { + } /** * Specifies an item that is to be returned uniquely in the query result. @@ -328,8 +330,8 @@ public function selectAlias($select, $alias) * @return $this This QueryBuilder instance. */ public function selectDistinct($select) - { - } + { + } /** * Adds an item that is to be returned in the query result. @@ -347,12 +349,12 @@ public function selectDistinct($select) * @return $this This QueryBuilder instance. */ public function addSelect(...$selects) - { - } + { + } public function getOutputColumns(): array - { - } + { + } /** * Turns the query being built into a bulk delete query that ranges over @@ -372,8 +374,8 @@ public function getOutputColumns(): array * @since 30.0.0 Alias is deprecated and will no longer be used with the next Doctrine/DBAL update */ public function delete($delete = null, $alias = null) - { - } + { + } /** * Turns the query being built into a bulk update query that ranges over @@ -393,8 +395,8 @@ public function delete($delete = null, $alias = null) * @since 30.0.0 Alias is deprecated and will no longer be used with the next Doctrine/DBAL update */ public function update($update = null, $alias = null) - { - } + { + } /** * Turns the query being built into an insert query that inserts into @@ -416,8 +418,8 @@ public function update($update = null, $alias = null) * @return $this This QueryBuilder instance. */ public function insert($insert = null) - { - } + { + } /** * Creates and adds a query root corresponding to the table identified by the @@ -435,8 +437,8 @@ public function insert($insert = null) * @return $this This QueryBuilder instance. */ public function from($from, $alias = null) - { - } + { + } /** * Creates and adds a join to the query. @@ -456,8 +458,8 @@ public function from($from, $alias = null) * @return $this This QueryBuilder instance. */ public function join($fromAlias, $join, $alias, $condition = null) - { - } + { + } /** * Creates and adds a join to the query. @@ -477,8 +479,8 @@ public function join($fromAlias, $join, $alias, $condition = null) * @return $this This QueryBuilder instance. */ public function innerJoin($fromAlias, $join, $alias, $condition = null) - { - } + { + } /** * Creates and adds a left join to the query. @@ -498,8 +500,8 @@ public function innerJoin($fromAlias, $join, $alias, $condition = null) * @return $this This QueryBuilder instance. */ public function leftJoin($fromAlias, $join, $alias, $condition = null) - { - } + { + } /** * Creates and adds a right join to the query. @@ -519,8 +521,8 @@ public function leftJoin($fromAlias, $join, $alias, $condition = null) * @return $this This QueryBuilder instance. */ public function rightJoin($fromAlias, $join, $alias, $condition = null) - { - } + { + } /** * Sets a new value for a column in a bulk update query. @@ -538,8 +540,8 @@ public function rightJoin($fromAlias, $join, $alias, $condition = null) * @return $this This QueryBuilder instance. */ public function set($key, $value) - { - } + { + } /** * Specifies one or more restrictions to the query result. @@ -569,8 +571,8 @@ public function set($key, $value) * @return $this This QueryBuilder instance. */ public function where(...$predicates) - { - } + { + } /** * Adds one or more restrictions to the query results, forming a logical @@ -591,8 +593,8 @@ public function where(...$predicates) * @see where() */ public function andWhere(...$where) - { - } + { + } /** * Adds one or more restrictions to the query results, forming a logical @@ -613,8 +615,8 @@ public function andWhere(...$where) * @see where() */ public function orWhere(...$where) - { - } + { + } /** * Specifies a grouping over the results of the query. @@ -632,8 +634,8 @@ public function orWhere(...$where) * @return $this This QueryBuilder instance. */ public function groupBy(...$groupBys) - { - } + { + } /** * Adds a grouping expression to the query. @@ -651,8 +653,8 @@ public function groupBy(...$groupBys) * @return $this This QueryBuilder instance. */ public function addGroupBy(...$groupBy) - { - } + { + } /** * Sets a value for a column in an insert query. @@ -674,8 +676,8 @@ public function addGroupBy(...$groupBy) * @return $this This QueryBuilder instance. */ public function setValue($column, $value) - { - } + { + } /** * Specifies values for an insert query indexed by column names. @@ -697,8 +699,8 @@ public function setValue($column, $value) * @return $this This QueryBuilder instance. */ public function values(array $values) - { - } + { + } /** * Specifies a restriction over the groups of the query. @@ -709,8 +711,8 @@ public function values(array $values) * @return $this This QueryBuilder instance. */ public function having(...$having) - { - } + { + } /** * Adds a restriction over the groups of the query, forming a logical @@ -721,8 +723,8 @@ public function having(...$having) * @return $this This QueryBuilder instance. */ public function andHaving(...$having) - { - } + { + } /** * Adds a restriction over the groups of the query, forming a logical @@ -733,8 +735,8 @@ public function andHaving(...$having) * @return $this This QueryBuilder instance. */ public function orHaving(...$having) - { - } + { + } /** * Specifies an ordering for the query results. @@ -746,8 +748,8 @@ public function orHaving(...$having) * @return $this This QueryBuilder instance. */ public function orderBy($sort, $order = null) - { - } + { + } /** * Adds an ordering to the query results. @@ -758,8 +760,8 @@ public function orderBy($sort, $order = null) * @return $this This QueryBuilder instance. */ public function addOrderBy($sort, $order = null) - { - } + { + } /** * Gets a query part by its name. @@ -771,8 +773,8 @@ public function addOrderBy($sort, $order = null) * and we can not fix this in our wrapper. Please track the details you need, outside the object. */ public function getQueryPart($queryPartName) - { - } + { + } /** * Gets all query parts. @@ -782,8 +784,8 @@ public function getQueryPart($queryPartName) * and we can not fix this in our wrapper. Please track the details you need, outside the object. */ public function getQueryParts() - { - } + { + } /** * Resets SQL parts. @@ -795,8 +797,8 @@ public function getQueryParts() * and we can not fix this in our wrapper. Please create a new IQueryBuilder instead. */ public function resetQueryParts($queryPartNames = null) - { - } + { + } /** * Resets a single SQL part. @@ -808,8 +810,8 @@ public function resetQueryParts($queryPartNames = null) * and we can not fix this in our wrapper. Please create a new IQueryBuilder instead. */ public function resetQueryPart($queryPartName) - { - } + { + } /** * Creates a new named parameter and bind the value $value to it. @@ -841,8 +843,8 @@ public function resetQueryPart($queryPartName) * @return IParameter the placeholder name used. */ public function createNamedParameter($value, $type = IQueryBuilder::PARAM_STR, $placeHolder = null) - { - } + { + } /** * Creates a new positional parameter and bind the given value to it. @@ -867,8 +869,8 @@ public function createNamedParameter($value, $type = IQueryBuilder::PARAM_STR, $ * @return IParameter */ public function createPositionalParameter($value, $type = IQueryBuilder::PARAM_STR) - { - } + { + } /** * Creates a new parameter @@ -887,8 +889,8 @@ public function createPositionalParameter($value, $type = IQueryBuilder::PARAM_S * @return IParameter */ public function createParameter($name) - { - } + { + } /** * Creates a new function @@ -914,8 +916,8 @@ public function createParameter($name) * @return IQueryFunction */ public function createFunction($call) - { - } + { + } /** * Used to get the id of the last inserted element @@ -923,8 +925,8 @@ public function createFunction($call) * @throws \BadMethodCallException When being called before an insert query has been run. */ public function getLastInsertId(): int - { - } + { + } /** * Returns the table name quoted and with database prefix as needed by the implementation @@ -933,8 +935,8 @@ public function getLastInsertId(): int * @return string */ public function getTableName($table) - { - } + { + } /** * Returns the table name with database prefix as needed by the implementation @@ -945,8 +947,8 @@ public function getTableName($table) * @return string */ public function prefixTableName(string $table): string - { - } + { + } /** * Returns the column name quoted and with table alias prefix as needed by the implementation @@ -956,8 +958,8 @@ public function prefixTableName(string $table): string * @return string */ public function getColumnName($column, $tableAlias = '') - { - } + { + } /** * Returns the column name quoted and with table alias prefix as needed by the implementation @@ -966,19 +968,23 @@ public function getColumnName($column, $tableAlias = '') * @return string */ public function quoteAlias($alias) - { - } + { + } public function escapeLikeParameter(string $parameter): string - { - } + { + } public function hintShardKey(string $column, mixed $value, bool $overwrite = false): self - { - } + { + } public function runAcrossAllShards(): self - { - } + { + } + #[Override] + public function forUpdate(ConflictResolutionMode $conflictResolutionMode = ConflictResolutionMode::Ordinary): self + { + } } diff --git a/tests/stubs/oc_db_schemawrapper.php b/tests/stubs/oc_db_schemawrapper.php index 3304354dd..e76c9de4d 100644 --- a/tests/stubs/oc_db_schemawrapper.php +++ b/tests/stubs/oc_db_schemawrapper.php @@ -25,16 +25,16 @@ class SchemaWrapper implements ISchemaWrapper { protected $tablesToDelete = []; public function __construct(Connection $connection, ?Schema $schema = null) - { - } + { + } public function getWrappedSchema() - { - } + { + } public function performDropTableCalls() - { - } + { + } /** * Gets all table names @@ -42,8 +42,8 @@ public function performDropTableCalls() * @return array */ public function getTableNamesWithoutPrefix() - { - } + { + } // Overwritten methods @@ -51,8 +51,8 @@ public function getTableNamesWithoutPrefix() * @return array */ public function getTableNames() - { - } + { + } /** * @param string $tableName @@ -61,8 +61,8 @@ public function getTableNames() * @throws \Doctrine\DBAL\Schema\SchemaException */ public function getTable($tableName) - { - } + { + } /** * Does this schema have a table with the given name? @@ -72,8 +72,8 @@ public function getTable($tableName) * @return boolean */ public function hasTable($tableName) - { - } + { + } /** * Creates a new table. @@ -82,8 +82,8 @@ public function hasTable($tableName) * @return \Doctrine\DBAL\Schema\Table */ public function createTable($tableName) - { - } + { + } /** * Drops a table from the schema. @@ -92,8 +92,8 @@ public function createTable($tableName) * @return \Doctrine\DBAL\Schema\Schema */ public function dropTable($tableName) - { - } + { + } /** * Gets all tables of this schema. @@ -101,8 +101,8 @@ public function dropTable($tableName) * @return \Doctrine\DBAL\Schema\Table[] */ public function getTables() - { - } + { + } /** * Gets the DatabasePlatform for the database. @@ -112,10 +112,10 @@ public function getTables() * @throws Exception */ public function getDatabasePlatform() - { - } + { + } public function dropAutoincrementColumn(string $table, string $column): void - { - } + { + } } diff --git a/tests/stubs/oc_files_cache_cache.php b/tests/stubs/oc_files_cache_cache.php index c0614e37e..cb60e5e26 100644 --- a/tests/stubs/oc_files_cache_cache.php +++ b/tests/stubs/oc_files_cache_cache.php @@ -15,6 +15,7 @@ use OC\Files\Search\SearchQuery; use OC\Files\Storage\Wrapper\Encryption; use OC\SystemConfig; +use OCP\Constants; use OCP\DB\Exception; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\EventDispatcher\IEventDispatcher; @@ -66,21 +67,21 @@ class Cache implements ICache { protected IFilesMetadataManager $metadataManager; public function __construct( - private IStorage $storage, - // this constructor is used in to many pleases to easily do proper di - // so instead we group it all together - ?CacheDependencies $dependencies = null - ) - { - } + private IStorage $storage, + // this constructor is used in to many pleases to easily do proper di + // so instead we group it all together + ?CacheDependencies $dependencies = null + ) + { + } protected function getQueryBuilder() - { - } + { + } public function getStorageCache(): Storage - { - } + { + } /** * Get the numeric storage id for this cache's storage @@ -88,8 +89,8 @@ public function getStorageCache(): Storage * @return int */ public function getNumericStorageId() - { - } + { + } /** * get the stored metadata of a file or folder @@ -98,15 +99,15 @@ public function getNumericStorageId() * @return ICacheEntry|false the cache entry as array or false if the file is not found in the cache */ public function get($file) - { - } + { + } /** * Create a CacheEntry from database row */ public static function cacheEntryFromData(array $data, IMimeTypeLoader $mimetypeLoader): CacheEntry - { - } + { + } /** * get the metadata of all files stored in $folder @@ -115,8 +116,8 @@ public static function cacheEntryFromData(array $data, IMimeTypeLoader $mimetype * @return ICacheEntry[] */ public function getFolderContents($folder) - { - } + { + } /** * get the metadata of all files stored in $folder @@ -125,8 +126,8 @@ public function getFolderContents($folder) * @return ICacheEntry[] */ public function getFolderContentsById($fileId) - { - } + { + } /** * insert or update meta data for a file or folder @@ -138,8 +139,8 @@ public function getFolderContentsById($fileId) * @throws \RuntimeException */ public function put($file, array $data) - { - } + { + } /** * insert meta data for a new file or folder @@ -151,8 +152,8 @@ public function put($file, array $data) * @throws \RuntimeException|Exception */ public function insert($file, array $data) - { - } + { + } /** * update the metadata of an existing file or folder in the cache @@ -161,8 +162,8 @@ public function insert($file, array $data) * @param array $data [$key => $value] the metadata to update, only the fields provided in the array will be updated, non-provided values will remain unchanged */ public function update($id, array $data) - { - } + { + } /** * extract query parts and params array from data array @@ -171,8 +172,8 @@ public function update($id, array $data) * @return array */ protected function normalizeData(array $data): array - { - } + { + } /** * get the file id for a file @@ -185,8 +186,8 @@ protected function normalizeData(array $data): array * @return int */ public function getId($file) - { - } + { + } /** * get the id of the parent folder of a file @@ -195,8 +196,8 @@ public function getId($file) * @return int */ public function getParentId($file) - { - } + { + } /** * check if a file is available in the cache @@ -205,8 +206,8 @@ public function getParentId($file) * @return bool */ public function inCache($file) - { - } + { + } /** * remove a file or folder from the cache @@ -216,8 +217,8 @@ public function inCache($file) * @param string $file */ public function remove($file) - { - } + { + } /** * Move a file or folder in the cache @@ -226,8 +227,8 @@ public function remove($file) * @param string $target */ public function move($source, $target) - { - } + { + } /** * Get the storage id and path needed for a move @@ -236,16 +237,16 @@ public function move($source, $target) * @return array [$storageId, $internalPath] */ protected function getMoveInfo($path) - { - } + { + } protected function hasEncryptionWrapper(): bool - { - } + { + } protected function shouldEncrypt(string $targetPath): bool - { - } + { + } /** * Move a file or folder in the cache @@ -257,15 +258,15 @@ protected function shouldEncrypt(string $targetPath): bool * @throws \Exception if the given storages have an invalid id */ public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) - { - } + { + } /** * remove all entries for files that are stored on the storage from the cache */ public function clear() - { - } + { + } /** * Get the scan status of a file @@ -280,8 +281,8 @@ public function clear() * @return int Cache::NOT_FOUND, Cache::PARTIAL, Cache::SHALLOW or Cache::COMPLETE */ public function getStatus($file) - { - } + { + } /** * search for files matching $pattern @@ -290,8 +291,8 @@ public function getStatus($file) * @return ICacheEntry[] an array of cache entries where the name matches the search pattern */ public function search($pattern) - { - } + { + } /** * search for files by mimetype @@ -301,12 +302,12 @@ public function search($pattern) * @return ICacheEntry[] an array of cache entries where the mimetype matches the search */ public function searchByMime($mimetype) - { - } + { + } public function searchQuery(ISearchQuery $query) - { - } + { + } /** * Re-calculate the folder size and the size of all parent folders @@ -314,8 +315,8 @@ public function searchQuery(ISearchQuery $query) * @param array|ICacheEntry|null $data (optional) meta data of the folder */ public function correctFolderSize(string $path, $data = null, bool $isBackgroundScan = false): void - { - } + { + } /** * get the incomplete count that shares parent $folder @@ -324,8 +325,8 @@ public function correctFolderSize(string $path, $data = null, bool $isBackground * @return int */ public function getIncompleteChildrenCount($fileId) - { - } + { + } /** * calculate the size of a folder and set it in the cache @@ -335,8 +336,8 @@ public function getIncompleteChildrenCount($fileId) * @return int|float */ public function calculateFolderSize($path, $entry = null) - { - } + { + } /** @@ -348,8 +349,8 @@ public function calculateFolderSize($path, $entry = null) * @return int|float */ protected function calculateFolderSizeInner(string $path, $entry = null, bool $ignoreUnknown = false) - { - } + { + } /** * get all file ids on the files on the storage @@ -357,8 +358,8 @@ protected function calculateFolderSizeInner(string $path, $entry = null, bool $i * @return int[] */ public function getAll() - { - } + { + } /** * find a folder in the cache which has not been fully scanned @@ -370,8 +371,8 @@ public function getAll() * @return string|false the path of the folder or false when no folder matched */ public function getIncomplete() - { - } + { + } /** * get the path of a file on this storage by it's file id @@ -380,8 +381,8 @@ public function getIncomplete() * @return string|null the path of the file (relative to the storage) or null if a file with the given id does not exists within this cache */ public function getPathById($id) - { - } + { + } /** * get the storage id of the storage for a file and the internal path of the file @@ -393,8 +394,8 @@ public function getPathById($id) * @deprecated 17.0.0 use getPathById() instead */ public static function getById($id) - { - } + { + } /** * normalize the given path @@ -403,8 +404,8 @@ public static function getById($id) * @return string */ public function normalize($path) - { - } + { + } /** * Copy a file or folder in the cache @@ -415,14 +416,14 @@ public function normalize($path) * @return int fileId of copied entry */ public function copyFromCache(ICache $sourceCache, ICacheEntry $sourceEntry, string $targetPath): int - { - } + { + } public function getQueryFilterForStorage(): ISearchOperator - { - } + { + } public function getCacheEntryFromSearchResult(ICacheEntry $rawEntry): ?ICacheEntry - { - } + { + } } diff --git a/tests/stubs/oc_files_cache_cacheentry.php b/tests/stubs/oc_files_cache_cacheentry.php index e60c802b6..b0477f9c0 100644 --- a/tests/stubs/oc_files_cache_cacheentry.php +++ b/tests/stubs/oc_files_cache_cacheentry.php @@ -19,102 +19,102 @@ public function __construct( } public function offsetSet($offset, $value): void - { - } + { + } public function offsetExists($offset): bool - { - } + { + } public function offsetUnset($offset): void - { - } + { + } /** * @return mixed */ #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - } + public function offsetGet($offset) + { + } public function getId() - { - } + { + } public function getStorageId() - { - } + { + } public function getPath() - { - } + { + } public function getName() - { - } + { + } public function getMimeType(): string - { - } + { + } public function getMimePart() - { - } + { + } public function getSize() - { - } + { + } public function getMTime() - { - } + { + } public function getStorageMTime() - { - } + { + } public function getEtag() - { - } + { + } public function getPermissions(): int - { - } + { + } public function isEncrypted() - { - } + { + } public function getMetadataEtag(): ?string - { - } + { + } public function getCreationTime(): ?int - { - } + { + } public function getUploadTime(): ?int - { - } + { + } public function getParentId(): int - { - } + { + } public function getData() - { - } + { + } public function __clone() - { - } + { + } public function getUnencryptedSize(): int - { - } + { + } } diff --git a/tests/stubs/oc_files_mount_manager.php b/tests/stubs/oc_files_mount_manager.php index 49821560a..b8d6fdb90 100644 --- a/tests/stubs/oc_files_mount_manager.php +++ b/tests/stubs/oc_files_mount_manager.php @@ -19,40 +19,27 @@ class Manager implements IMountManager { public function __construct(SetupManagerFactory $setupManagerFactory) - { - } + { + } - /** - * @param IMountPoint $mount - */ - public function addMount(IMountPoint $mount) - { - } + public function addMount(IMountPoint $mount): void + { + } - /** - * @param string $mountPoint - */ - public function removeMount(string $mountPoint) - { - } + public function removeMount(string $mountPoint): void + { + } - /** - * @param string $mountPoint - * @param string $target - */ - public function moveMount(string $mountPoint, string $target) - { - } + public function moveMount(string $mountPoint, string $target): void + { + } /** * Find the mount for $path - * - * @param string $path - * @return IMountPoint */ public function find(string $path): IMountPoint - { - } + { + } /** * Find all mounts in $path @@ -60,12 +47,12 @@ public function find(string $path): IMountPoint * @return IMountPoint[] */ public function findIn(string $path): array - { - } + { + } public function clear(): void - { - } + { + } /** * Find mounts by storage id @@ -74,15 +61,15 @@ public function clear(): void * @return IMountPoint[] */ public function findByStorageId(string $id): array - { - } + { + } /** * @return IMountPoint[] */ public function getAll(): array - { - } + { + } /** * Find mounts by numeric storage id @@ -91,23 +78,23 @@ public function getAll(): array * @return IMountPoint[] */ public function findByNumericId(int $id): array - { - } + { + } public function getSetupManager(): SetupManager - { - } + { + } /** - * Return all mounts in a path from a specific mount provider + * Return all mounts in a path from a specific mount provider, indexed by mount point * * @param string $path * @param string[] $mountProviders - * @return MountPoint[] + * @return array */ - public function getMountsByMountProvider(string $path, array $mountProviders) - { - } + public function getMountsByMountProvider(string $path, array $mountProviders): array + { + } /** * Return the mount matching a cached mount info (or mount file info) @@ -117,6 +104,6 @@ public function getMountsByMountProvider(string $path, array $mountProviders) * @return IMountPoint|null */ public function getMountFromMountInfo(ICachedMountInfo $info): ?IMountPoint - { - } + { + } } diff --git a/tests/stubs/oc_files_mount_mountpoint.php b/tests/stubs/oc_files_mount_mountpoint.php index 02dc4ee50..f80b00bea 100644 --- a/tests/stubs/oc_files_mount_mountpoint.php +++ b/tests/stubs/oc_files_mount_mountpoint.php @@ -56,8 +56,8 @@ class MountPoint implements IMountPoint { * @throws \Exception */ public function __construct($storage, string $mountpoint, ?array $arguments = null, ?IStorageFactory $loader = null, ?array $mountOptions = null, ?int $mountId = null, ?string $mountProvider = null) - { - } + { + } /** * get complete path to the mount point, relative to data/ @@ -65,8 +65,8 @@ public function __construct($storage, string $mountpoint, ?array $arguments = nu * @return string */ public function getMountPoint() - { - } + { + } /** * Sets the mount point path, relative to data/ @@ -74,44 +74,44 @@ public function getMountPoint() * @param string $mountPoint new mount point */ public function setMountPoint($mountPoint) - { - } + { + } /** * @return \OC\Files\Storage\Storage|null */ public function getStorage() - { - } + { + } /** * @return string|null */ public function getStorageId() - { - } + { + } /** * @return int */ public function getNumericStorageId() - { - } + { + } /** * @param string $path * @return string */ public function getInternalPath($path) - { - } + { + } /** * @param callable $wrapper */ public function wrapStorage($wrapper) - { - } + { + } /** * Get a mount option @@ -121,8 +121,8 @@ public function wrapStorage($wrapper) * @return mixed */ public function getOption($name, $default) - { - } + { + } /** * Get all options for the mount @@ -130,8 +130,8 @@ public function getOption($name, $default) * @return array */ public function getOptions() - { - } + { + } /** * Get the file id of the root of the storage @@ -139,18 +139,18 @@ public function getOptions() * @return int */ public function getStorageRootId() - { - } + { + } public function getMountId() - { - } + { + } public function getMountType() - { - } + { + } public function getMountProvider(): string - { - } + { + } } diff --git a/tests/stubs/oc_group_group.php b/tests/stubs/oc_group_group.php index d88fec399..f54d89dfa 100644 --- a/tests/stubs/oc_group_group.php +++ b/tests/stubs/oc_group_group.php @@ -34,20 +34,20 @@ class Group implements IGroup { protected $displayName; public function __construct(string $gid, array $backends, IEventDispatcher $dispatcher, IUserManager $userManager, ?PublicEmitter $emitter = null, ?string $displayName = null) - { - } + { + } public function getGID(): string - { - } + { + } public function getDisplayName(): string - { - } + { + } public function setDisplayName(string $displayName): bool - { - } + { + } /** * get all users in the group @@ -55,8 +55,8 @@ public function setDisplayName(string $displayName): bool * @return \OC\User\User[] */ public function getUsers(): array - { - } + { + } /** * check if a user is in the group @@ -65,8 +65,8 @@ public function getUsers(): array * @return bool */ public function inGroup(IUser $user): bool - { - } + { + } /** * add a user to the group @@ -74,23 +74,23 @@ public function inGroup(IUser $user): bool * @param IUser $user */ public function addUser(IUser $user): void - { - } + { + } /** * remove a user from the group */ public function removeUser(IUser $user): void - { - } + { + } /** * Search for users in the group by userid or display name * @return IUser[] */ public function searchUsers(string $search, ?int $limit = null, ?int $offset = null): array - { - } + { + } /** * returns the number of users matching the search string @@ -99,8 +99,8 @@ public function searchUsers(string $search, ?int $limit = null, ?int $offset = n * @return int|bool */ public function count($search = ''): int|bool - { - } + { + } /** * returns the number of disabled users @@ -108,8 +108,8 @@ public function count($search = ''): int|bool * @return int|bool */ public function countDisabled(): int|bool - { - } + { + } /** * search for users in the group by displayname @@ -121,8 +121,8 @@ public function countDisabled(): int|bool * @deprecated 27.0.0 Use searchUsers instead (same implementation) */ public function searchDisplayName(string $search, ?int $limit = null, ?int $offset = null): array - { - } + { + } /** * Get the names of the backend classes the group is connected to @@ -130,8 +130,8 @@ public function searchDisplayName(string $search, ?int $limit = null, ?int $offs * @return string[] */ public function getBackendNames(): array - { - } + { + } /** * Delete the group @@ -139,30 +139,30 @@ public function getBackendNames(): array * @return bool */ public function delete(): bool - { - } + { + } /** * @return bool * @since 14.0.0 */ public function canRemoveUser(): bool - { - } + { + } /** * @return bool * @since 14.0.0 */ public function canAddUser(): bool - { - } + { + } /** * @return bool * @since 16.0.0 */ public function hideFromCollaboration(): bool - { - } + { + } } diff --git a/tests/stubs/oc_group_manager.php b/tests/stubs/oc_group_manager.php index 13e045bbd..e34d28243 100644 --- a/tests/stubs/oc_group_manager.php +++ b/tests/stubs/oc_group_manager.php @@ -43,8 +43,8 @@ class Manager extends PublicEmitter implements IGroupManager { private const MAX_GROUP_LENGTH = 255; public function __construct(private \OC\User\Manager $userManager, private IEventDispatcher $dispatcher, private LoggerInterface $logger, ICacheFactory $cacheFactory, private IRemoteAddress $remoteAddress) - { - } + { + } /** * Checks whether a given backend is used @@ -53,19 +53,19 @@ public function __construct(private \OC\User\Manager $userManager, private IEven * @return bool */ public function isBackendUsed($backendClass) - { - } + { + } /** * @param \OCP\GroupInterface $backend */ public function addBackend($backend) - { - } + { + } public function clearBackends() - { - } + { + } /** * Get the active backends @@ -73,21 +73,21 @@ public function clearBackends() * @return \OCP\GroupInterface[] */ public function getBackends() - { - } + { + } protected function clearCaches() - { - } + { + } /** * @param string $gid * @return IGroup|null */ public function get($gid) - { - } + { + } /** * @param string $gid @@ -95,8 +95,8 @@ public function get($gid) * @return \OCP\IGroup|null */ protected function getGroupObject($gid, $displayName = null) - { - } + { + } /** * @brief Batch method to create group objects @@ -106,44 +106,44 @@ protected function getGroupObject($gid, $displayName = null) * @return array */ protected function getGroupsObjects(array $gids, array $displayNames = []): array - { - } + { + } /** * @param string $gid * @return bool */ public function groupExists($gid) - { - } + { + } /** * @param string $gid * @return IGroup|null */ public function createGroup($gid) - { - } + { + } public function search(string $search, ?int $limit = null, ?int $offset = 0) - { - } + { + } /** * @param IUser|null $user * @return \OC\Group\Group[] */ public function getUserGroups(?IUser $user = null) - { - } + { + } /** * @param string $uid the user id * @return \OC\Group\Group[] */ public function getUserIdGroups(string $uid): array - { - } + { + } /** * Checks if a userId is in the admin group @@ -152,12 +152,12 @@ public function getUserIdGroups(string $uid): array * @return bool if admin */ public function isAdmin($userId) - { - } + { + } public function isDelegatedAdmin(string $userId): bool - { - } + { + } /** * Checks if a userId is in a group @@ -167,20 +167,20 @@ public function isDelegatedAdmin(string $userId): bool * @return bool if in group */ public function isInGroup($userId, $group) - { - } + { + } public function getUserGroupIds(IUser $user): array - { - } + { + } /** * @param string $groupId * @return ?string */ public function getDisplayName(string $groupId): ?string - { - } + { + } /** * get an array of groupid and displayName for a user @@ -189,8 +189,8 @@ public function getDisplayName(string $groupId): ?string * @return array ['displayName' => displayname] */ public function getUserGroupNames(IUser $user) - { - } + { + } /** * get a list of all display names in a group @@ -202,13 +202,13 @@ public function getUserGroupNames(IUser $user) * @return array an array of display names (value) and user ids (key) */ public function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) - { - } + { + } /** * @return \OC\SubAdmin */ public function getSubAdmin() - { - } + { + } } diff --git a/tests/stubs/oc_hooks_emitter.php b/tests/stubs/oc_hooks_emitter.php index 5ea0fd7a8..86eb41086 100644 --- a/tests/stubs/oc_hooks_emitter.php +++ b/tests/stubs/oc_hooks_emitter.php @@ -23,9 +23,7 @@ interface Emitter { * @return void * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::addListener */ - public function listen($scope, $method, callable $callback) - { - } + public function listen($scope, $method, callable $callback); /** * @param string $scope optional @@ -34,7 +32,5 @@ public function listen($scope, $method, callable $callback) * @return void * @deprecated 18.0.0 use \OCP\EventDispatcher\IEventDispatcher::removeListener */ - public function removeListener($scope = null, $method = null, ?callable $callback = null) - { - } + public function removeListener($scope = null, $method = null, ?callable $callback = null); } diff --git a/tests/stubs/oc_hooks_publicemitter.php b/tests/stubs/oc_hooks_publicemitter.php index bb929e8ad..6bd0ef0a1 100644 --- a/tests/stubs/oc_hooks_publicemitter.php +++ b/tests/stubs/oc_hooks_publicemitter.php @@ -20,6 +20,6 @@ class PublicEmitter extends BasicEmitter { * @suppress PhanAccessMethodProtected */ public function emit($scope, $method, array $arguments = []) - { - } + { + } } diff --git a/tests/stubs/oc_server.php b/tests/stubs/oc_server.php index 3c1fd1ac6..931621476 100644 --- a/tests/stubs/oc_server.php +++ b/tests/stubs/oc_server.php @@ -263,36 +263,36 @@ class Server extends ServerContainer implements IServerContainer { * @param \OC\Config $config */ public function __construct($webRoot, \OC\Config $config) - { - } + { + } public function boot() - { - } + { + } /** * @return \OCP\Contacts\IManager * @deprecated 20.0.0 */ public function getContactsManager() - { - } + { + } /** * @return \OC\Encryption\Manager * @deprecated 20.0.0 */ public function getEncryptionManager() - { - } + { + } /** * @return \OC\Encryption\File * @deprecated 20.0.0 */ public function getEncryptionFilesHelper() - { - } + { + } /** * The current request object holding all information about the request @@ -303,8 +303,8 @@ public function getEncryptionFilesHelper() * @deprecated 20.0.0 */ public function getRequest() - { - } + { + } /** * Returns the root folder of ownCloud's data directory @@ -313,8 +313,8 @@ public function getRequest() * @deprecated 20.0.0 */ public function getRootFolder() - { - } + { + } /** * Returns the root folder of ownCloud's data directory @@ -325,8 +325,8 @@ public function getRootFolder() * @deprecated 20.0.0 */ public function getLazyRootFolder() - { - } + { + } /** * Returns a view to ownCloud's files folder @@ -336,72 +336,72 @@ public function getLazyRootFolder() * @deprecated 20.0.0 */ public function getUserFolder($userId = null) - { - } + { + } /** * @return \OC\User\Manager * @deprecated 20.0.0 */ public function getUserManager() - { - } + { + } /** * @return \OC\Group\Manager * @deprecated 20.0.0 */ public function getGroupManager() - { - } + { + } /** * @return \OC\User\Session * @deprecated 20.0.0 */ public function getUserSession() - { - } + { + } /** * @return \OCP\ISession * @deprecated 20.0.0 */ public function getSession() - { - } + { + } /** * @param \OCP\ISession $session * @return void */ public function setSession(\OCP\ISession $session) - { - } + { + } /** * @return \OCP\IConfig * @deprecated 20.0.0 */ public function getConfig() - { - } + { + } /** * @return \OC\SystemConfig * @deprecated 20.0.0 */ public function getSystemConfig() - { - } + { + } /** * @return IFactory * @deprecated 20.0.0 */ public function getL10NFactory() - { - } + { + } /** * get an L10N instance @@ -412,16 +412,16 @@ public function getL10NFactory() * @deprecated 20.0.0 use DI of {@see IL10N} or {@see IFactory} instead, or {@see \OCP\Util::getL10N()} as a last resort */ public function getL10N($app, $lang = null) - { - } + { + } /** * @return IURLGenerator * @deprecated 20.0.0 */ public function getURLGenerator() - { - } + { + } /** * Returns an ICache instance. Since 8.1.0 it returns a fake cache. Use @@ -431,8 +431,8 @@ public function getURLGenerator() * @deprecated 8.1.0 use getMemCacheFactory to obtain a proper cache */ public function getCache() - { - } + { + } /** * Returns an \OCP\CacheFactory instance @@ -441,8 +441,8 @@ public function getCache() * @deprecated 20.0.0 */ public function getMemCacheFactory() - { - } + { + } /** * Returns the current session @@ -451,8 +451,8 @@ public function getMemCacheFactory() * @deprecated 20.0.0 */ public function getDatabaseConnection() - { - } + { + } /** * Returns the activity manager @@ -461,8 +461,8 @@ public function getDatabaseConnection() * @deprecated 20.0.0 */ public function getActivityManager() - { - } + { + } /** * Returns an job list for controlling background jobs @@ -471,8 +471,8 @@ public function getActivityManager() * @deprecated 20.0.0 */ public function getJobList() - { - } + { + } /** * Returns a SecureRandom instance @@ -481,8 +481,8 @@ public function getJobList() * @deprecated 20.0.0 */ public function getSecureRandom() - { - } + { + } /** * Returns a Crypto instance @@ -491,8 +491,8 @@ public function getSecureRandom() * @deprecated 20.0.0 */ public function getCrypto() - { - } + { + } /** * Returns a Hasher instance @@ -501,8 +501,8 @@ public function getCrypto() * @deprecated 20.0.0 */ public function getHasher() - { - } + { + } /** * Get the certificate manager @@ -510,8 +510,8 @@ public function getHasher() * @return \OCP\ICertificateManager */ public function getCertificateManager() - { - } + { + } /** * Get the manager for temporary files and folders @@ -520,8 +520,8 @@ public function getCertificateManager() * @deprecated 20.0.0 */ public function getTempManager() - { - } + { + } /** * Get the app manager @@ -530,8 +530,8 @@ public function getTempManager() * @deprecated 20.0.0 */ public function getAppManager() - { - } + { + } /** * Creates a new mailer @@ -540,8 +540,8 @@ public function getAppManager() * @deprecated 20.0.0 */ public function getMailer() - { - } + { + } /** * Get the webroot @@ -550,8 +550,8 @@ public function getMailer() * @deprecated 20.0.0 */ public function getWebRoot() - { - } + { + } /** * Get the locking provider @@ -561,8 +561,8 @@ public function getWebRoot() * @deprecated 20.0.0 */ public function getLockingProvider() - { - } + { + } /** * Get the MimeTypeDetector @@ -571,8 +571,8 @@ public function getLockingProvider() * @deprecated 20.0.0 */ public function getMimeTypeDetector() - { - } + { + } /** * Get the MimeTypeLoader @@ -581,8 +581,8 @@ public function getMimeTypeDetector() * @deprecated 20.0.0 */ public function getMimeTypeLoader() - { - } + { + } /** * Get the Notification Manager @@ -592,62 +592,62 @@ public function getMimeTypeLoader() * @deprecated 20.0.0 */ public function getNotificationManager() - { - } + { + } /** * @return \OCA\Theming\ThemingDefaults * @deprecated 20.0.0 */ public function getThemingDefaults() - { - } + { + } /** * @return \OC\IntegrityCheck\Checker * @deprecated 20.0.0 */ public function getIntegrityCodeChecker() - { - } + { + } /** * @return CsrfTokenManager * @deprecated 20.0.0 */ public function getCsrfTokenManager() - { - } + { + } /** * @return ContentSecurityPolicyNonceManager * @deprecated 20.0.0 */ public function getContentSecurityPolicyNonceManager() - { - } + { + } /** * @return \OCP\Settings\IManager * @deprecated 20.0.0 */ public function getSettingsManager() - { - } + { + } /** * @return \OCP\Files\IAppData * @deprecated 20.0.0 Use get(\OCP\Files\AppData\IAppDataFactory::class)->get($app) instead */ public function getAppDataDir($app) - { - } + { + } /** * @return \OCP\Federation\ICloudIdManager * @deprecated 20.0.0 */ public function getCloudIdManager() - { - } + { + } } diff --git a/tests/stubs/oc_servercontainer.php b/tests/stubs/oc_servercontainer.php index 2aba042f2..2817d65c0 100644 --- a/tests/stubs/oc_servercontainer.php +++ b/tests/stubs/oc_servercontainer.php @@ -34,24 +34,24 @@ class ServerContainer extends SimpleContainer { * ServerContainer constructor. */ public function __construct() - { - } + { + } /** * @param string $appName * @param string $appNamespace */ public function registerNamespace(string $appName, string $appNamespace): void - { - } + { + } /** * @param string $appName * @param DIContainer $container */ public function registerAppContainer(string $appName, DIContainer $container): void - { - } + { + } /** * @param string $appName @@ -59,8 +59,8 @@ public function registerAppContainer(string $appName, DIContainer $container): v * @throws QueryException */ public function getRegisteredAppContainer(string $appName): DIContainer - { - } + { + } /** * @param string $namespace @@ -69,12 +69,12 @@ public function getRegisteredAppContainer(string $appName): DIContainer * @throws QueryException */ protected function getAppContainer(string $namespace, string $sensitiveNamespace): DIContainer - { - } + { + } public function has($id, bool $noRecursion = false): bool - { - } + { + } /** * @template T @@ -88,8 +88,8 @@ public function has($id, bool $noRecursion = false): bool * @deprecated 20.0.0 use \Psr\Container\ContainerInterface::get */ public function query(string $name, bool $autoload = true, array $chain = []) - { - } + { + } /** * @internal @@ -97,6 +97,6 @@ public function query(string $name, bool $autoload = true, array $chain = []) * @return DIContainer|null */ public function getAppContainerForService(string $id): ?DIContainer - { - } + { + } } diff --git a/tests/stubs/oc_share20_share.php b/tests/stubs/oc_share20_share.php index a9319a5f9..a36ac5a4d 100644 --- a/tests/stubs/oc_share20_share.php +++ b/tests/stubs/oc_share20_share.php @@ -7,6 +7,7 @@ */ namespace OC\Share20; +use OCP\Constants; use OCP\Files\Cache\ICacheEntry; use OCP\Files\File; use OCP\Files\FileInfo; @@ -31,405 +32,416 @@ public function __construct( * @inheritdoc */ public function setId($id) - { - } + { + } /** * @inheritdoc */ public function getId() - { - } + { + } /** * @inheritdoc */ public function getFullId() - { - } + { + } /** * @inheritdoc */ public function setProviderId($id) - { - } + { + } /** * @inheritdoc */ public function setNode(Node $node) - { - } + { + } /** * @inheritdoc */ public function getNode() - { - } + { + } /** * @inheritdoc */ public function setNodeId($fileId) - { - } + { + } /** * @inheritdoc */ public function getNodeId(): int - { - } + { + } /** * @inheritdoc */ public function setNodeType($type) - { - } + { + } /** * @inheritdoc */ public function getNodeType() - { - } + { + } /** * @inheritdoc */ public function setShareType($shareType) - { - } + { + } /** * @inheritdoc */ public function getShareType() - { - } + { + } /** * @inheritdoc */ public function setSharedWith($sharedWith) - { - } + { + } /** * @inheritdoc */ public function getSharedWith() - { - } + { + } /** * @inheritdoc */ public function setSharedWithDisplayName($displayName) - { - } + { + } /** * @inheritdoc */ public function getSharedWithDisplayName() - { - } + { + } /** * @inheritdoc */ public function setSharedWithAvatar($src) - { - } + { + } /** * @inheritdoc */ public function getSharedWithAvatar() - { - } + { + } /** * @inheritdoc */ public function setPermissions($permissions) - { - } + { + } /** * @inheritdoc */ public function getPermissions() - { - } + { + } /** * @inheritdoc */ public function newAttributes(): IAttributes - { - } + { + } /** * @inheritdoc */ public function setAttributes(?IAttributes $attributes) - { - } + { + } /** * @inheritdoc */ public function getAttributes(): ?IAttributes - { - } + { + } /** * @inheritdoc */ public function setStatus(int $status): IShare - { - } + { + } /** * @inheritdoc */ public function getStatus(): int - { - } + { + } /** * @inheritdoc */ public function setNote($note) - { - } + { + } /** * @inheritdoc */ public function getNote() - { - } + { + } /** * @inheritdoc */ public function setLabel($label) - { - } + { + } /** * @inheritdoc */ public function getLabel() - { - } + { + } /** * @inheritdoc */ public function setExpirationDate($expireDate) - { - } + { + } /** * @inheritdoc */ public function getExpirationDate() - { - } + { + } /** * @inheritdoc */ public function setNoExpirationDate(bool $noExpirationDate) - { - } + { + } /** * @inheritdoc */ public function getNoExpirationDate(): bool - { - } + { + } /** * @inheritdoc */ public function isExpired() - { - } + { + } /** * @inheritdoc */ public function setSharedBy($sharedBy) - { - } + { + } /** * @inheritdoc */ public function getSharedBy() - { - } + { + } /** * @inheritdoc */ public function setShareOwner($shareOwner) - { - } + { + } /** * @inheritdoc */ public function getShareOwner() - { - } + { + } /** * @inheritdoc */ public function setPassword($password) - { - } + { + } /** * @inheritdoc */ public function getPassword() - { - } + { + } /** * @inheritdoc */ public function setPasswordExpirationTime(?\DateTimeInterface $passwordExpirationTime = null): IShare - { - } + { + } /** * @inheritdoc */ public function getPasswordExpirationTime(): ?\DateTimeInterface - { - } + { + } /** * @inheritdoc */ public function setSendPasswordByTalk(bool $sendPasswordByTalk) - { - } + { + } /** * @inheritdoc */ public function getSendPasswordByTalk(): bool - { - } + { + } /** * @inheritdoc */ public function setToken($token) - { - } + { + } /** * @inheritdoc */ public function getToken() - { - } + { + } public function setParent(int $parent): self - { - } + { + } public function getParent(): ?int - { - } + { + } /** * @inheritdoc */ public function setTarget($target) - { - } + { + } + + /** + * Return the original target, if this share was moved + */ + public function getOriginalTarget(): ?string + { + } /** * @inheritdoc */ public function getTarget() - { - } + { + } /** * @inheritdoc */ public function setShareTime(\DateTime $shareTime) - { - } + { + } /** * @inheritdoc */ public function getShareTime() - { - } + { + } /** * @inheritdoc */ public function setMailSend($mailSend) - { - } + { + } /** * @inheritdoc */ public function getMailSend() - { - } + { + } /** * @inheritdoc */ public function setNodeCacheEntry(ICacheEntry $entry) - { - } + { + } /** * @inheritdoc */ public function getNodeCacheEntry() - { - } + { + } public function setHideDownload(bool $hide): IShare - { - } + { + } public function getHideDownload(): bool - { - } + { + } public function setReminderSent(bool $reminderSent): IShare - { - } + { + } public function getReminderSent(): bool - { - } + { + } + + public function canDownload(): bool + { + } public function canSeeContent(): bool - { - } + { + } } diff --git a/tests/stubs/oc_share20_shareattributes.php b/tests/stubs/oc_share20_shareattributes.php index 1920737b5..023f90f27 100644 --- a/tests/stubs/oc_share20_shareattributes.php +++ b/tests/stubs/oc_share20_shareattributes.php @@ -11,27 +11,27 @@ class ShareAttributes implements IAttributes { public function __construct() - { - } + { + } /** * @inheritdoc */ public function setAttribute(string $scope, string $key, mixed $value): IAttributes - { - } + { + } /** * @inheritdoc */ public function getAttribute(string $scope, string $key): mixed - { - } + { + } /** * @inheritdoc */ public function toArray(): array - { - } + { + } } diff --git a/tests/stubs/oc_systemconfig.php b/tests/stubs/oc_systemconfig.php index b6b378063..3ccfc5ada 100644 --- a/tests/stubs/oc_systemconfig.php +++ b/tests/stubs/oc_systemconfig.php @@ -113,16 +113,16 @@ class SystemConfig { ]; public function __construct(private Config $config) - { - } + { + } /** * Lists all available config keys * @return array an array of key names */ public function getKeys() - { - } + { + } /** * Sets a new system wide value @@ -131,8 +131,8 @@ public function getKeys() * @param mixed $value the value that should be stored */ public function setValue($key, $value) - { - } + { + } /** * Sets and deletes values and writes the config.php @@ -141,8 +141,8 @@ public function setValue($key, $value) * If value is null, the config key will be deleted */ public function setValues(array $configs) - { - } + { + } /** * Looks up a system wide defined value @@ -152,8 +152,8 @@ public function setValues(array $configs) * @return mixed the value or $default */ public function getValue($key, $default = '') - { - } + { + } /** * Looks up a system wide defined value and filters out sensitive data @@ -163,8 +163,8 @@ public function getValue($key, $default = '') * @return mixed the value or $default */ public function getFilteredValue($key, $default = '') - { - } + { + } /** * Delete a system wide defined value @@ -172,8 +172,8 @@ public function getFilteredValue($key, $default = '') * @param string $key the key of the value, under which it was saved */ public function deleteValue($key) - { - } + { + } /** * @param bool|array $keysToRemove @@ -181,6 +181,6 @@ public function deleteValue($key) * @return mixed */ protected function removeSensitiveValue($keysToRemove, $value) - { - } + { + } } diff --git a/tests/stubs/oc_user_manager.php b/tests/stubs/oc_user_manager.php index 7707babff..da9ad1fd9 100644 --- a/tests/stubs/oc_user_manager.php +++ b/tests/stubs/oc_user_manager.php @@ -56,28 +56,28 @@ class Manager extends PublicEmitter implements IUserManager { // This constructor can't autoload any class requiring a DB connection. public function __construct(private IConfig $config, ICacheFactory $cacheFactory, private IEventDispatcher $eventDispatcher, private LoggerInterface $logger) - { - } + { + } /** * Get the active backends * @return UserInterface[] */ public function getBackends(): array - { - } + { + } public function registerBackend(UserInterface $backend): void - { - } + { + } public function removeBackend(UserInterface $backend): void - { - } + { + } public function clearBackends(): void - { - } + { + } /** * get a user by user id @@ -86,12 +86,12 @@ public function clearBackends(): void * @return \OC\User\User|null Either the user or null if the specified user does not exist */ public function get($uid) - { - } + { + } public function getDisplayName(string $uid): ?string - { - } + { + } /** * get or construct the user object @@ -102,8 +102,8 @@ public function getDisplayName(string $uid): ?string * @return \OC\User\User */ public function getUserObject($uid, $backend, $cacheUser = true) - { - } + { + } /** * check if a user exists @@ -112,8 +112,8 @@ public function getUserObject($uid, $backend, $cacheUser = true) * @return bool */ public function userExists($uid) - { - } + { + } /** * Check if the password is valid for the user @@ -123,8 +123,8 @@ public function userExists($uid) * @return IUser|false the User object on success, false otherwise */ public function checkPassword($loginName, $password) - { - } + { + } /** * Check if the password is valid for the user @@ -135,23 +135,23 @@ public function checkPassword($loginName, $password) * @return IUser|false the User object on success, false otherwise */ public function checkPasswordNoLogging($loginName, $password) - { - } + { + } public function search($pattern, $limit = null, $offset = null) - { - } + { + } public function searchDisplayName($pattern, $limit = null, $offset = null) - { - } + { + } /** * @return IUser[] */ public function getDisabledUsers(?int $limit = null, int $offset = 0, string $search = ''): array - { - } + { + } /** * Search known users (from phonebook sync) by displayName @@ -163,8 +163,8 @@ public function getDisabledUsers(?int $limit = null, int $offset = 0, string $se * @return IUser[] */ public function searchKnownUsersByDisplayName(string $searcher, string $pattern, ?int $limit = null, ?int $offset = null): array - { - } + { + } /** * @param string $uid @@ -174,8 +174,8 @@ public function searchKnownUsersByDisplayName(string $searcher, string $pattern, * @throws HintException */ public function createUser($uid, $password) - { - } + { + } /** * @param string $uid @@ -185,8 +185,8 @@ public function createUser($uid, $password) * @throws \InvalidArgumentException */ public function createUserFromBackend($uid, $password, UserInterface $backend) - { - } + { + } /** * returns how many users per backend exist (if supported by backend) @@ -194,12 +194,12 @@ public function createUserFromBackend($uid, $password, UserInterface $backend) * @return array an array of backend class as key and count number as value */ public function countUsers(bool $onlyMappedUsers = false) - { - } + { + } public function countUsersTotal(int $limit = 0, bool $onlyMappedUsers = false): int|false - { - } + { + } /** * returns how many users per backend exist in the requested groups (if supported by backend) @@ -209,8 +209,8 @@ public function countUsersTotal(int $limit = 0, bool $onlyMappedUsers = false): * @return array{int,int} total number of users, and number of disabled users in the given groups, below $limit. If limit is reached, -1 is returned for number of disabled users */ public function countUsersAndDisabledUsersOfGroups(array $groups, int $limit): array - { - } + { + } /** * The callback is executed for each user on each backend. @@ -223,8 +223,8 @@ public function countUsersAndDisabledUsersOfGroups(array $groups, int $limit): a * @since 9.0.0 */ public function callForAllUsers(\Closure $callback, $search = '', $onlySeen = false) - { - } + { + } /** * returns how many users are disabled @@ -233,8 +233,8 @@ public function callForAllUsers(\Closure $callback, $search = '', $onlySeen = fa * @since 12.0.0 */ public function countDisabledUsers(): int - { - } + { + } /** * returns how many users have logged in once @@ -243,19 +243,19 @@ public function countDisabledUsers(): int * @since 11.0.0 */ public function countSeenUsers() - { - } + { + } public function callForSeenUsers(\Closure $callback) - { - } + { + } /** * @internal Only for mocks it in unit tests. */ public function getUserConfig(): IUserConfig - { - } + { + } /** * @param string $email @@ -263,8 +263,8 @@ public function getUserConfig(): IUserConfig * @since 9.1.0 */ public function getByEmail($email): array - { - } + { + } /** * @param string $uid @@ -273,8 +273,8 @@ public function getByEmail($email): array * @since 26.0.0 */ public function validateUserId(string $uid, bool $checkDataDirectory = false): void - { - } + { + } /** * Gets the list of user ids sorted by lastLogin, from most recent to least recent @@ -285,18 +285,18 @@ public function validateUserId(string $uid, bool $checkDataDirectory = false): v * @return list list of user IDs */ public function getLastLoggedInUsers(?int $limit = null, int $offset = 0, string $search = ''): array - { - } + { + } public function getDisplayNameCache(): DisplayNameCache - { - } + { + } public function getSeenUsers(int $offset = 0, ?int $limit = null): \Iterator - { - } + { + } public function getExistingUser(string $userId, ?string $displayName = null): IUser - { - } + { + } } diff --git a/tests/stubs/oc_user_user.php b/tests/stubs/oc_user_user.php index f20db3a93..46678dfc0 100644 --- a/tests/stubs/oc_user_user.php +++ b/tests/stubs/oc_user_user.php @@ -25,6 +25,7 @@ use OCP\IUser; use OCP\IUserBackend; use OCP\Notification\IManager as INotificationManager; +use OCP\Support\Subscription\IAssertion; use OCP\User\Backend\IGetHomeBackend; use OCP\User\Backend\IPasswordHashBackend; use OCP\User\Backend\IProvideAvatarBackend; @@ -49,9 +50,9 @@ class User implements IUser { /** @var IAccountManager */ protected $accountManager; - public function __construct(private string $uid, private ?UserInterface $backend, private IEventDispatcher $dispatcher, $emitter = null, ?IConfig $config = null, $urlGenerator = null) - { - } + public function __construct(private string $uid, private ?UserInterface $backend, private IEventDispatcher $dispatcher, $emitter = null, ?IConfig $config = null, ?IURLGenerator $urlGenerator = null, ?IAssertion $assertion = null) + { + } /** * get the user id @@ -59,8 +60,8 @@ public function __construct(private string $uid, private ?UserInterface $backend * @return string */ public function getUID() - { - } + { + } /** * get the display name for the user, if no specific display name is set it will fallback to the user id @@ -68,8 +69,8 @@ public function getUID() * @return string */ public function getDisplayName() - { - } + { + } /** * set the displayname for the user @@ -81,52 +82,52 @@ public function getDisplayName() * @throws \InvalidArgumentException */ public function setDisplayName($displayName) - { - } + { + } /** * @inheritDoc */ public function setEMailAddress($mailAddress) - { - } + { + } /** * @inheritDoc */ public function setSystemEMailAddress(string $mailAddress): void - { - } + { + } /** * @inheritDoc */ public function setPrimaryEMailAddress(string $mailAddress): void - { - } + { + } /** * returns the timestamp of the user's last login or 0 if the user did never * login */ public function getLastLogin(): int - { - } + { + } /** * returns the timestamp of the user's last login or 0 if the user did never * login */ public function getFirstLogin(): int - { - } + { + } /** * updates the timestamp of the most recent login of this user */ public function updateLastLoginTimestamp(): bool - { - } + { + } /** * Delete the user @@ -134,8 +135,8 @@ public function updateLastLoginTimestamp(): bool * @return bool */ public function delete() - { - } + { + } /** * Set the password of the user @@ -145,16 +146,16 @@ public function delete() * @return bool */ public function setPassword($password, $recoveryPassword = null) - { - } + { + } public function getPasswordHash(): ?string - { - } + { + } public function setPasswordHash(string $passwordHash): bool - { - } + { + } /** * get the users home folder to mount @@ -162,8 +163,8 @@ public function setPasswordHash(string $passwordHash): bool * @return string */ public function getHome() - { - } + { + } /** * Get the name of the backend class the user is connected with @@ -171,12 +172,12 @@ public function getHome() * @return string */ public function getBackendClassName() - { - } + { + } public function getBackend(): ?UserInterface - { - } + { + } /** * Check if the backend allows the user to change their avatar on Personal page @@ -184,8 +185,8 @@ public function getBackend(): ?UserInterface * @return bool */ public function canChangeAvatar() - { - } + { + } /** * check if the backend supports changing passwords @@ -193,8 +194,8 @@ public function canChangeAvatar() * @return bool */ public function canChangePassword() - { - } + { + } /** * check if the backend supports changing display names @@ -202,12 +203,12 @@ public function canChangePassword() * @return bool */ public function canChangeDisplayName() - { - } + { + } public function canChangeEmail(): bool - { - } + { + } /** * check if the user is enabled @@ -215,8 +216,8 @@ public function canChangeEmail(): bool * @return bool */ public function isEnabled() - { - } + { + } /** * set the enabled status for the user @@ -224,8 +225,8 @@ public function isEnabled() * @return void */ public function setEnabled(bool $enabled = true) - { - } + { + } /** * get the users email address @@ -234,22 +235,22 @@ public function setEnabled(bool $enabled = true) * @since 9.0.0 */ public function getEMailAddress() - { - } + { + } /** * @inheritDoc */ public function getSystemEMailAddress(): ?string - { - } + { + } /** * @inheritDoc */ public function getPrimaryEMailAddress(): ?string - { - } + { + } /** * get the users' quota @@ -258,12 +259,12 @@ public function getPrimaryEMailAddress(): ?string * @since 9.0.0 */ public function getQuota() - { - } + { + } public function getQuotaBytes(): int|float - { - } + { + } /** * set the users' quota @@ -274,16 +275,16 @@ public function getQuotaBytes(): int|float * @since 9.0.0 */ public function setQuota($quota) - { - } + { + } public function getManagerUids(): array - { - } + { + } public function setManagerUids(array $uids): void - { - } + { + } /** * get the avatar image if it exists @@ -293,8 +294,8 @@ public function setManagerUids(array $uids): void * @since 9.0.0 */ public function getAvatarImage($size) - { - } + { + } /** * get the federation cloud id @@ -303,10 +304,10 @@ public function getAvatarImage($size) * @since 9.0.0 */ public function getCloudId() - { - } + { + } public function triggerChange($feature, $value = null, $oldValue = null) - { - } + { + } } diff --git a/tests/stubs/oca_dav_carddav_contactsmanager.php b/tests/stubs/oca_dav_carddav_contactsmanager.php index f44a3293f..1bb5f9266 100644 --- a/tests/stubs/oca_dav_carddav_contactsmanager.php +++ b/tests/stubs/oca_dav_carddav_contactsmanager.php @@ -36,8 +36,8 @@ public function __construct( * @param IURLGenerator $urlGenerator */ public function setupContactsProvider(IManager $cm, $userId, IURLGenerator $urlGenerator) - { - } + { + } /** * @param IManager $cm @@ -45,6 +45,6 @@ public function setupContactsProvider(IManager $cm, $userId, IURLGenerator $urlG * @param IURLGenerator $urlGenerator */ public function setupSystemContactsProvider(IManager $cm, ?string $userId, IURLGenerator $urlGenerator) - { - } + { + } } diff --git a/tests/stubs/oca_federatedfilesharing_notifications.php b/tests/stubs/oca_federatedfilesharing_notifications.php index d77ecddf8..385545c31 100644 --- a/tests/stubs/oca_federatedfilesharing_notifications.php +++ b/tests/stubs/oca_federatedfilesharing_notifications.php @@ -50,8 +50,8 @@ public function __construct( * @throws \OC\ServerNotAvailableException */ public function sendRemoteShare($token, $shareWith, $name, $remoteId, $owner, $ownerFederatedId, $sharedBy, $sharedByFederatedId, $shareType) - { - } + { + } /** * ask owner to re-share the file with the given user @@ -68,8 +68,8 @@ public function sendRemoteShare($token, $shareWith, $name, $remoteId, $owner, $o * @throws \OC\ServerNotAvailableException */ public function requestReShare($token, $id, $shareId, $remote, $shareWith, $permission, $filename, $shareType) - { - } + { + } /** * send server-to-server unshare to remote server @@ -80,8 +80,8 @@ public function requestReShare($token, $id, $shareId, $remote, $shareWith, $perm * @return bool */ public function sendRemoteUnShare($remote, $id, $token) - { - } + { + } /** * send server-to-server unshare to remote server @@ -92,8 +92,8 @@ public function sendRemoteUnShare($remote, $id, $token) * @return bool */ public function sendRevokeShare($remote, $id, $token) - { - } + { + } /** * send notification to remote server if the permissions was changed @@ -105,8 +105,8 @@ public function sendRevokeShare($remote, $id, $token) * @return bool */ public function sendPermissionChange($remote, $remoteId, $token, $permissions) - { - } + { + } /** * forward accept reShare to remote server @@ -116,8 +116,8 @@ public function sendPermissionChange($remote, $remoteId, $token, $permissions) * @param string $token */ public function sendAcceptShare($remote, $remoteId, $token) - { - } + { + } /** * forward decline reShare to remote server @@ -127,8 +127,8 @@ public function sendAcceptShare($remote, $remoteId, $token) * @param string $token */ public function sendDeclineShare($remote, $remoteId, $token) - { - } + { + } /** * inform remote server whether server-to-server share was accepted/declined @@ -142,8 +142,8 @@ public function sendDeclineShare($remote, $remoteId, $token) * @return boolean */ public function sendUpdateToRemote($remote, $remoteId, $token, $action, $data = [], $try = 0) - { - } + { + } /** @@ -152,8 +152,8 @@ public function sendUpdateToRemote($remote, $remoteId, $token, $action, $data = * @return int */ protected function getTimestamp() - { - } + { + } /** * try http post with the given protocol, if no protocol is given we pick @@ -167,8 +167,8 @@ protected function getTimestamp() * @throws \Exception */ protected function tryHttpPostToShareEndpoint($remoteDomain, $urlSuffix, array $fields, $action = 'share') - { - } + { + } /** * try old federated sharing API if the OCM api doesn't work @@ -180,8 +180,8 @@ protected function tryHttpPostToShareEndpoint($remoteDomain, $urlSuffix, array $ * @throws \Exception */ protected function tryLegacyEndPoint($remoteDomain, $urlSuffix, array $fields) - { - } + { + } /** * send action regarding federated sharing to the remote server using the OCM API @@ -193,6 +193,6 @@ protected function tryLegacyEndPoint($remoteDomain, $urlSuffix, array $fields) * @return array|false */ protected function tryOCMEndPoint($remoteDomain, $fields, $action) - { - } + { + } } diff --git a/tests/stubs/oca_files_sharing_event_usershareaccessupdatedevent.php b/tests/stubs/oca_files_sharing_event_usershareaccessupdatedevent.php index c0dcbe49b..6267ad09a 100644 --- a/tests/stubs/oca_files_sharing_event_usershareaccessupdatedevent.php +++ b/tests/stubs/oca_files_sharing_event_usershareaccessupdatedevent.php @@ -26,13 +26,13 @@ class UserShareAccessUpdatedEvent extends Event { * @param IUser|list $users */ public function __construct(IUser|array $users) - { - } + { + } /** * @return list */ public function getUsers(): array - { - } + { + } } diff --git a/tests/stubs/oca_files_sharing_external_manager.php b/tests/stubs/oca_files_sharing_external_manager.php index 8f41c0c5c..83372dda5 100644 --- a/tests/stubs/oca_files_sharing_external_manager.php +++ b/tests/stubs/oca_files_sharing_external_manager.php @@ -26,6 +26,7 @@ use OCP\Files\Storage\IStorageFactory; use OCP\Http\Client\IClientService; use OCP\ICertificateManager; +use OCP\IConfig; use OCP\IDBConnection; use OCP\IGroup; use OCP\IGroupManager; @@ -37,9 +38,9 @@ use Psr\Log\LoggerInterface; class Manager { - public function __construct(private IDBConnection $connection, private \OC\Files\Mount\Manager $mountManager, private IStorageFactory $storageLoader, private IClientService $clientService, private IManager $notificationManager, private IDiscoveryService $discoveryService, private ICloudFederationProviderManager $cloudFederationProviderManager, private ICloudFederationFactory $cloudFederationFactory, private IGroupManager $groupManager, IUserSession $userSession, private IEventDispatcher $eventDispatcher, private LoggerInterface $logger, private IRootFolder $rootFolder, private SetupManager $setupManager, private ICertificateManager $certificateManager, private ExternalShareMapper $externalShareMapper) - { - } + public function __construct(private IDBConnection $connection, private \OC\Files\Mount\Manager $mountManager, private IStorageFactory $storageLoader, private IClientService $clientService, private IManager $notificationManager, private IDiscoveryService $discoveryService, private ICloudFederationProviderManager $cloudFederationProviderManager, private ICloudFederationFactory $cloudFederationFactory, private IGroupManager $groupManager, IUserSession $userSession, private IEventDispatcher $eventDispatcher, private LoggerInterface $logger, private IRootFolder $rootFolder, private SetupManager $setupManager, private ICertificateManager $certificateManager, private ExternalShareMapper $externalShareMapper, private IConfig $config) + { + } /** * Add new server-to-server share. @@ -49,16 +50,16 @@ public function __construct(private IDBConnection $connection, private \OC\Files * @throws NoUserException */ public function addShare(ExternalShare $externalShare, IUser|IGroup|null $shareWith = null): ?Mount - { - } + { + } public function getShare(string $id, ?IUser $user = null): ExternalShare|false - { - } + { + } public function getShareByToken(string $token): ExternalShare|false - { - } + { + } /** * Accept server-to-server share. @@ -66,8 +67,8 @@ public function getShareByToken(string $token): ExternalShare|false * @return bool True if the share could be accepted, false otherwise */ public function acceptShare(ExternalShare $externalShare, ?IUser $user = null): bool - { - } + { + } /** * Decline server-to-server share @@ -75,12 +76,12 @@ public function acceptShare(ExternalShare $externalShare, ?IUser $user = null): * @return bool True if the share could be declined, false otherwise */ public function declineShare(ExternalShare $externalShare, ?Iuser $user = null): bool - { - } + { + } public function processNotification(ExternalShare $remoteShare, ?IUser $user = null): void - { - } + { + } /** * Try to send accept message to ocm end-point @@ -89,53 +90,53 @@ public function processNotification(ExternalShare $remoteShare, ?IUser $user = n * @return array|false */ protected function tryOCMEndPoint(ExternalShare $externalShare, string $feedback) - { - } + { + } /** * remove '/user/files' from the path and trailing slashes */ protected function stripPath(string $path): string - { - } + { + } public function getMount(array $data, ?IUser $user = null): Mount - { - } + { + } protected function mountShare(array $data, ?IUser $user = null): Mount - { - } + { + } public function getMountManager(): \OC\Files\Mount\Manager - { - } + { + } public function setMountPoint(string $source, string $target): bool - { - } + { + } public function removeShare(string $mountPoint): bool - { - } + { + } /** * Remove re-shares from share table and mapping in the federated_reshares table */ protected function removeReShares(string $mountPointId): void - { - } + { + } /** * Remove all shares for user $uid if the user was deleted. */ public function removeUserShares(IUser $user): bool - { - } + { + } public function removeGroupShares(IGroup $group): bool - { - } + { + } /** * Return a list of shares which are not yet accepted by the user. @@ -143,8 +144,8 @@ public function removeGroupShares(IGroup $group): bool * @return list list of open server-to-server shares */ public function getOpenShares(): array - { - } + { + } /** * Return a list of shares which are accepted by the user. @@ -152,6 +153,6 @@ public function getOpenShares(): array * @return list list of accepted server-to-server shares */ public function getAcceptedShares(): array - { - } + { + } } diff --git a/tests/stubs/oca_user_ldap_mapping_abstractmapping.php b/tests/stubs/oca_user_ldap_mapping_abstractmapping.php index 7c5b01626..6c7453bd3 100644 --- a/tests/stubs/oca_user_ldap_mapping_abstractmapping.php +++ b/tests/stubs/oca_user_ldap_mapping_abstractmapping.php @@ -28,9 +28,7 @@ abstract class AbstractMapping { * * @return string */ - abstract protected function getTableName(bool $includePrefix = true) - { - } + abstract protected function getTableName(bool $includePrefix = true); /** * A month worth of cache time for as good as never changing mapping data. @@ -61,16 +59,16 @@ abstract protected function getTableName(bool $includePrefix = true) * @param IDBConnection $dbc */ public function __construct(protected IDBConnection $dbc, protected ICacheFactory $cacheFactory, protected IAppConfig $config, protected bool $isCLI) - { - } + { + } protected function initLocalCache(): void - { - } + { + } protected function useCacheByUserCount(): bool - { - } + { + } /** * checks whether a provided string represents an existing table col @@ -79,8 +77,8 @@ protected function useCacheByUserCount(): bool * @return bool */ public function isColNameValid($col) - { - } + { + } /** * Gets the value of one column based on a provided value of another column @@ -92,8 +90,8 @@ public function isColNameValid($col) * @throws \Exception */ protected function getXbyY($fetchCol, $compareCol, $search) - { - } + { + } /** * Performs a DELETE or UPDATE query to the database. @@ -103,15 +101,15 @@ protected function getXbyY($fetchCol, $compareCol, $search) * @return bool true if at least one row was modified, false otherwise */ protected function modify(IPreparedStatement $statement, $parameters) - { - } + { + } /** * Gets the LDAP DN based on the provided name. */ public function getDNByName(string $name): string|false - { - } + { + } /** * Updates the DN based on the given UUID @@ -121,8 +119,8 @@ public function getDNByName(string $name): string|false * @return bool */ public function setDNbyUUID($fdn, $uuid) - { - } + { + } /** * Updates the UUID based on the given DN @@ -134,15 +132,15 @@ public function setDNbyUUID($fdn, $uuid) * @return bool */ public function setUUIDbyDN($uuid, $fdn): bool - { - } + { + } /** * Get the hash to store in database column ldap_dn_hash for a given dn */ protected function getDNHash(string $fdn): string - { - } + { + } /** * Gets the name based on the provided LDAP DN. @@ -151,27 +149,27 @@ protected function getDNHash(string $fdn): string * @return string|false */ public function getNameByDN($fdn) - { - } + { + } /** * @param array $hashList */ protected function prepareListOfIdsQuery(array $hashList): IQueryBuilder - { - } + { + } protected function collectResultsFromListOfIdsQuery(IQueryBuilder $qb, array &$results): void - { - } + { + } /** * @param array $fdns * @return array */ public function getListOfIdsByDn(array $fdns): array - { - } + { + } /** * Searches mapped names by the giving string in the name column @@ -179,8 +177,8 @@ public function getListOfIdsByDn(array $fdns): array * @return string[] */ public function getNamesBySearch(string $search, string $prefixMatch = '', string $postfixMatch = ''): array - { - } + { + } /** * Gets the name based on the provided LDAP UUID. @@ -189,12 +187,12 @@ public function getNamesBySearch(string $search, string $prefixMatch = '', strin * @return string|false */ public function getNameByUUID($uuid) - { - } + { + } public function getDnByUUID($uuid) - { - } + { + } /** * Gets the UUID based on the provided LDAP DN @@ -204,12 +202,12 @@ public function getDnByUUID($uuid) * @throws \Exception */ public function getUUIDByDN($dn) - { - } + { + } public function getList(int $offset = 0, ?int $limit = null, bool $invalidatedOnly = false): array - { - } + { + } /** * attempts to map the given entry @@ -220,8 +218,8 @@ public function getList(int $offset = 0, ?int $limit = null, bool $invalidatedOn * @return bool */ public function map($fdn, $name, $uuid) - { - } + { + } /** * removes a mapping based on the owncloud_name of the entry @@ -230,8 +228,8 @@ public function map($fdn, $name, $uuid) * @return bool */ public function unmap($name) - { - } + { + } /** * Truncates the mapping table @@ -239,8 +237,8 @@ public function unmap($name) * @return bool */ public function clear() - { - } + { + } /** * clears the mapping table one by one and executing a callback with @@ -252,8 +250,8 @@ public function clear() * deleted */ public function clearCb(callable $preCallback, callable $postCallback): bool - { - } + { + } /** * returns the number of entries in the mappings table @@ -261,10 +259,10 @@ public function clearCb(callable $preCallback, callable $postCallback): bool * @return int */ public function count(): int - { - } + { + } public function countInvalidated(): int - { - } + { + } } diff --git a/tests/stubs/oca_user_ldap_mapping_usermapping.php b/tests/stubs/oca_user_ldap_mapping_usermapping.php index 17c7a86e0..ae7aea214 100644 --- a/tests/stubs/oca_user_ldap_mapping_usermapping.php +++ b/tests/stubs/oca_user_ldap_mapping_usermapping.php @@ -25,21 +25,21 @@ class UserMapping extends AbstractMapping { protected const PROV_API_REGEX = '/\/ocs\/v[1-9].php\/cloud\/(groups|users)/'; public function __construct(IDBConnection $dbc, ICacheFactory $cacheFactory, IAppConfig $config, bool $isCLI, private IAssertion $assertion) - { - } + { + } /** * @throws HintException */ public function map($fdn, $name, $uuid): bool - { - } + { + } /** * returns the DB table name which holds the mappings * @return string */ protected function getTableName(bool $includePrefix = true) - { - } + { + } } diff --git a/tests/stubs/stecman_component_symfony_console_bashcompletion_completion_completionawareinterface.php b/tests/stubs/stecman_component_symfony_console_bashcompletion_completion_completionawareinterface.php index 8a4d5c439..20963cb8c 100644 --- a/tests/stubs/stecman_component_symfony_console_bashcompletion_completion_completionawareinterface.php +++ b/tests/stubs/stecman_component_symfony_console_bashcompletion_completion_completionawareinterface.php @@ -14,9 +14,7 @@ interface CompletionAwareInterface * @param CompletionContext $context * @return array */ - public function completeOptionValues($optionName, CompletionContext $context) - { - } + public function completeOptionValues($optionName, CompletionContext $context); /** * Return possible values for the named argument @@ -25,7 +23,5 @@ public function completeOptionValues($optionName, CompletionContext $context) * @param CompletionContext $context * @return array */ - public function completeArgumentValues($argumentName, CompletionContext $context) - { - } + public function completeArgumentValues($argumentName, CompletionContext $context); } diff --git a/tests/stubs/symfony_component_console_command_command.php b/tests/stubs/symfony_component_console_command_command.php index 59094f71a..b30208feb 100644 --- a/tests/stubs/symfony_component_console_command_command.php +++ b/tests/stubs/symfony_component_console_command_command.php @@ -32,7 +32,7 @@ * * @author Fabien Potencier */ -class Command +class Command implements SignalableCommandInterface { // see https://tldp.org/LDP/abs/html/exitcodes.html public const SUCCESS = 0; @@ -40,23 +40,15 @@ class Command public const INVALID = 2; /** - * @var string|null The default command name - * - * @deprecated since Symfony 6.1, use the AsCommand attribute instead - */ - protected static $defaultName; - - /** - * @var string|null The default command description - * - * @deprecated since Symfony 6.1, use the AsCommand attribute instead + * @deprecated since Symfony 7.3, use the #[AsCommand] attribute instead */ - protected static $defaultDescription; - public static function getDefaultName(): ?string { } + /** + * @deprecated since Symfony 7.3, use the #[AsCommand] attribute instead + */ public static function getDefaultDescription(): ?string { } @@ -66,7 +58,7 @@ public static function getDefaultDescription(): ?string * * @throws LogicException When the command name is empty */ - public function __construct(?string $name = null) + public function __construct(?string $name = null, ?callable $code = null) { } @@ -74,24 +66,16 @@ public function __construct(?string $name = null) * Ignores validation errors. * * This is mainly useful for the help command. - * - * @return void */ - public function ignoreValidationErrors() + public function ignoreValidationErrors(): void { } - /** - * @return void - */ - public function setApplication(?Application $application = null) + public function setApplication(?Application $application): void { } - /** - * @return void - */ - public function setHelperSet(HelperSet $helperSet) + public function setHelperSet(HelperSet $helperSet): void { } @@ -114,10 +98,8 @@ public function getApplication(): ?Application * * Override this to check for x or y and return false if the command cannot * run properly under the current conditions. - * - * @return bool */ - public function isEnabled() + public function isEnabled(): bool { } @@ -144,7 +126,7 @@ protected function configure() * * @see setCode() */ - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): int { } @@ -196,12 +178,21 @@ public function run(InputInterface $input, OutputInterface $output): int } /** - * Adds suggestions to $suggestions for the current completion input (e.g. option or argument). + * Supplies suggestions when resolving possible completion options for input (e.g. option or argument). */ public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void { } + /** + * Gets the code that is executed by the command. + * + * @return ?callable null if the code has not been set with setCode() + */ + public function getCode(): ?callable + { + } + /** * Sets the code to execute when running this command. * @@ -264,31 +255,31 @@ public function getNativeDefinition(): InputDefinition /** * Adds an argument. * - * @param $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL - * @param $default The default value (for InputArgument::OPTIONAL mode only) + * @param $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL + * @param $default The default value (for InputArgument::OPTIONAL mode only) * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion * * @return $this * * @throws InvalidArgumentException When argument mode is not valid */ - public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null): static + public function addArgument(string $name, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static { } /** * Adds an option. * - * @param $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param $mode The option mode: One of the InputOption::VALUE_* constants - * @param $default The default value (must be null for InputOption::VALUE_NONE) + * @param $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts + * @param $mode The option mode: One of the InputOption::VALUE_* constants + * @param $default The default value (must be null for InputOption::VALUE_NONE) * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion * * @return $this * * @throws InvalidArgumentException If option mode is invalid or incompatible */ - public function addOption(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null): static + public function addOption(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', mixed $default = null, array|\Closure $suggestedValues = []): static { } @@ -431,12 +422,18 @@ public function getUsages(): array /** * Gets a helper instance by name. * - * @return HelperInterface - * * @throws LogicException if no HelperSet is defined * @throws InvalidArgumentException if the helper is not defined */ - public function getHelper(string $name): mixed + public function getHelper(string $name): HelperInterface + { + } + + public function getSubscribedSignals(): array + { + } + + public function handleSignal(int $signal, int|false $previousExitCode = 0): int|false { } } diff --git a/tests/stubs/symfony_component_console_helper_helper.php b/tests/stubs/symfony_component_console_helper_helper.php index 9ae9afa84..7c69d6f46 100644 --- a/tests/stubs/symfony_component_console_helper_helper.php +++ b/tests/stubs/symfony_component_console_helper_helper.php @@ -21,12 +21,9 @@ */ abstract class Helper implements HelperInterface { - protected $helperSet; + protected ?HelperSet $helperSet = null; - /** - * @return void - */ - public function setHelperSet(?HelperSet $helperSet = null) + public function setHelperSet(?HelperSet $helperSet): void { } @@ -57,24 +54,15 @@ public static function substr(?string $string, int $from, ?int $length = null): { } - /** - * @return string - */ - public static function formatTime(int|float $secs, int $precision = 1) + public static function formatTime(int|float $secs, int $precision = 1): string { } - /** - * @return string - */ - public static function formatMemory(int $memory) + public static function formatMemory(int $memory): string { } - /** - * @return string - */ - public static function removeDecoration(OutputFormatterInterface $formatter, ?string $string) + public static function removeDecoration(OutputFormatterInterface $formatter, ?string $string): string { } } diff --git a/tests/stubs/symfony_component_console_helper_helperinterface.php b/tests/stubs/symfony_component_console_helper_helperinterface.php index 9e58682da..8c4da3c91 100644 --- a/tests/stubs/symfony_component_console_helper_helperinterface.php +++ b/tests/stubs/symfony_component_console_helper_helperinterface.php @@ -20,26 +20,16 @@ interface HelperInterface { /** * Sets the helper set associated with this helper. - * - * @return void */ - public function setHelperSet(?HelperSet $helperSet) - { - } + public function setHelperSet(?HelperSet $helperSet): void; /** * Gets the helper set associated with this helper. */ - public function getHelperSet(): ?HelperSet - { - } + public function getHelperSet(): ?HelperSet; /** * Returns the canonical name of this helper. - * - * @return string */ - public function getName() - { - } + public function getName(): string; } diff --git a/tests/stubs/symfony_component_console_helper_questionhelper.php b/tests/stubs/symfony_component_console_helper_questionhelper.php index 8dd76875e..14c50aedf 100644 --- a/tests/stubs/symfony_component_console_helper_questionhelper.php +++ b/tests/stubs/symfony_component_console_helper_questionhelper.php @@ -51,19 +51,15 @@ public function getName(): string /** * Prevents usage of stty. - * - * @return void */ - public static function disableStty() + public static function disableStty(): void { } /** * Outputs the question prompt. - * - * @return void */ - protected function writePrompt(OutputInterface $output, Question $question) + protected function writePrompt(OutputInterface $output, Question $question): void { } @@ -76,10 +72,8 @@ protected function formatChoiceQuestionChoices(ChoiceQuestion $question, string /** * Outputs an error message. - * - * @return void */ - protected function writeError(OutputInterface $output, \Exception $error) + protected function writeError(OutputInterface $output, \Exception $error): void { } } diff --git a/tests/stubs/symfony_component_console_helper_table.php b/tests/stubs/symfony_component_console_helper_table.php index 373b3ffff..7e6f7d5a0 100644 --- a/tests/stubs/symfony_component_console_helper_table.php +++ b/tests/stubs/symfony_component_console_helper_table.php @@ -39,16 +39,14 @@ class Table private const DISPLAY_ORIENTATION_HORIZONTAL = 'horizontal'; private const DISPLAY_ORIENTATION_VERTICAL = 'vertical'; - public function __construct(OutputInterface $output) + public function __construct(private OutputInterface $output) { } /** * Sets a style definition. - * - * @return void */ - public static function setStyleDefinition(string $name, TableStyle $style) + public static function setStyleDefinition(string $name, TableStyle $style): void { } @@ -135,7 +133,7 @@ public function setHeaders(array $headers): static /** * @return $this */ - public function setRows(array $rows) + public function setRows(array $rows): static { } @@ -209,10 +207,8 @@ public function setVertical(bool $vertical = true): static * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | * +---------------+-----------------------+------------------+ - * - * @return void */ - public function render() + public function render(): void { } } diff --git a/tests/stubs/symfony_component_console_input_inputargument.php b/tests/stubs/symfony_component_console_input_inputargument.php index 8a106813a..403c8f5c5 100644 --- a/tests/stubs/symfony_component_console_input_inputargument.php +++ b/tests/stubs/symfony_component_console_input_inputargument.php @@ -25,20 +25,31 @@ */ class InputArgument { + /** + * Providing an argument is required (e.g. just 'app:foo' is not allowed). + */ public const REQUIRED = 1; + + /** + * Providing an argument is optional (e.g. 'app:foo' and 'app:foo bar' are both allowed). This is the default behavior of arguments. + */ public const OPTIONAL = 2; + + /** + * The argument accepts multiple values and turn them into an array (e.g. 'app:foo bar baz' will result in value ['bar', 'baz']). + */ public const IS_ARRAY = 4; /** * @param string $name The argument name - * @param int|null $mode The argument mode: a bit mask of self::REQUIRED, self::OPTIONAL and self::IS_ARRAY + * @param int-mask-of|null $mode The argument mode: a bit mask of self::REQUIRED, self::OPTIONAL and self::IS_ARRAY * @param string $description A description text * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only) * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion * * @throws InvalidArgumentException When argument mode is not valid */ - public function __construct(string $name, ?int $mode = null, string $description = '', string|bool|int|float|array|null $default = null, \Closure|array $suggestedValues = []) + public function __construct(private string $name, ?int $mode = null, private string $description = '', string|bool|int|float|array|null $default = null, private \Closure|array $suggestedValues = []) { } @@ -69,12 +80,8 @@ public function isArray(): bool /** * Sets the default value. - * - * @return void - * - * @throws LogicException When incorrect default value is given */ - public function setDefault(string|bool|int|float|array|null $default = null) + public function setDefault(string|bool|int|float|array|null $default): void { } @@ -85,12 +92,15 @@ public function getDefault(): string|bool|int|float|array|null { } + /** + * Returns true if the argument has values for input completion. + */ public function hasCompletion(): bool { } /** - * Adds suggestions to $suggestions for the current completion input. + * Supplies suggestions when command resolves possible completion options for input. * * @see Command::complete() */ diff --git a/tests/stubs/symfony_component_console_input_inputinterface.php b/tests/stubs/symfony_component_console_input_inputinterface.php index 352937c62..c177d960b 100644 --- a/tests/stubs/symfony_component_console_input_inputinterface.php +++ b/tests/stubs/symfony_component_console_input_inputinterface.php @@ -18,18 +18,13 @@ * InputInterface is the interface implemented by all input classes. * * @author Fabien Potencier - * - * @method string __toString() Returns a stringified representation of the args passed to the command. - * InputArguments MUST be escaped as well as the InputOption values passed to the command. */ interface InputInterface { /** * Returns the first argument from the raw parameters (not parsed). */ - public function getFirstArgument(): ?string - { - } + public function getFirstArgument(): ?string; /** * Returns true if the raw parameters (not parsed) contain a value. @@ -42,9 +37,7 @@ public function getFirstArgument(): ?string * @param string|array $values The values to look for in the raw parameters (can be an array) * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal */ - public function hasParameterOption(string|array $values, bool $onlyParams = false): bool - { - } + public function hasParameterOption(string|array $values, bool $onlyParams = false): bool; /** * Returns the value of a raw option (not parsed). @@ -57,124 +50,89 @@ public function hasParameterOption(string|array $values, bool $onlyParams = fals * @param string|array $values The value(s) to look for in the raw parameters (can be an array) * @param string|bool|int|float|array|null $default The default value to return if no result is found * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal - * - * @return mixed */ - public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false) - { - } + public function getParameterOption(string|array $values, string|bool|int|float|array|null $default = false, bool $onlyParams = false): mixed; /** * Binds the current Input instance with the given arguments and options. * - * @return void - * * @throws RuntimeException */ - public function bind(InputDefinition $definition) - { - } + public function bind(InputDefinition $definition): void; /** * Validates the input. * - * @return void - * * @throws RuntimeException When not enough arguments are given */ - public function validate() - { - } + public function validate(): void; /** * Returns all the given arguments merged with the default values. * * @return array */ - public function getArguments(): array - { - } + public function getArguments(): array; /** * Returns the argument value for a given argument name. * - * @return mixed - * * @throws InvalidArgumentException When argument given doesn't exist */ - public function getArgument(string $name) - { - } + public function getArgument(string $name): mixed; /** * Sets an argument value by name. * - * @return void - * * @throws InvalidArgumentException When argument given doesn't exist */ - public function setArgument(string $name, mixed $value) - { - } + public function setArgument(string $name, mixed $value): void; /** * Returns true if an InputArgument object exists by name or position. */ - public function hasArgument(string $name): bool - { - } + public function hasArgument(string $name): bool; /** * Returns all the given options merged with the default values. * * @return array */ - public function getOptions(): array - { - } + public function getOptions(): array; /** * Returns the option value for a given option name. * - * @return mixed - * * @throws InvalidArgumentException When option given doesn't exist */ - public function getOption(string $name) - { - } + public function getOption(string $name): mixed; /** * Sets an option value by name. * - * @return void - * * @throws InvalidArgumentException When option given doesn't exist */ - public function setOption(string $name, mixed $value) - { - } + public function setOption(string $name, mixed $value): void; /** * Returns true if an InputOption object exists by name. */ - public function hasOption(string $name): bool - { - } + public function hasOption(string $name): bool; /** * Is this input means interactive? */ - public function isInteractive(): bool - { - } + public function isInteractive(): bool; /** * Sets the input interactivity. + */ + public function setInteractive(bool $interactive): void; + + /** + * Returns a stringified representation of the args passed to the command. * - * @return void + * InputArguments MUST be escaped as well as the InputOption values passed to the command. */ - public function setInteractive(bool $interactive) - { - } + public function __toString(): string; } diff --git a/tests/stubs/symfony_component_console_input_inputoption.php b/tests/stubs/symfony_component_console_input_inputoption.php index ab5680e57..aa1c2caaf 100644 --- a/tests/stubs/symfony_component_console_input_inputoption.php +++ b/tests/stubs/symfony_component_console_input_inputoption.php @@ -46,19 +46,19 @@ class InputOption public const VALUE_IS_ARRAY = 8; /** - * The option may have either positive or negative value (e.g. --ansi or --no-ansi). + * The option allows passing a negated variant (e.g. --ansi or --no-ansi). */ public const VALUE_NEGATABLE = 16; /** * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param int|null $mode The option mode: One of the VALUE_* constants + * @param int-mask-of|null $mode The option mode: One of the VALUE_* constants * @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE) * @param array|\Closure(CompletionInput,CompletionSuggestions):list $suggestedValues The values used for input completion * * @throws InvalidArgumentException If option mode is invalid or incompatible */ - public function __construct(string $name, string|array|null $shortcut = null, ?int $mode = null, string $description = '', string|bool|int|float|array|null $default = null, array|\Closure $suggestedValues = []) + public function __construct(string $name, string|array|null $shortcut = null, ?int $mode = null, private string $description = '', string|bool|int|float|array|null $default = null, private array|\Closure $suggestedValues = []) { } @@ -112,14 +112,19 @@ public function isArray(): bool { } + /** + * Returns true if the option allows passing a negated variant. + * + * @return bool true if mode is self::VALUE_NEGATABLE, false otherwise + */ public function isNegatable(): bool { } /** - * @return void + * Sets the default value. */ - public function setDefault(string|bool|int|float|array|null $default = null) + public function setDefault(string|bool|int|float|array|null $default): void { } @@ -137,12 +142,15 @@ public function getDescription(): string { } + /** + * Returns true if the option has values for input completion. + */ public function hasCompletion(): bool { } /** - * Adds suggestions to $suggestions for the current completion input. + * Supplies suggestions when command resolves possible completion options for input. * * @see Command::complete() */ diff --git a/tests/stubs/symfony_component_console_output_consoleoutput.php b/tests/stubs/symfony_component_console_output_consoleoutput.php index 6a01816e3..afab04598 100644 --- a/tests/stubs/symfony_component_console_output_consoleoutput.php +++ b/tests/stubs/symfony_component_console_output_consoleoutput.php @@ -45,24 +45,15 @@ public function section(): ConsoleSectionOutput { } - /** - * @return void - */ - public function setDecorated(bool $decorated) + public function setDecorated(bool $decorated): void { } - /** - * @return void - */ - public function setFormatter(OutputFormatterInterface $formatter) + public function setFormatter(OutputFormatterInterface $formatter): void { } - /** - * @return void - */ - public function setVerbosity(int $level) + public function setVerbosity(int $level): void { } @@ -70,10 +61,7 @@ public function getErrorOutput(): OutputInterface { } - /** - * @return void - */ - public function setErrorOutput(OutputInterface $error) + public function setErrorOutput(OutputInterface $error): void { } diff --git a/tests/stubs/symfony_component_console_output_consoleoutputinterface.php b/tests/stubs/symfony_component_console_output_consoleoutputinterface.php index 79062020c..1f8f147ce 100644 --- a/tests/stubs/symfony_component_console_output_consoleoutputinterface.php +++ b/tests/stubs/symfony_component_console_output_consoleoutputinterface.php @@ -22,18 +22,9 @@ interface ConsoleOutputInterface extends OutputInterface /** * Gets the OutputInterface for errors. */ - public function getErrorOutput(): OutputInterface - { - } + public function getErrorOutput(): OutputInterface; - /** - * @return void - */ - public function setErrorOutput(OutputInterface $error) - { - } + public function setErrorOutput(OutputInterface $error): void; - public function section(): ConsoleSectionOutput - { - } + public function section(): ConsoleSectionOutput; } diff --git a/tests/stubs/symfony_component_console_output_consolesectionoutput.php b/tests/stubs/symfony_component_console_output_consolesectionoutput.php index a5c231792..dcfd6ccf2 100644 --- a/tests/stubs/symfony_component_console_output_consolesectionoutput.php +++ b/tests/stubs/symfony_component_console_output_consolesectionoutput.php @@ -43,19 +43,15 @@ public function setMaxHeight(int $maxHeight): void * Clears previous output for this section. * * @param int $lines Number of lines to clear. If null, then the entire output of this section is cleared - * - * @return void */ - public function clear(?int $lines = null) + public function clear(?int $lines = null): void { } /** * Overwrites the previous output with a new message. - * - * @return void */ - public function overwrite(string|iterable $message) + public function overwrite(string|iterable $message): void { } @@ -81,10 +77,7 @@ public function addNewLineOfInputSubmit(): void { } - /** - * @return void - */ - protected function doWrite(string $message, bool $newline) + protected function doWrite(string $message, bool $newline): void { } } diff --git a/tests/stubs/symfony_component_console_output_output.php b/tests/stubs/symfony_component_console_output_output.php index a555faaf7..62d3f827e 100644 --- a/tests/stubs/symfony_component_console_output_output.php +++ b/tests/stubs/symfony_component_console_output_output.php @@ -17,13 +17,14 @@ /** * Base class for output classes. * - * There are five levels of verbosity: + * There are six levels of verbosity: * * * normal: no option passed (normal output) * * verbose: -v (more output) * * very verbose: -vv (highly extended output) * * debug: -vvv (all debug output) - * * quiet: -q (no output) + * * quiet: -q (only output errors) + * * silent: --silent (no output) * * @author Fabien Potencier */ @@ -38,10 +39,7 @@ public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $deco { } - /** - * @return void - */ - public function setFormatter(OutputFormatterInterface $formatter) + public function setFormatter(OutputFormatterInterface $formatter): void { } @@ -49,10 +47,7 @@ public function getFormatter(): OutputFormatterInterface { } - /** - * @return void - */ - public function setDecorated(bool $decorated) + public function setDecorated(bool $decorated): void { } @@ -60,10 +55,7 @@ public function isDecorated(): bool { } - /** - * @return void - */ - public function setVerbosity(int $level) + public function setVerbosity(int $level): void { } @@ -71,6 +63,10 @@ public function getVerbosity(): int { } + public function isSilent(): bool + { + } + public function isQuiet(): bool { } @@ -87,26 +83,16 @@ public function isDebug(): bool { } - /** - * @return void - */ - public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL) + public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL): void { } - /** - * @return void - */ - public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) + public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL): void { } /** * Writes a message to the output. - * - * @return void */ - abstract protected function doWrite(string $message, bool $newline) - { - } + abstract protected function doWrite(string $message, bool $newline): void; } diff --git a/tests/stubs/symfony_component_console_output_outputinterface.php b/tests/stubs/symfony_component_console_output_outputinterface.php index f0b0b2f10..969a3b022 100644 --- a/tests/stubs/symfony_component_console_output_outputinterface.php +++ b/tests/stubs/symfony_component_console_output_outputinterface.php @@ -17,9 +17,12 @@ * OutputInterface is the interface implemented by all Output classes. * * @author Fabien Potencier + * + * @method bool isSilent() */ interface OutputInterface { + public const VERBOSITY_SILENT = 8; public const VERBOSITY_QUIET = 16; public const VERBOSITY_NORMAL = 32; public const VERBOSITY_VERBOSE = 64; @@ -36,100 +39,65 @@ interface OutputInterface * @param bool $newline Whether to add a newline * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL - * - * @return void */ - public function write(string|iterable $messages, bool $newline = false, int $options = 0) - { - } + public function write(string|iterable $messages, bool $newline = false, int $options = 0): void; /** * Writes a message to the output and adds a newline at the end. * * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), * 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL - * - * @return void */ - public function writeln(string|iterable $messages, int $options = 0) - { - } + public function writeln(string|iterable $messages, int $options = 0): void; /** * Sets the verbosity of the output. * * @param self::VERBOSITY_* $level - * - * @return void */ - public function setVerbosity(int $level) - { - } + public function setVerbosity(int $level): void; /** * Gets the current verbosity of the output. * * @return self::VERBOSITY_* */ - public function getVerbosity(): int - { - } + public function getVerbosity(): int; /** * Returns whether verbosity is quiet (-q). */ - public function isQuiet(): bool - { - } + public function isQuiet(): bool; /** * Returns whether verbosity is verbose (-v). */ - public function isVerbose(): bool - { - } + public function isVerbose(): bool; /** * Returns whether verbosity is very verbose (-vv). */ - public function isVeryVerbose(): bool - { - } + public function isVeryVerbose(): bool; /** * Returns whether verbosity is debug (-vvv). */ - public function isDebug(): bool - { - } + public function isDebug(): bool; /** * Sets the decorated flag. - * - * @return void */ - public function setDecorated(bool $decorated) - { - } + public function setDecorated(bool $decorated): void; /** * Gets the decorated flag. */ - public function isDecorated(): bool - { - } + public function isDecorated(): bool; - /** - * @return void - */ - public function setFormatter(OutputFormatterInterface $formatter) - { - } + public function setFormatter(OutputFormatterInterface $formatter): void; /** * Returns current output formatter instance. */ - public function getFormatter(): OutputFormatterInterface - { - } + public function getFormatter(): OutputFormatterInterface; } diff --git a/tests/stubs/symfony_component_console_output_streamoutput.php b/tests/stubs/symfony_component_console_output_streamoutput.php index 492a5d6e9..6d356e3a2 100644 --- a/tests/stubs/symfony_component_console_output_streamoutput.php +++ b/tests/stubs/symfony_component_console_output_streamoutput.php @@ -50,10 +50,7 @@ public function getStream() { } - /** - * @return void - */ - protected function doWrite(string $message, bool $newline) + protected function doWrite(string $message, bool $newline): void { } diff --git a/tests/stubs/symfony_component_console_question_confirmationquestion.php b/tests/stubs/symfony_component_console_question_confirmationquestion.php index 0db6fe2fa..16dc7905b 100644 --- a/tests/stubs/symfony_component_console_question_confirmationquestion.php +++ b/tests/stubs/symfony_component_console_question_confirmationquestion.php @@ -23,7 +23,7 @@ class ConfirmationQuestion extends Question * @param bool $default The default answer to return, true or false * @param string $trueAnswerRegex A regex to match the "yes" answer */ - public function __construct(string $question, bool $default = true, string $trueAnswerRegex = '/^y/i') + public function __construct(string $question, bool $default = true, private string $trueAnswerRegex = '/^y/i') { } } diff --git a/tests/stubs/symfony_component_console_question_question.php b/tests/stubs/symfony_component_console_question_question.php index c04b412b9..ead7b5bd0 100644 --- a/tests/stubs/symfony_component_console_question_question.php +++ b/tests/stubs/symfony_component_console_question_question.php @@ -25,8 +25,10 @@ class Question * @param string $question The question to ask to the user * @param string|bool|int|float|null $default The default answer to return if the user enters nothing */ - public function __construct(string $question, string|bool|int|float|null $default = null) - { + public function __construct( + private string $question, + private string|bool|int|float|null $default = null, + ) { } /** @@ -59,6 +61,23 @@ public function setMultiline(bool $multiline): static { } + /** + * Returns the timeout in seconds. + */ + public function getTimeout(): ?int + { + } + + /** + * Sets the maximum time the user has to answer the question. + * If the user does not answer within this time, an exception will be thrown. + * + * @return $this + */ + public function setTimeout(?int $seconds): static + { + } + /** * Returns whether the user response must be hidden. */ @@ -113,6 +132,8 @@ public function setAutocompleterValues(?iterable $values): static /** * Gets the callback function used for the autocompleter. + * + * @return (callable(string):string[])|null */ public function getAutocompleterCallback(): ?callable { @@ -123,23 +144,29 @@ public function getAutocompleterCallback(): ?callable * * The callback is passed the user input as argument and should return an iterable of corresponding suggestions. * + * @param (callable(string):string[])|null $callback + * * @return $this */ - public function setAutocompleterCallback(?callable $callback = null): static + public function setAutocompleterCallback(?callable $callback): static { } /** * Sets a validator for the question. * + * @param (callable(mixed):mixed)|null $validator + * * @return $this */ - public function setValidator(?callable $validator = null): static + public function setValidator(?callable $validator): static { } /** * Gets the validator for the question. + * + * @return (callable(mixed):mixed)|null */ public function getValidator(): ?callable { @@ -170,7 +197,7 @@ public function getMaxAttempts(): ?int /** * Sets a normalizer for the response. * - * The normalizer can be a callable (a string), a closure or a class implementing __invoke. + * @param callable(mixed):mixed $normalizer * * @return $this */ @@ -181,16 +208,13 @@ public function setNormalizer(callable $normalizer): static /** * Gets the normalizer for the response. * - * The normalizer can ba a callable (a string), a closure or a class implementing __invoke. + * @return (callable(mixed):mixed)|null */ public function getNormalizer(): ?callable { } - /** - * @return bool - */ - protected function isAssoc(array $array) + protected function isAssoc(array $array): bool { } diff --git a/tests/stubs/symfony_component_process_process.php b/tests/stubs/symfony_component_process_process.php index acc5de449..e40b2b71b 100644 --- a/tests/stubs/symfony_component_process_process.php +++ b/tests/stubs/symfony_component_process_process.php @@ -187,7 +187,12 @@ public function run(?callable $callback = null, array $env = []): int * * @return $this * - * @throws ProcessFailedException if the process didn't terminate successfully + * @throws ProcessFailedException When process didn't terminate successfully + * @throws RuntimeException When process can't be launched + * @throws RuntimeException When process is already running + * @throws ProcessTimedOutException When process timed out + * @throws ProcessSignaledException When process stopped after receiving signal + * @throws LogicException In case a callback is provided and output has been disabled * * @final */