diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 64a33276448..1b3611c5e31 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -44,6 +44,9 @@ + + + @@ -52,6 +55,9 @@ + + + @@ -63,6 +69,10 @@ + + + + @@ -2083,7 +2093,6 @@ - diff --git a/lib/public/AppFramework/Attribute/ASince.php b/lib/public/AppFramework/Attribute/ASince.php index 1e0c45348cf..3f5953a78c9 100644 --- a/lib/public/AppFramework/Attribute/ASince.php +++ b/lib/public/AppFramework/Attribute/ASince.php @@ -22,12 +22,16 @@ abstract class ASince { * @param string $since For shipped apps and server code such as core/ and lib/, * this should be the server version. For other apps it * should be the semantic app version. + * @since 32.0.0 */ public function __construct( protected string $since, ) { } + /** + * @since 32.0.0 + */ public function getSince(): string { return $this->since; } diff --git a/lib/public/AppFramework/Attribute/ExceptionalImplementable.php b/lib/public/AppFramework/Attribute/ExceptionalImplementable.php index 23e9f830d9b..04905a397d4 100644 --- a/lib/public/AppFramework/Attribute/ExceptionalImplementable.php +++ b/lib/public/AppFramework/Attribute/ExceptionalImplementable.php @@ -22,16 +22,25 @@ use Attribute; #[Consumable(since: '32.0.0')] #[Implementable(since: '32.0.0')] class ExceptionalImplementable { + /** + * @since 32.0.0 + */ public function __construct( protected string $app, protected ?string $class = null, ) { } + /** + * @since 32.0.0 + */ public function getApp(): string { return $this->app; } + /** + * @since 32.0.0 + */ public function getClass(): ?string { return $this->class; } diff --git a/lib/public/AppFramework/Controller.php b/lib/public/AppFramework/Controller.php index a4c0ae49ddb..d4f26bef007 100644 --- a/lib/public/AppFramework/Controller.php +++ b/lib/public/AppFramework/Controller.php @@ -141,6 +141,9 @@ abstract class Controller { . $format . '!'); } + /** + * @since 33.0.0 + */ public function isResponderRegistered(string $responder): bool { return isset($this->responders[$responder]); } diff --git a/lib/public/AppFramework/Db/SnowflakeAwareEntity.php b/lib/public/AppFramework/Db/SnowflakeAwareEntity.php index 87c91e995b8..1085927fffe 100644 --- a/lib/public/AppFramework/Db/SnowflakeAwareEntity.php +++ b/lib/public/AppFramework/Db/SnowflakeAwareEntity.php @@ -26,12 +26,16 @@ abstract class SnowflakeAwareEntity extends Entity { /** @psalm-param $_fieldTypes array */ protected array $_fieldTypes = ['id' => Types::STRING]; + /** + * @since 33.0.0 + */ public function setId($id): void { throw new \LogicException('Use generated id to set a new id to the Snowflake aware entity.'); } /** * Automatically creates a snowflake ID + * @since 33.0.0 */ public function generateId(): void { if ($this->id === null) { @@ -41,10 +45,16 @@ abstract class SnowflakeAwareEntity extends Entity { } } + /** + * @since 33.0.0 + */ public function getCreatedAt(): ?\DateTimeImmutable { return $this->getSnowflake()?->getCreatedAt(); } + /** + * @since 33.0.0 + */ public function getSnowflake(): ?Snowflake { if ($this->id === null) { return null; diff --git a/lib/public/AppFramework/Http/Attribute/RequestHeader.php b/lib/public/AppFramework/Http/Attribute/RequestHeader.php index 1d0fbbfa0c3..0f8e9035cce 100644 --- a/lib/public/AppFramework/Http/Attribute/RequestHeader.php +++ b/lib/public/AppFramework/Http/Attribute/RequestHeader.php @@ -24,6 +24,7 @@ class RequestHeader { * @param lowercase-string $name The name of the request header * @param non-empty-string $description The description of the request header * @param bool $indirect Allow indirect usage of the header for example in a middleware. Enabling this turns off the check which ensures that the header must be referenced in the controller method. + * @since 32.0.0 */ public function __construct( protected string $name, diff --git a/lib/public/AppFramework/PublicShareController.php b/lib/public/AppFramework/PublicShareController.php index 9bab261d7bd..feb4ca53a38 100644 --- a/lib/public/AppFramework/PublicShareController.php +++ b/lib/public/AppFramework/PublicShareController.php @@ -26,6 +26,9 @@ use OCP\ISession; */ abstract class PublicShareController extends Controller { + /** + * @since 33.0.0 + */ public const DAV_AUTHENTICATED_FRONTEND = 'public_link_authenticated_frontend'; /** @var string */ @@ -118,6 +121,8 @@ abstract class PublicShareController extends Controller { /** * Validate the token and password hash stored in session + * + * @since 33.0.0 */ protected function validateTokenSession(string $token, string $passwordHash): bool { $allowedTokensJSON = $this->session->get(self::DAV_AUTHENTICATED_FRONTEND) ?? '[]'; @@ -131,6 +136,8 @@ abstract class PublicShareController extends Controller { /** * Store the token and password hash in session + * + * @since 33.0.0 */ protected function storeTokenSession(string $token, string $passwordHash = ''): void { $allowedTokensJSON = $this->session->get(self::DAV_AUTHENTICATED_FRONTEND) ?? '[]'; diff --git a/lib/public/BackgroundJob/Job.php b/lib/public/BackgroundJob/Job.php index 2d552383621..dbf3dda866d 100644 --- a/lib/public/BackgroundJob/Job.php +++ b/lib/public/BackgroundJob/Job.php @@ -35,6 +35,9 @@ abstract class Job implements IJob, IParallelAwareJob { ) { } + /** + * @since 25.0.0 + */ #[Override] public function start(IJobList $jobList): void { $jobList->setLastRun($this); @@ -59,45 +62,72 @@ abstract class Job implements IJob, IParallelAwareJob { } } + /** + * @since 15.0.0 + */ #[Override] final public function setId(string $id): void { $this->id = $id; } + /** + * @since 15.0.0 + */ #[Override] final public function setLastRun(int $lastRun): void { $this->lastRun = $lastRun; } + /** + * @since 15.0.0 + */ #[Override] public function setArgument(mixed $argument): void { $this->argument = $argument; } + /** + * @since 15.0.0 + */ #[Override] final public function getId(): string { return $this->id; } + /** + * @since 15.0.0 + */ #[Override] final public function getLastRun(): int { return $this->lastRun; } + /** + * @since 15.0.0 + */ #[Override] public function getArgument(): mixed { return $this->argument; } + /** + * @since 25.0.0 + */ #[Override] public function setAllowParallelRuns(bool $allow): void { $this->allowParallelRuns = $allow; } + /** + * @since 25.0.0 + */ #[Override] public function getAllowParallelRuns(): bool { return $this->allowParallelRuns; } + /** + * @since 15.0.0 + */ abstract protected function run($argument); } diff --git a/lib/public/Calendar/CalendarExportOptions.php b/lib/public/Calendar/CalendarExportOptions.php index bf21dd85ae4..a7778f57852 100644 --- a/lib/public/Calendar/CalendarExportOptions.php +++ b/lib/public/Calendar/CalendarExportOptions.php @@ -24,6 +24,7 @@ final class CalendarExportOptions { * Gets the export format * * @return 'ical'|'jcal'|'xcal' (defaults to ical) + * @since 32.0.0 */ public function getFormat(): string { return $this->format; @@ -33,6 +34,7 @@ final class CalendarExportOptions { * Sets the export format * * @param 'ical'|'jcal'|'xcal' $format + * @since 32.0.0 */ public function setFormat(string $format): void { $this->format = $format; @@ -40,6 +42,8 @@ final class CalendarExportOptions { /** * Gets the start of the range to export + * + * @since 32.0.0 */ public function getRangeStart(): ?string { return $this->rangeStart; @@ -47,6 +51,8 @@ final class CalendarExportOptions { /** * Sets the start of the range to export + * + * @since 32.0.0 */ public function setRangeStart(?string $rangeStart): void { $this->rangeStart = $rangeStart; @@ -54,6 +60,8 @@ final class CalendarExportOptions { /** * Gets the number of objects to export + * + * @since 32.0.0 */ public function getRangeCount(): ?int { return $this->rangeCount; @@ -61,6 +69,8 @@ final class CalendarExportOptions { /** * Sets the number of objects to export + * + * @since 32.0.0 */ public function setRangeCount(?int $rangeCount): void { $this->rangeCount = $rangeCount; diff --git a/lib/public/Calendar/CalendarImportOptions.php b/lib/public/Calendar/CalendarImportOptions.php index 2bdddfd50b3..f5f330a4254 100644 --- a/lib/public/Calendar/CalendarImportOptions.php +++ b/lib/public/Calendar/CalendarImportOptions.php @@ -16,18 +16,42 @@ use InvalidArgumentException; */ final class CalendarImportOptions { + /** + * @since 32.0.0 + */ public const FORMATS = ['ical', 'jcal', 'xcal']; + /** + * @since 32.0.0 + */ public const VALIDATE_NONE = 0; + /** + * @since 32.0.0 + */ public const VALIDATE_SKIP = 1; + /** + * @since 32.0.0 + */ public const VALIDATE_FAIL = 2; + /** + * @since 32.0.0 + */ public const VALIDATE_OPTIONS = [ self::VALIDATE_NONE, self::VALIDATE_SKIP, self::VALIDATE_FAIL, ]; + /** + * @since 32.0.0 + */ public const ERROR_CONTINUE = 0; + /** + * @since 32.0.0 + */ public const ERROR_FAIL = 1; + /** + * @since 32.0.0 + */ public const ERROR_OPTIONS = [ self::ERROR_CONTINUE, self::ERROR_FAIL, @@ -43,6 +67,7 @@ final class CalendarImportOptions { * Gets the import format * * @return 'ical'|'jcal'|'xcal' (defaults to ical) + * @since 32.0.0 */ public function getFormat(): string { return $this->format; @@ -52,6 +77,7 @@ final class CalendarImportOptions { * Sets the import format * * @param 'ical'|'jcal'|'xcal' $value + * @since 32.0.0 */ public function setFormat(string $value): void { if (!in_array($value, self::FORMATS, true)) { @@ -62,6 +88,8 @@ final class CalendarImportOptions { /** * Gets whether to supersede existing objects + * + * @since 32.0.0 */ public function getSupersede(): bool { return $this->supersede; @@ -69,6 +97,8 @@ final class CalendarImportOptions { /** * Sets whether to supersede existing objects + * + * @since 32.0.0 */ public function setSupersede(bool $supersede): void { $this->supersede = $supersede; @@ -78,6 +108,7 @@ final class CalendarImportOptions { * Gets how to handle object errors * * @return int 0 - continue, 1 - fail + * @since 32.0.0 */ public function getErrors(): int { return $this->errors; @@ -89,6 +120,7 @@ final class CalendarImportOptions { * @param int $value 0 - continue, 1 - fail * * @template $value of self::ERROR_* + * @since 32.0.0 */ public function setErrors(int $value): void { if (!in_array($value, CalendarImportOptions::ERROR_OPTIONS, true)) { @@ -101,6 +133,7 @@ final class CalendarImportOptions { * Gets how to handle object validation * * @return int 0 - no validation, 1 - validate and skip on issue, 2 - validate and fail on issue + * @since 32.0.0 */ public function getValidate(): int { return $this->validate; @@ -112,6 +145,7 @@ final class CalendarImportOptions { * @param int $value 0 - no validation, 1 - validate and skip on issue, 2 - validate and fail on issue * * @template $value of self::VALIDATE_* + * @since 32.0.0 */ public function setValidate(int $value): void { if (!in_array($value, CalendarImportOptions::VALIDATE_OPTIONS, true)) { diff --git a/lib/public/Comments/CommentsEvent.php b/lib/public/Comments/CommentsEvent.php index deaeb4b4009..46e6ad202ac 100644 --- a/lib/public/Comments/CommentsEvent.php +++ b/lib/public/Comments/CommentsEvent.php @@ -57,7 +57,7 @@ class CommentsEvent extends Event { /** * @since 9.0.0 - * @depreacted Since 33.0.0 use instanceof CommentAddedEvent, CommentRemovedEvent, CommentUpdatedEvent or BeforeCommentUpdatedEvent instead. + * @deprecated 33.0.0 Use instanceof CommentAddedEvent, CommentRemovedEvent, CommentUpdatedEvent or BeforeCommentUpdatedEvent instead. */ public function getEvent(): string { return $this->event; diff --git a/lib/public/Comments/Events/BeforeCommentUpdatedEvent.php b/lib/public/Comments/Events/BeforeCommentUpdatedEvent.php index c8b0b172c8a..15df999a427 100644 --- a/lib/public/Comments/Events/BeforeCommentUpdatedEvent.php +++ b/lib/public/Comments/Events/BeforeCommentUpdatedEvent.php @@ -20,6 +20,8 @@ use OCP\Comments\IComment; final class BeforeCommentUpdatedEvent extends CommentsEvent { /** * CommentEvent constructor. + * + * @since 33.0.0 */ public function __construct(IComment $comment) { /** @psalm-suppress DeprecatedConstant */ diff --git a/lib/public/Comments/Events/CommentAddedEvent.php b/lib/public/Comments/Events/CommentAddedEvent.php index db4d22689e7..3323b46a93e 100644 --- a/lib/public/Comments/Events/CommentAddedEvent.php +++ b/lib/public/Comments/Events/CommentAddedEvent.php @@ -20,6 +20,8 @@ use OCP\Comments\IComment; final class CommentAddedEvent extends CommentsEvent { /** * CommentAddedEvent constructor. + * + * @since 33.0.0 */ public function __construct(IComment $comment) { /** @psalm-suppress DeprecatedConstant */ diff --git a/lib/public/Comments/Events/CommentDeletedEvent.php b/lib/public/Comments/Events/CommentDeletedEvent.php index 6178d70237c..b2f146ce50f 100644 --- a/lib/public/Comments/Events/CommentDeletedEvent.php +++ b/lib/public/Comments/Events/CommentDeletedEvent.php @@ -20,6 +20,8 @@ use OCP\Comments\IComment; final class CommentDeletedEvent extends CommentsEvent { /** * CommentRemovedEvent constructor. + * + * @since 33.0.0 */ public function __construct(IComment $comment) { /** @psalm-suppress DeprecatedConstant */ diff --git a/lib/public/Comments/Events/CommentUpdatedEvent.php b/lib/public/Comments/Events/CommentUpdatedEvent.php index b029ce702a1..23d21500ecb 100644 --- a/lib/public/Comments/Events/CommentUpdatedEvent.php +++ b/lib/public/Comments/Events/CommentUpdatedEvent.php @@ -20,6 +20,8 @@ use OCP\Comments\IComment; final class CommentUpdatedEvent extends CommentsEvent { /** * CommentUpdatedEvent constructor. + * + * @since 33.0.0 */ public function __construct(IComment $comment) { /** @psalm-suppress DeprecatedConstant */ diff --git a/lib/public/ContextChat/Events/ContentProviderRegisterEvent.php b/lib/public/ContextChat/Events/ContentProviderRegisterEvent.php index 32a542a0dbf..48e8c2e3ae9 100644 --- a/lib/public/ContextChat/Events/ContentProviderRegisterEvent.php +++ b/lib/public/ContextChat/Events/ContentProviderRegisterEvent.php @@ -17,6 +17,9 @@ use OCP\EventDispatcher\Event; * @since 32.0.0 */ class ContentProviderRegisterEvent extends Event { + /** + * @since 32.0.0 + */ public function __construct( private IContentManager $contentManager, ) { diff --git a/lib/public/ContextChat/Type/UpdateAccessOp.php b/lib/public/ContextChat/Type/UpdateAccessOp.php index 65100d1ce83..21a4185b392 100644 --- a/lib/public/ContextChat/Type/UpdateAccessOp.php +++ b/lib/public/ContextChat/Type/UpdateAccessOp.php @@ -13,6 +13,12 @@ namespace OCP\ContextChat\Type; * @since 32.0.0 */ class UpdateAccessOp { + /** + * @since 32.0.0 + */ public const ALLOW = 'allow'; + /** + * @since 32.0.0 + */ public const DENY = 'deny'; } diff --git a/lib/public/DB/QueryBuilder/ConflictResolutionMode.php b/lib/public/DB/QueryBuilder/ConflictResolutionMode.php index 56a59b39099..b41c314b5f4 100644 --- a/lib/public/DB/QueryBuilder/ConflictResolutionMode.php +++ b/lib/public/DB/QueryBuilder/ConflictResolutionMode.php @@ -17,10 +17,14 @@ namespace OCP\DB\QueryBuilder; enum ConflictResolutionMode { /** * Wait for the row to be unlocked. + * + * @since 34.0.0 */ case Ordinary; /** * Skip the row if it is locked. + * + * @since 34.0.0 */ case SkipLocked; } diff --git a/lib/public/DB/QueryBuilder/ITypedQueryBuilder.php b/lib/public/DB/QueryBuilder/ITypedQueryBuilder.php index 1901a22e749..5a906313802 100644 --- a/lib/public/DB/QueryBuilder/ITypedQueryBuilder.php +++ b/lib/public/DB/QueryBuilder/ITypedQueryBuilder.php @@ -22,6 +22,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { /** * @inheritDoc * @return IResult + * @since 34.0.0 */ #[Override] public function executeQuery(?IDBConnection $connection = null): IResult; @@ -29,6 +30,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { /** * @inheritDoc * @internal This method does not work with {@see self}. Use {@see self::selectColumns()} or {@see self::selectAlias()} instead. + * @since 34.0.0 */ #[Override] public function select(...$selects); @@ -46,6 +48,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { /** * @inheritDoc * @internal This method does not work with {@see self}. Use {@see self::selectColumnDistinct()} or {@see self::selectAlias()} instead. + * @since 34.0.0 */ #[Override] public function selectDistinct($select); @@ -63,6 +66,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { /** * @inheritDoc * @internal This method does not work with {@see self}. Use {@see self::selectColumns()} or {@see self::selectAlias()} instead. + * @since 34.0.0 */ #[Override] public function addSelect(...$select); @@ -75,6 +79,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @psalm-this-out self * @return $this * @note Psalm has a bug that prevents inferring the correct type in chained calls: https://github.com/vimeo/psalm/issues/8803. Convert the chained calls to standalone calls or switch to PHPStan, which suffered the same bug in the past, but fixed it in 2.1.5: https://github.com/phpstan/phpstan/issues/8439 + * @since 34.0.0 */ #[Override] public function selectAlias($select, $alias): self; @@ -83,6 +88,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function setParameter($key, $value, $type = null); @@ -90,6 +96,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { /** * @inheritDoc * @return $this + * @since 34.0.0 */ #[Override] public function setParameters(array $params, array $types = []); @@ -98,6 +105,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function setFirstResult($firstResult); @@ -106,6 +114,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function setMaxResults($maxResults); @@ -114,6 +123,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function delete($delete = null, $alias = null); @@ -122,6 +132,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function update($update = null, $alias = null); @@ -130,6 +141,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function insert($insert = null); @@ -138,6 +150,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function from($from, $alias = null); @@ -146,6 +159,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function join($fromAlias, $join, $alias, $condition = null); @@ -154,6 +168,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function innerJoin($fromAlias, $join, $alias, $condition = null); @@ -162,6 +177,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function leftJoin($fromAlias, $join, $alias, $condition = null); @@ -170,6 +186,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function rightJoin($fromAlias, $join, $alias, $condition = null); @@ -178,6 +195,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function set($key, $value); @@ -186,6 +204,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function where(...$predicates); @@ -194,6 +213,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function andWhere(...$where); @@ -202,6 +222,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function orWhere(...$where); @@ -210,6 +231,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function groupBy(...$groupBys); @@ -218,6 +240,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function addGroupBy(...$groupBy); @@ -226,6 +249,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function setValue($column, $value); @@ -233,6 +257,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { /** * @inheritDoc * @return $this + * @since 34.0.0 */ #[Override] public function values(array $values); @@ -241,6 +266,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function having(...$having); @@ -249,6 +275,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function andHaving(...$having); @@ -257,6 +284,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function orHaving(...$having); @@ -265,6 +293,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function orderBy($sort, $order = null); @@ -273,6 +302,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function addOrderBy($sort, $order = null); @@ -281,6 +311,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function resetQueryParts($queryPartNames = null); @@ -289,6 +320,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { * @inheritDoc * @return $this * @psalm-suppress MissingParamType + * @since 34.0.0 */ #[Override] public function resetQueryPart($queryPartName); @@ -296,6 +328,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { /** * @inheritDoc * @return $this + * @since 34.0.0 */ #[Override] public function hintShardKey(string $column, mixed $value, bool $overwrite = false): self; @@ -303,6 +336,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { /** * @inheritDoc * @return $this + * @since 34.0.0 */ #[Override] public function runAcrossAllShards(): self; @@ -310,6 +344,7 @@ interface ITypedQueryBuilder extends IQueryBuilder { /** * @inheritDoc * @return $this + * @since 34.0.0 */ #[Override] public function forUpdate(ConflictResolutionMode $conflictResolutionMode = ConflictResolutionMode::Ordinary): self; diff --git a/lib/public/Files/Cache/CacheEntriesRemovedEvent.php b/lib/public/Files/Cache/CacheEntriesRemovedEvent.php index 6038c3ce4a4..35c3f79844f 100644 --- a/lib/public/Files/Cache/CacheEntriesRemovedEvent.php +++ b/lib/public/Files/Cache/CacheEntriesRemovedEvent.php @@ -21,6 +21,7 @@ use OCP\EventDispatcher\Event; class CacheEntriesRemovedEvent extends Event { /** * @param ICacheEvent[] $cacheEntryRemovedEvents + * @since 34.0.0 */ public function __construct( private readonly array $cacheEntryRemovedEvents, @@ -30,6 +31,7 @@ class CacheEntriesRemovedEvent extends Event { /** * @return ICacheEvent[] + * @since 34.0.0 */ public function getCacheEntryRemovedEvents(): array { return $this->cacheEntryRemovedEvents; diff --git a/lib/public/Files/Config/Event/UserMountAddedEvent.php b/lib/public/Files/Config/Event/UserMountAddedEvent.php index 8abd7512188..d0ee2c22532 100644 --- a/lib/public/Files/Config/Event/UserMountAddedEvent.php +++ b/lib/public/Files/Config/Event/UserMountAddedEvent.php @@ -18,6 +18,9 @@ use OCP\Files\Config\ICachedMountInfo; * @since 32.0.0 */ class UserMountAddedEvent extends Event { + /** + * @since 32.0.0 + */ public function __construct( public readonly ICachedMountInfo $mountPoint, ) { diff --git a/lib/public/Files/Config/Event/UserMountRemovedEvent.php b/lib/public/Files/Config/Event/UserMountRemovedEvent.php index 0de7cfc4a99..b1094a05303 100644 --- a/lib/public/Files/Config/Event/UserMountRemovedEvent.php +++ b/lib/public/Files/Config/Event/UserMountRemovedEvent.php @@ -18,6 +18,9 @@ use OCP\Files\Config\ICachedMountInfo; * @since 32.0.0 */ class UserMountRemovedEvent extends Event { + /** + * @since 32.0.0 + */ public function __construct( public readonly ICachedMountInfo $mountPoint, ) { diff --git a/lib/public/Files/Config/Event/UserMountUpdatedEvent.php b/lib/public/Files/Config/Event/UserMountUpdatedEvent.php index f797bef134e..15f37e4e5d9 100644 --- a/lib/public/Files/Config/Event/UserMountUpdatedEvent.php +++ b/lib/public/Files/Config/Event/UserMountUpdatedEvent.php @@ -18,6 +18,9 @@ use OCP\Files\Config\ICachedMountInfo; * @since 32.0.0 */ class UserMountUpdatedEvent extends Event { + /** + * @since 32.0.0 + */ public function __construct( public readonly ICachedMountInfo $oldMountPoint, public readonly ICachedMountInfo $newMountPoint, diff --git a/lib/public/Files/Config/IPartialMountProvider.php b/lib/public/Files/Config/IPartialMountProvider.php index bac962d60dd..0b603e500ba 100644 --- a/lib/public/Files/Config/IPartialMountProvider.php +++ b/lib/public/Files/Config/IPartialMountProvider.php @@ -50,6 +50,7 @@ interface IPartialMountProvider extends IMountProvider { * in the scope of the setup request. * @param IStorageFactory $loader * @return array IMountPoint instances, indexed by mount-point + * @since 33.0.0 */ public function getMountsForPath( string $setupPathHint, diff --git a/lib/public/Files/Config/MountProviderArgs.php b/lib/public/Files/Config/MountProviderArgs.php index bc44603dcb9..73eefd52841 100644 --- a/lib/public/Files/Config/MountProviderArgs.php +++ b/lib/public/Files/Config/MountProviderArgs.php @@ -16,6 +16,9 @@ use OCP\Files\Cache\ICacheEntry; * @since 33.0.0 */ class MountProviderArgs { + /** + * @since 33.0.0 + */ public function __construct( public readonly ICachedMountInfo $mountInfo, public readonly ICacheEntry $cacheEntry, diff --git a/lib/public/Files/Conversion/ConversionMimeProvider.php b/lib/public/Files/Conversion/ConversionMimeProvider.php index 0daf4a10648..89d0372e664 100644 --- a/lib/public/Files/Conversion/ConversionMimeProvider.php +++ b/lib/public/Files/Conversion/ConversionMimeProvider.php @@ -34,18 +34,30 @@ class ConversionMimeProvider implements JsonSerializable { ) { } + /** + * @since 31.0.0 + */ public function getFrom(): string { return $this->from; } + /** + * @since 31.0.0 + */ public function getTo(): string { return $this->to; } + /** + * @since 31.0.0 + */ public function getExtension(): string { return $this->extension; } + /** + * @since 31.0.0 + */ public function getDisplayName(): string { return $this->displayName; } diff --git a/lib/public/Files/DavUtil.php b/lib/public/Files/DavUtil.php index 50c005f0d58..bd869d60305 100644 --- a/lib/public/Files/DavUtil.php +++ b/lib/public/Files/DavUtil.php @@ -80,6 +80,9 @@ class DavUtil { return $p; } + /** + * @since 34.0.0 + */ public static function canRename(FileInfo $info, FileInfo $parent): bool { // the root of a movable mountpoint can be renamed regardless of the file permissions if ($info->getMountPoint() instanceof IMovableMount && $info->getInternalPath() === '') { diff --git a/lib/public/Files/Events/BeforeRemotePropfindEvent.php b/lib/public/Files/Events/BeforeRemotePropfindEvent.php index ee9e728a979..396b8e94360 100644 --- a/lib/public/Files/Events/BeforeRemotePropfindEvent.php +++ b/lib/public/Files/Events/BeforeRemotePropfindEvent.php @@ -18,6 +18,9 @@ use OCP\EventDispatcher\Event; * @since 33.0.0 */ class BeforeRemotePropfindEvent extends Event { + /** + * @since 33.0.0 + */ public function __construct( private array $properties, ) { diff --git a/lib/public/Files/ISetupManager.php b/lib/public/Files/ISetupManager.php index b1b14ccf8cf..1519b2709d8 100644 --- a/lib/public/Files/ISetupManager.php +++ b/lib/public/Files/ISetupManager.php @@ -30,11 +30,14 @@ interface ISetupManager { * * @throws \OCP\HintException * @throws \OC\ServerNotAvailableException + * @since 34.0.0 */ public function setupForUser(IUser $user): void; /** * Tear down all file systems to free some memory. + * + * @since 34.0.0 */ public function tearDown(): void; @@ -44,11 +47,14 @@ interface ISetupManager { * * @throws \OCP\HintException * @throws \OC\ServerNotAvailableException + * @since 34.0.0 */ public function setupForPath(string $path, bool $includeChildren = false): void; /** * Get whether the file system is already setup for a specific user. + * + * @since 34.0.0 */ public function isSetupComplete(IUser $user): bool; } diff --git a/lib/public/Files/ObjectStore/Events/BucketCreatedEvent.php b/lib/public/Files/ObjectStore/Events/BucketCreatedEvent.php index bd6afcd8209..fc9f5f60538 100644 --- a/lib/public/Files/ObjectStore/Events/BucketCreatedEvent.php +++ b/lib/public/Files/ObjectStore/Events/BucketCreatedEvent.php @@ -17,6 +17,9 @@ use OCP\EventDispatcher\Event; #[Consumable(since: '33.0.0')] class BucketCreatedEvent extends Event { + /** + * @since 33.0.0 + */ public function __construct( private readonly string $bucket, private readonly string $endpoint, @@ -26,18 +29,30 @@ class BucketCreatedEvent extends Event { parent::__construct(); } + /** + * @since 33.0.0 + */ public function getBucket(): string { return $this->bucket; } + /** + * @since 33.0.0 + */ public function getEndpoint(): string { return $this->endpoint; } + /** + * @since 33.0.0 + */ public function getRegion(): string { return $this->region; } + /** + * @since 33.0.0 + */ public function getVersion(): string { return $this->version; } diff --git a/lib/public/Files/Template/FieldType.php b/lib/public/Files/Template/FieldType.php index 2d059cadc17..7d61d5a1040 100644 --- a/lib/public/Files/Template/FieldType.php +++ b/lib/public/Files/Template/FieldType.php @@ -11,9 +11,24 @@ namespace OCP\Files\Template; * @since 30.0.0 */ enum FieldType: string { + /** + * @since 30.0.0 + */ case RichText = 'rich-text'; + /** + * @since 30.0.0 + */ case CheckBox = 'checkbox'; + /** + * @since 30.0.0 + */ case DropDownList = 'drop-down-list'; + /** + * @since 30.0.0 + */ case Picture = 'picture'; + /** + * @since 30.0.0 + */ case Date = 'date'; } diff --git a/lib/public/OCM/Enum/ParamType.php b/lib/public/OCM/Enum/ParamType.php index fa4a19ebe17..571fc61122a 100644 --- a/lib/public/OCM/Enum/ParamType.php +++ b/lib/public/OCM/Enum/ParamType.php @@ -17,8 +17,20 @@ use OCP\AppFramework\Attribute\Consumable; */ #[Consumable(since: '33.0.0')] enum ParamType: string { + /** + * @since 33.0.0 + */ case STRING = 'string'; + /** + * @since 33.0.0 + */ case INT = 'int'; + /** + * @since 33.0.0 + */ case FLOAT = 'float'; + /** + * @since 33.0.0 + */ case BOOL = 'bool'; } diff --git a/lib/public/OpenMetrics/Metric.php b/lib/public/OpenMetrics/Metric.php index b5deb324db4..6147019db79 100644 --- a/lib/public/OpenMetrics/Metric.php +++ b/lib/public/OpenMetrics/Metric.php @@ -13,6 +13,9 @@ namespace OCP\OpenMetrics; * @since 33.0.0 */ final readonly class Metric { + /** + * @since 33.0.0 + */ public function __construct( public int|float|bool|MetricValue $value = false, /** @var string[] */ @@ -22,6 +25,9 @@ final readonly class Metric { $this->validateLabels(); } + /** + * @since 33.0.0 + */ public function label(string $name): ?string { return $this->labels[$name] ?? null; } diff --git a/lib/public/OpenMetrics/MetricType.php b/lib/public/OpenMetrics/MetricType.php index 07449593cc0..043d1e892bb 100644 --- a/lib/public/OpenMetrics/MetricType.php +++ b/lib/public/OpenMetrics/MetricType.php @@ -15,12 +15,36 @@ namespace OCP\OpenMetrics; * @since 33.0.0 */ enum MetricType { + /** + * @since 33.0.0 + */ case counter; + /** + * @since 33.0.0 + */ case gauge; + /** + * @since 33.0.0 + */ case histogram; + /** + * @since 33.0.0 + */ case gaugehistogram; + /** + * @since 33.0.0 + */ case stateset; + /** + * @since 33.0.0 + */ case info; + /** + * @since 33.0.0 + */ case summary; + /** + * @since 33.0.0 + */ case unknown; } diff --git a/lib/public/OpenMetrics/MetricValue.php b/lib/public/OpenMetrics/MetricValue.php index 34922947d25..c8d29c54e39 100644 --- a/lib/public/OpenMetrics/MetricValue.php +++ b/lib/public/OpenMetrics/MetricValue.php @@ -14,7 +14,16 @@ namespace OCP\OpenMetrics; * @since 33.0.0 */ enum MetricValue: string { + /** + * @since 33.0.0 + */ case NOT_A_NUMBER = 'NaN'; + /** + * @since 33.0.0 + */ case POSITIVE_INFINITY = '+Inf'; + /** + * @since 33.0.0 + */ case NEGATIVE_INFINITY = '-Inf'; } diff --git a/lib/public/Snowflake/Snowflake.php b/lib/public/Snowflake/Snowflake.php index 9fce0a5aea2..cc3d38bbe80 100644 --- a/lib/public/Snowflake/Snowflake.php +++ b/lib/public/Snowflake/Snowflake.php @@ -23,6 +23,7 @@ final readonly class Snowflake { * @psalm-param int<0,4095> $sequenceId * @psalm-param non-negative-int $seconds * @psalm-param int<0,999> $milliseconds + * @since 33.0.0 */ public function __construct( private int $serverId, @@ -36,6 +37,7 @@ final readonly class Snowflake { /** * @psalm-return int<0,1023> + * @since 33.0.0 */ public function getServerId(): int { return $this->serverId; @@ -43,17 +45,22 @@ final readonly class Snowflake { /** * @psalm-return int<0,4095> + * @since 33.0.0 */ public function getSequenceId(): int { return $this->sequenceId; } + /** + * @since 33.0.0 + */ public function isCli(): bool { return $this->isCli; } /** * @psalm-return non-negative-int + * @since 33.0.0 */ public function getSeconds(): int { return $this->seconds; @@ -61,11 +68,15 @@ final readonly class Snowflake { /** * @psalm-return int<0,999> + * @since 33.0.0 */ public function getMilliseconds(): int { return $this->milliseconds; } + /** + * @since 33.0.0 + */ public function getCreatedAt(): \DateTimeImmutable { return $this->createdAt; } diff --git a/lib/public/TaskProcessing/EShapeType.php b/lib/public/TaskProcessing/EShapeType.php index 306d285adea..c1c0a1ccd4d 100644 --- a/lib/public/TaskProcessing/EShapeType.php +++ b/lib/public/TaskProcessing/EShapeType.php @@ -17,18 +17,57 @@ use OCP\TaskProcessing\Exception\ValidationException; * @since 30.0.0 */ enum EShapeType: int { + /** + * @since 30.0.0 + */ case Number = 0; + /** + * @since 30.0.0 + */ case Text = 1; + /** + * @since 30.0.0 + */ case Image = 2; + /** + * @since 30.0.0 + */ case Audio = 3; + /** + * @since 30.0.0 + */ case Video = 4; + /** + * @since 30.0.0 + */ case File = 5; + /** + * @since 30.0.0 + */ case Enum = 6; + /** + * @since 30.0.0 + */ case ListOfNumbers = 10; + /** + * @since 30.0.0 + */ case ListOfTexts = 11; + /** + * @since 30.0.0 + */ case ListOfImages = 12; + /** + * @since 30.0.0 + */ case ListOfAudios = 13; + /** + * @since 30.0.0 + */ case ListOfVideos = 14; + /** + * @since 30.0.0 + */ case ListOfFiles = 15; /** diff --git a/lib/public/TaskProcessing/TaskTypes/ContextAgentAudioInteraction.php b/lib/public/TaskProcessing/TaskTypes/ContextAgentAudioInteraction.php index b668ea24806..18464db3d65 100644 --- a/lib/public/TaskProcessing/TaskTypes/ContextAgentAudioInteraction.php +++ b/lib/public/TaskProcessing/TaskTypes/ContextAgentAudioInteraction.php @@ -20,6 +20,9 @@ use OCP\TaskProcessing\ShapeDescriptor; * @since 32.0.0 */ class ContextAgentAudioInteraction implements IInternalTaskType { + /** + * @since 31.0.0 + */ public const ID = 'core:contextagent:audio-interaction'; private IL10N $l; diff --git a/lib/public/TaskProcessing/TaskTypes/ContextAgentInteraction.php b/lib/public/TaskProcessing/TaskTypes/ContextAgentInteraction.php index 6cb126e1894..db327012831 100644 --- a/lib/public/TaskProcessing/TaskTypes/ContextAgentInteraction.php +++ b/lib/public/TaskProcessing/TaskTypes/ContextAgentInteraction.php @@ -20,6 +20,9 @@ use OCP\TaskProcessing\ShapeDescriptor; * @since 31.0.0 */ class ContextAgentInteraction implements IInternalTaskType { + /** + * @since 31.0.0 + */ public const ID = 'core:contextagent:interaction'; private IL10N $l; diff --git a/lib/public/TaskProcessing/TaskTypes/TextToTextChangeTone.php b/lib/public/TaskProcessing/TaskTypes/TextToTextChangeTone.php index 0ea4575a187..7d02d102bec 100644 --- a/lib/public/TaskProcessing/TaskTypes/TextToTextChangeTone.php +++ b/lib/public/TaskProcessing/TaskTypes/TextToTextChangeTone.php @@ -20,6 +20,9 @@ use OCP\TaskProcessing\ShapeDescriptor; * @since 31.0.0 */ class TextToTextChangeTone implements ITaskType { + /** + * @since 31.0.0 + */ public const ID = 'core:text2text:changetone'; private IL10N $l; diff --git a/lib/public/TaskProcessing/TaskTypes/TextToTextChatWithTools.php b/lib/public/TaskProcessing/TaskTypes/TextToTextChatWithTools.php index 3e470bf23ae..53dae3dc3f2 100644 --- a/lib/public/TaskProcessing/TaskTypes/TextToTextChatWithTools.php +++ b/lib/public/TaskProcessing/TaskTypes/TextToTextChatWithTools.php @@ -20,6 +20,9 @@ use OCP\TaskProcessing\ShapeDescriptor; * @since 31.0.0 */ class TextToTextChatWithTools implements IInternalTaskType { + /** + * @since 31.0.0 + */ public const ID = 'core:text2text:chatwithtools'; private IL10N $l; diff --git a/lib/public/Template/ITemplate.php b/lib/public/Template/ITemplate.php index 7131df4d17c..b6b9433b35b 100644 --- a/lib/public/Template/ITemplate.php +++ b/lib/public/Template/ITemplate.php @@ -42,6 +42,7 @@ interface ITemplate { * This function assigns a variable in an array context. If the key already * exists, the value will be appended. It can be accessed via * $_[$key][$position] in the template. + * @since 32.0.0 */ public function append(string $key, mixed $value): void; }