@@ -29,22 +29,22 @@ |
||
| 29 | 29 | use OCP\Migration\SimpleMigrationStep; |
| 30 | 30 | |
| 31 | 31 | class Version24000Date20211213081506 extends SimpleMigrationStep { |
| 32 | - /** |
|
| 33 | - * @param IOutput $output |
|
| 34 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 35 | - * @param array $options |
|
| 36 | - * @return null|ISchemaWrapper |
|
| 37 | - */ |
|
| 38 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
| 39 | - /** @var ISchemaWrapper $schema */ |
|
| 40 | - $schema = $schemaClosure(); |
|
| 32 | + /** |
|
| 33 | + * @param IOutput $output |
|
| 34 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 35 | + * @param array $options |
|
| 36 | + * @return null|ISchemaWrapper |
|
| 37 | + */ |
|
| 38 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
| 39 | + /** @var ISchemaWrapper $schema */ |
|
| 40 | + $schema = $schemaClosure(); |
|
| 41 | 41 | |
| 42 | - $hasTable = $schema->hasTable('ratelimit_entries'); |
|
| 43 | - if ($hasTable) { |
|
| 44 | - $schema->dropTable('ratelimit_entries'); |
|
| 45 | - return $schema; |
|
| 46 | - } |
|
| 42 | + $hasTable = $schema->hasTable('ratelimit_entries'); |
|
| 43 | + if ($hasTable) { |
|
| 44 | + $schema->dropTable('ratelimit_entries'); |
|
| 45 | + return $schema; |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - return null; |
|
| 49 | - } |
|
| 48 | + return null; |
|
| 49 | + } |
|
| 50 | 50 | } |
@@ -28,22 +28,22 @@ |
||
| 28 | 28 | use OCP\Talk\IConversationOptions; |
| 29 | 29 | |
| 30 | 30 | class ConversationOptions implements IConversationOptions { |
| 31 | - private bool $isPublic; |
|
| 31 | + private bool $isPublic; |
|
| 32 | 32 | |
| 33 | - private function __construct(bool $isPublic) { |
|
| 34 | - $this->isPublic = $isPublic; |
|
| 35 | - } |
|
| 33 | + private function __construct(bool $isPublic) { |
|
| 34 | + $this->isPublic = $isPublic; |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - public static function default(): self { |
|
| 38 | - return new self(false); |
|
| 39 | - } |
|
| 37 | + public static function default(): self { |
|
| 38 | + return new self(false); |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - public function setPublic(bool $isPublic = true): IConversationOptions { |
|
| 42 | - $this->isPublic = $isPublic; |
|
| 43 | - return $this; |
|
| 44 | - } |
|
| 41 | + public function setPublic(bool $isPublic = true): IConversationOptions { |
|
| 42 | + $this->isPublic = $isPublic; |
|
| 43 | + return $this; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - public function isPublic(): bool { |
|
| 47 | - return $this->isPublic; |
|
| 48 | - } |
|
| 46 | + public function isPublic(): bool { |
|
| 47 | + return $this->isPublic; |
|
| 48 | + } |
|
| 49 | 49 | } |
@@ -32,24 +32,24 @@ |
||
| 32 | 32 | use OCP\Migration\SimpleMigrationStep; |
| 33 | 33 | |
| 34 | 34 | class Version24000Date20220131153041 extends SimpleMigrationStep { |
| 35 | - /** |
|
| 36 | - * @param IOutput $output |
|
| 37 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 38 | - * @param array $options |
|
| 39 | - * @return null|ISchemaWrapper |
|
| 40 | - */ |
|
| 41 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
| 42 | - /** @var ISchemaWrapper $schema */ |
|
| 43 | - $schema = $schemaClosure(); |
|
| 35 | + /** |
|
| 36 | + * @param IOutput $output |
|
| 37 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 38 | + * @param array $options |
|
| 39 | + * @return null|ISchemaWrapper |
|
| 40 | + */ |
|
| 41 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
| 42 | + /** @var ISchemaWrapper $schema */ |
|
| 43 | + $schema = $schemaClosure(); |
|
| 44 | 44 | |
| 45 | - $table = $schema->getTable('jobs'); |
|
| 46 | - if (!$table->hasColumn('time_sensitive')) { |
|
| 47 | - $table->addColumn('time_sensitive', Types::SMALLINT, [ |
|
| 48 | - 'default' => 1, |
|
| 49 | - ]); |
|
| 50 | - $table->addIndex(['time_sensitive'], 'jobs_time_sensitive'); |
|
| 51 | - return $schema; |
|
| 52 | - } |
|
| 53 | - return null; |
|
| 54 | - } |
|
| 45 | + $table = $schema->getTable('jobs'); |
|
| 46 | + if (!$table->hasColumn('time_sensitive')) { |
|
| 47 | + $table->addColumn('time_sensitive', Types::SMALLINT, [ |
|
| 48 | + 'default' => 1, |
|
| 49 | + ]); |
|
| 50 | + $table->addIndex(['time_sensitive'], 'jobs_time_sensitive'); |
|
| 51 | + return $schema; |
|
| 52 | + } |
|
| 53 | + return null; |
|
| 54 | + } |
|
| 55 | 55 | } |
@@ -29,12 +29,12 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | class BadGateway extends \Sabre\DAV\Exception { |
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * Returns the HTTP status code for this exception |
|
| 34 | - * |
|
| 35 | - * @return int |
|
| 36 | - */ |
|
| 37 | - public function getHTTPCode() { |
|
| 38 | - return 502; |
|
| 39 | - } |
|
| 32 | + /** |
|
| 33 | + * Returns the HTTP status code for this exception |
|
| 34 | + * |
|
| 35 | + * @return int |
|
| 36 | + */ |
|
| 37 | + public function getHTTPCode() { |
|
| 38 | + return 502; |
|
| 39 | + } |
|
| 40 | 40 | } |
@@ -29,22 +29,22 @@ |
||
| 29 | 29 | use OCP\IImage; |
| 30 | 30 | |
| 31 | 31 | class OpenDocument extends Bundled { |
| 32 | - /** |
|
| 33 | - * {@inheritDoc} |
|
| 34 | - */ |
|
| 35 | - public function getMimeType(): string { |
|
| 36 | - return '/application\/vnd.oasis.opendocument.*/'; |
|
| 37 | - } |
|
| 32 | + /** |
|
| 33 | + * {@inheritDoc} |
|
| 34 | + */ |
|
| 35 | + public function getMimeType(): string { |
|
| 36 | + return '/application\/vnd.oasis.opendocument.*/'; |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @inheritDoc |
|
| 42 | - */ |
|
| 43 | - public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage { |
|
| 44 | - $image = $this->extractThumbnail($file, 'Thumbnails/thumbnail.png'); |
|
| 45 | - if (($image !== null) && $image->valid()) { |
|
| 46 | - return $image; |
|
| 47 | - } |
|
| 48 | - return null; |
|
| 49 | - } |
|
| 40 | + /** |
|
| 41 | + * @inheritDoc |
|
| 42 | + */ |
|
| 43 | + public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage { |
|
| 44 | + $image = $this->extractThumbnail($file, 'Thumbnails/thumbnail.png'); |
|
| 45 | + if (($image !== null) && $image->valid()) { |
|
| 46 | + return $image; |
|
| 47 | + } |
|
| 48 | + return null; |
|
| 49 | + } |
|
| 50 | 50 | } |
@@ -26,26 +26,26 @@ |
||
| 26 | 26 | use OCP\IImage; |
| 27 | 27 | |
| 28 | 28 | class Krita extends Bundled { |
| 29 | - /** |
|
| 30 | - * {@inheritDoc} |
|
| 31 | - */ |
|
| 32 | - public function getMimeType(): string { |
|
| 33 | - return '/application\/x-krita/'; |
|
| 34 | - } |
|
| 29 | + /** |
|
| 30 | + * {@inheritDoc} |
|
| 31 | + */ |
|
| 32 | + public function getMimeType(): string { |
|
| 33 | + return '/application\/x-krita/'; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * @inheritDoc |
|
| 39 | - */ |
|
| 40 | - public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage { |
|
| 41 | - $image = $this->extractThumbnail($file, 'mergedimage.png'); |
|
| 42 | - if (($image !== null) && $image->valid()) { |
|
| 43 | - return $image; |
|
| 44 | - } |
|
| 45 | - $image = $this->extractThumbnail($file, 'preview.png'); |
|
| 46 | - if (($image !== null) && $image->valid()) { |
|
| 47 | - return $image; |
|
| 48 | - } |
|
| 49 | - return null; |
|
| 50 | - } |
|
| 37 | + /** |
|
| 38 | + * @inheritDoc |
|
| 39 | + */ |
|
| 40 | + public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage { |
|
| 41 | + $image = $this->extractThumbnail($file, 'mergedimage.png'); |
|
| 42 | + if (($image !== null) && $image->valid()) { |
|
| 43 | + return $image; |
|
| 44 | + } |
|
| 45 | + $image = $this->extractThumbnail($file, 'preview.png'); |
|
| 46 | + if (($image !== null) && $image->valid()) { |
|
| 47 | + return $image; |
|
| 48 | + } |
|
| 49 | + return null; |
|
| 50 | + } |
|
| 51 | 51 | } |
@@ -28,17 +28,17 @@ |
||
| 28 | 28 | * @since 13.0.0 |
| 29 | 29 | */ |
| 30 | 30 | interface ICachedMountFileInfo extends ICachedMountInfo { |
| 31 | - /** |
|
| 32 | - * Return the path for the file within the cached mount |
|
| 33 | - * |
|
| 34 | - * @return string |
|
| 35 | - * @since 13.0.0 |
|
| 36 | - */ |
|
| 37 | - public function getInternalPath(): string; |
|
| 31 | + /** |
|
| 32 | + * Return the path for the file within the cached mount |
|
| 33 | + * |
|
| 34 | + * @return string |
|
| 35 | + * @since 13.0.0 |
|
| 36 | + */ |
|
| 37 | + public function getInternalPath(): string; |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * @return string |
|
| 41 | - * @since 13.0.0 |
|
| 42 | - */ |
|
| 43 | - public function getPath(): string; |
|
| 39 | + /** |
|
| 40 | + * @return string |
|
| 41 | + * @since 13.0.0 |
|
| 42 | + */ |
|
| 43 | + public function getPath(): string; |
|
| 44 | 44 | } |
@@ -33,66 +33,66 @@ |
||
| 33 | 33 | use OCP\Migration\SimpleMigrationStep; |
| 34 | 34 | |
| 35 | 35 | class Version24000Date20211222112246 extends SimpleMigrationStep { |
| 36 | - private const TABLE_NAME = 'reactions'; |
|
| 36 | + private const TABLE_NAME = 'reactions'; |
|
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * @param IOutput $output |
|
| 40 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 41 | - * @param array $options |
|
| 42 | - * @return null|ISchemaWrapper |
|
| 43 | - */ |
|
| 44 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
| 45 | - /** @var ISchemaWrapper $schema */ |
|
| 46 | - $schema = $schemaClosure(); |
|
| 38 | + /** |
|
| 39 | + * @param IOutput $output |
|
| 40 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 41 | + * @param array $options |
|
| 42 | + * @return null|ISchemaWrapper |
|
| 43 | + */ |
|
| 44 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
| 45 | + /** @var ISchemaWrapper $schema */ |
|
| 46 | + $schema = $schemaClosure(); |
|
| 47 | 47 | |
| 48 | - $action = false; |
|
| 49 | - $comments = $schema->getTable('comments'); |
|
| 50 | - if (!$comments->hasColumn('reactions')) { |
|
| 51 | - $comments->addColumn('reactions', Types::STRING, [ |
|
| 52 | - 'notnull' => false, |
|
| 53 | - 'length' => 4000, |
|
| 54 | - ]); |
|
| 55 | - $action = true; |
|
| 56 | - } |
|
| 48 | + $action = false; |
|
| 49 | + $comments = $schema->getTable('comments'); |
|
| 50 | + if (!$comments->hasColumn('reactions')) { |
|
| 51 | + $comments->addColumn('reactions', Types::STRING, [ |
|
| 52 | + 'notnull' => false, |
|
| 53 | + 'length' => 4000, |
|
| 54 | + ]); |
|
| 55 | + $action = true; |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - if (!$schema->hasTable(self::TABLE_NAME)) { |
|
| 59 | - $table = $schema->createTable(self::TABLE_NAME); |
|
| 60 | - $table->addColumn('id', Types::BIGINT, [ |
|
| 61 | - 'autoincrement' => true, |
|
| 62 | - 'notnull' => true, |
|
| 63 | - 'length' => 11, |
|
| 64 | - 'unsigned' => true, |
|
| 65 | - ]); |
|
| 66 | - $table->addColumn('parent_id', Types::BIGINT, [ |
|
| 67 | - 'notnull' => true, |
|
| 68 | - 'length' => 11, |
|
| 69 | - 'unsigned' => true, |
|
| 70 | - ]); |
|
| 71 | - $table->addColumn('message_id', Types::BIGINT, [ |
|
| 72 | - 'notnull' => true, |
|
| 73 | - 'length' => 11, |
|
| 74 | - 'unsigned' => true, |
|
| 75 | - ]); |
|
| 76 | - $table->addColumn('actor_type', Types::STRING, [ |
|
| 77 | - 'notnull' => true, |
|
| 78 | - 'length' => 64, |
|
| 79 | - 'default' => '', |
|
| 80 | - ]); |
|
| 81 | - $table->addColumn('actor_id', Types::STRING, [ |
|
| 82 | - 'notnull' => true, |
|
| 83 | - 'length' => 64, |
|
| 84 | - 'default' => '', |
|
| 85 | - ]); |
|
| 86 | - $table->addColumn('reaction', Types::STRING, [ |
|
| 87 | - 'notnull' => true, |
|
| 88 | - 'length' => 32, |
|
| 89 | - ]); |
|
| 90 | - $table->setPrimaryKey(['id']); |
|
| 91 | - $table->addIndex(['reaction'], 'comment_reaction'); |
|
| 92 | - $table->addIndex(['parent_id'], 'comment_reaction_parent_id'); |
|
| 93 | - $table->addUniqueIndex(['parent_id', 'actor_type', 'actor_id', 'reaction'], 'comment_reaction_unique'); |
|
| 94 | - $action = true; |
|
| 95 | - } |
|
| 96 | - return $action ? $schema : null; |
|
| 97 | - } |
|
| 58 | + if (!$schema->hasTable(self::TABLE_NAME)) { |
|
| 59 | + $table = $schema->createTable(self::TABLE_NAME); |
|
| 60 | + $table->addColumn('id', Types::BIGINT, [ |
|
| 61 | + 'autoincrement' => true, |
|
| 62 | + 'notnull' => true, |
|
| 63 | + 'length' => 11, |
|
| 64 | + 'unsigned' => true, |
|
| 65 | + ]); |
|
| 66 | + $table->addColumn('parent_id', Types::BIGINT, [ |
|
| 67 | + 'notnull' => true, |
|
| 68 | + 'length' => 11, |
|
| 69 | + 'unsigned' => true, |
|
| 70 | + ]); |
|
| 71 | + $table->addColumn('message_id', Types::BIGINT, [ |
|
| 72 | + 'notnull' => true, |
|
| 73 | + 'length' => 11, |
|
| 74 | + 'unsigned' => true, |
|
| 75 | + ]); |
|
| 76 | + $table->addColumn('actor_type', Types::STRING, [ |
|
| 77 | + 'notnull' => true, |
|
| 78 | + 'length' => 64, |
|
| 79 | + 'default' => '', |
|
| 80 | + ]); |
|
| 81 | + $table->addColumn('actor_id', Types::STRING, [ |
|
| 82 | + 'notnull' => true, |
|
| 83 | + 'length' => 64, |
|
| 84 | + 'default' => '', |
|
| 85 | + ]); |
|
| 86 | + $table->addColumn('reaction', Types::STRING, [ |
|
| 87 | + 'notnull' => true, |
|
| 88 | + 'length' => 32, |
|
| 89 | + ]); |
|
| 90 | + $table->setPrimaryKey(['id']); |
|
| 91 | + $table->addIndex(['reaction'], 'comment_reaction'); |
|
| 92 | + $table->addIndex(['parent_id'], 'comment_reaction_parent_id'); |
|
| 93 | + $table->addUniqueIndex(['parent_id', 'actor_type', 'actor_id', 'reaction'], 'comment_reaction_unique'); |
|
| 94 | + $action = true; |
|
| 95 | + } |
|
| 96 | + return $action ? $schema : null; |
|
| 97 | + } |
|
| 98 | 98 | } |
@@ -29,11 +29,11 @@ |
||
| 29 | 29 | use OCP\IConfig; |
| 30 | 30 | |
| 31 | 31 | trait TProfileHelper { |
| 32 | - protected function isProfileEnabledByDefault(IConfig $config): ?bool { |
|
| 33 | - return filter_var( |
|
| 34 | - $config->getAppValue('settings', 'profile_enabled_by_default', '1'), |
|
| 35 | - FILTER_VALIDATE_BOOLEAN, |
|
| 36 | - FILTER_NULL_ON_FAILURE, |
|
| 37 | - ); |
|
| 38 | - } |
|
| 32 | + protected function isProfileEnabledByDefault(IConfig $config): ?bool { |
|
| 33 | + return filter_var( |
|
| 34 | + $config->getAppValue('settings', 'profile_enabled_by_default', '1'), |
|
| 35 | + FILTER_VALIDATE_BOOLEAN, |
|
| 36 | + FILTER_NULL_ON_FAILURE, |
|
| 37 | + ); |
|
| 38 | + } |
|
| 39 | 39 | } |