@@ -34,37 +34,37 @@ |
||
34 | 34 | use OCP\Migration\SimpleMigrationStep; |
35 | 35 | |
36 | 36 | class Version21000Date20201223143245 extends SimpleMigrationStep { |
37 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
38 | - /** @var ISchemaWrapper $schema */ |
|
39 | - $schema = $schemaClosure(); |
|
37 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { |
|
38 | + /** @var ISchemaWrapper $schema */ |
|
39 | + $schema = $schemaClosure(); |
|
40 | 40 | |
41 | - if ($schema->hasTable('share_external')) { |
|
42 | - $table = $schema->getTable('share_external'); |
|
43 | - $changed = false; |
|
44 | - if (!$table->hasColumn('parent')) { |
|
45 | - $table->addColumn('parent', Types::BIGINT, [ |
|
46 | - 'notnull' => false, |
|
47 | - 'default' => -1, |
|
48 | - ]); |
|
49 | - $changed = true; |
|
50 | - } |
|
51 | - if (!$table->hasColumn('share_type')) { |
|
52 | - $table->addColumn('share_type', Types::INTEGER, [ |
|
53 | - 'notnull' => false, |
|
54 | - 'length' => 4, |
|
55 | - ]); |
|
56 | - $changed = true; |
|
57 | - } |
|
58 | - if ($table->hasColumn('lastscan')) { |
|
59 | - $table->dropColumn('lastscan'); |
|
60 | - $changed = true; |
|
61 | - } |
|
41 | + if ($schema->hasTable('share_external')) { |
|
42 | + $table = $schema->getTable('share_external'); |
|
43 | + $changed = false; |
|
44 | + if (!$table->hasColumn('parent')) { |
|
45 | + $table->addColumn('parent', Types::BIGINT, [ |
|
46 | + 'notnull' => false, |
|
47 | + 'default' => -1, |
|
48 | + ]); |
|
49 | + $changed = true; |
|
50 | + } |
|
51 | + if (!$table->hasColumn('share_type')) { |
|
52 | + $table->addColumn('share_type', Types::INTEGER, [ |
|
53 | + 'notnull' => false, |
|
54 | + 'length' => 4, |
|
55 | + ]); |
|
56 | + $changed = true; |
|
57 | + } |
|
58 | + if ($table->hasColumn('lastscan')) { |
|
59 | + $table->dropColumn('lastscan'); |
|
60 | + $changed = true; |
|
61 | + } |
|
62 | 62 | |
63 | - if ($changed) { |
|
64 | - return $schema; |
|
65 | - } |
|
66 | - } |
|
63 | + if ($changed) { |
|
64 | + return $schema; |
|
65 | + } |
|
66 | + } |
|
67 | 67 | |
68 | - return null; |
|
69 | - } |
|
68 | + return null; |
|
69 | + } |
|
70 | 70 | } |
@@ -31,42 +31,42 @@ |
||
31 | 31 | use Doctrine\DBAL\Events; |
32 | 32 | |
33 | 33 | class SQLiteSessionInit implements EventSubscriber { |
34 | - /** |
|
35 | - * @var bool |
|
36 | - */ |
|
37 | - private $caseSensitiveLike; |
|
34 | + /** |
|
35 | + * @var bool |
|
36 | + */ |
|
37 | + private $caseSensitiveLike; |
|
38 | 38 | |
39 | - /** |
|
40 | - * @var string |
|
41 | - */ |
|
42 | - private $journalMode; |
|
39 | + /** |
|
40 | + * @var string |
|
41 | + */ |
|
42 | + private $journalMode; |
|
43 | 43 | |
44 | - /** |
|
45 | - * Configure case sensitive like for each connection |
|
46 | - * |
|
47 | - * @param bool $caseSensitiveLike |
|
48 | - * @param string $journalMode |
|
49 | - */ |
|
50 | - public function __construct($caseSensitiveLike, $journalMode) { |
|
51 | - $this->caseSensitiveLike = $caseSensitiveLike; |
|
52 | - $this->journalMode = $journalMode; |
|
53 | - } |
|
44 | + /** |
|
45 | + * Configure case sensitive like for each connection |
|
46 | + * |
|
47 | + * @param bool $caseSensitiveLike |
|
48 | + * @param string $journalMode |
|
49 | + */ |
|
50 | + public function __construct($caseSensitiveLike, $journalMode) { |
|
51 | + $this->caseSensitiveLike = $caseSensitiveLike; |
|
52 | + $this->journalMode = $journalMode; |
|
53 | + } |
|
54 | 54 | |
55 | - /** |
|
56 | - * @param ConnectionEventArgs $args |
|
57 | - * @return void |
|
58 | - */ |
|
59 | - public function postConnect(ConnectionEventArgs $args) { |
|
60 | - $sensitive = $this->caseSensitiveLike ? 'true' : 'false'; |
|
61 | - $args->getConnection()->executeUpdate('PRAGMA case_sensitive_like = ' . $sensitive); |
|
62 | - $args->getConnection()->executeUpdate('PRAGMA journal_mode = ' . $this->journalMode); |
|
63 | - /** @var \Doctrine\DBAL\Driver\PDO\Connection $connection */ |
|
64 | - $connection = $args->getConnection()->getWrappedConnection(); |
|
65 | - $pdo = $connection->getWrappedConnection(); |
|
66 | - $pdo->sqliteCreateFunction('md5', 'md5', 1); |
|
67 | - } |
|
55 | + /** |
|
56 | + * @param ConnectionEventArgs $args |
|
57 | + * @return void |
|
58 | + */ |
|
59 | + public function postConnect(ConnectionEventArgs $args) { |
|
60 | + $sensitive = $this->caseSensitiveLike ? 'true' : 'false'; |
|
61 | + $args->getConnection()->executeUpdate('PRAGMA case_sensitive_like = ' . $sensitive); |
|
62 | + $args->getConnection()->executeUpdate('PRAGMA journal_mode = ' . $this->journalMode); |
|
63 | + /** @var \Doctrine\DBAL\Driver\PDO\Connection $connection */ |
|
64 | + $connection = $args->getConnection()->getWrappedConnection(); |
|
65 | + $pdo = $connection->getWrappedConnection(); |
|
66 | + $pdo->sqliteCreateFunction('md5', 'md5', 1); |
|
67 | + } |
|
68 | 68 | |
69 | - public function getSubscribedEvents() { |
|
70 | - return [Events::postConnect]; |
|
71 | - } |
|
69 | + public function getSubscribedEvents() { |
|
70 | + return [Events::postConnect]; |
|
71 | + } |
|
72 | 72 | } |
@@ -35,21 +35,21 @@ |
||
35 | 35 | * Auto-generated migration step: Please modify to your needs! |
36 | 36 | */ |
37 | 37 | class Version21000Date20210119195004 extends SimpleMigrationStep { |
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 | - $table = $schema->getTable('authtoken'); |
|
49 | - if ($table->hasIndex('authtoken_version_index')) { |
|
50 | - $table->dropIndex('authtoken_version_index'); |
|
51 | - } |
|
48 | + $table = $schema->getTable('authtoken'); |
|
49 | + if ($table->hasIndex('authtoken_version_index')) { |
|
50 | + $table->dropIndex('authtoken_version_index'); |
|
51 | + } |
|
52 | 52 | |
53 | - return $schema; |
|
54 | - } |
|
53 | + return $schema; |
|
54 | + } |
|
55 | 55 | } |
@@ -31,24 +31,24 @@ |
||
31 | 31 | use OCP\Migration\SimpleMigrationStep; |
32 | 32 | |
33 | 33 | class Version14000Date20180518120534 extends SimpleMigrationStep { |
34 | - public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
35 | - /** @var ISchemaWrapper $schema */ |
|
36 | - $schema = $schemaClosure(); |
|
34 | + public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { |
|
35 | + /** @var ISchemaWrapper $schema */ |
|
36 | + $schema = $schemaClosure(); |
|
37 | 37 | |
38 | - $table = $schema->getTable('authtoken'); |
|
39 | - $table->addColumn('private_key', 'text', [ |
|
40 | - 'notnull' => false, |
|
41 | - ]); |
|
42 | - $table->addColumn('public_key', 'text', [ |
|
43 | - 'notnull' => false, |
|
44 | - ]); |
|
45 | - $table->addColumn('version', 'smallint', [ |
|
46 | - 'notnull' => true, |
|
47 | - 'default' => 1, |
|
48 | - 'unsigned' => true, |
|
49 | - ]); |
|
50 | - $table->addIndex(['uid'], 'authtoken_uid_index'); |
|
38 | + $table = $schema->getTable('authtoken'); |
|
39 | + $table->addColumn('private_key', 'text', [ |
|
40 | + 'notnull' => false, |
|
41 | + ]); |
|
42 | + $table->addColumn('public_key', 'text', [ |
|
43 | + 'notnull' => false, |
|
44 | + ]); |
|
45 | + $table->addColumn('version', 'smallint', [ |
|
46 | + 'notnull' => true, |
|
47 | + 'default' => 1, |
|
48 | + 'unsigned' => true, |
|
49 | + ]); |
|
50 | + $table->addIndex(['uid'], 'authtoken_uid_index'); |
|
51 | 51 | |
52 | - return $schema; |
|
53 | - } |
|
52 | + return $schema; |
|
53 | + } |
|
54 | 54 | } |
@@ -35,37 +35,37 @@ |
||
35 | 35 | * @see \OCP\AppFramework\Services\IInitialState |
36 | 36 | */ |
37 | 37 | interface IInitialStateService { |
38 | - /** |
|
39 | - * Allows an app to provide its initial state to the template system. |
|
40 | - * Use this if you know your initial state sill be used for example if |
|
41 | - * you are in the render function of you controller. |
|
42 | - * |
|
43 | - * @since 16.0.0 |
|
44 | - * |
|
45 | - * @param string $appName |
|
46 | - * @param string $key |
|
47 | - * @param bool|int|float|string|array|\JsonSerializable $data |
|
48 | - * |
|
49 | - * @deprecated 21 Use OCP\AppFramework\Services\IInitialState or OCP\AppFramework\Services\InitialStateProvider |
|
50 | - * @see \OCP\AppFramework\Services\IInitialState::provideInitialState() |
|
51 | - */ |
|
52 | - public function provideInitialState(string $appName, string $key, $data): void; |
|
38 | + /** |
|
39 | + * Allows an app to provide its initial state to the template system. |
|
40 | + * Use this if you know your initial state sill be used for example if |
|
41 | + * you are in the render function of you controller. |
|
42 | + * |
|
43 | + * @since 16.0.0 |
|
44 | + * |
|
45 | + * @param string $appName |
|
46 | + * @param string $key |
|
47 | + * @param bool|int|float|string|array|\JsonSerializable $data |
|
48 | + * |
|
49 | + * @deprecated 21 Use OCP\AppFramework\Services\IInitialState or OCP\AppFramework\Services\InitialStateProvider |
|
50 | + * @see \OCP\AppFramework\Services\IInitialState::provideInitialState() |
|
51 | + */ |
|
52 | + public function provideInitialState(string $appName, string $key, $data): void; |
|
53 | 53 | |
54 | - /** |
|
55 | - * Allows an app to provide its initial state via a lazy method. |
|
56 | - * This will call the closure when the template is being generated. |
|
57 | - * Use this if your app is injected into pages. Since then the render method |
|
58 | - * is not called explicitly. But we do not want to load the state on webdav |
|
59 | - * requests for example. |
|
60 | - * |
|
61 | - * @since 16.0.0 |
|
62 | - * |
|
63 | - * @param string $appName |
|
64 | - * @param string $key |
|
65 | - * @param Closure $closure returns a primitive or an object that implements JsonSerializable |
|
66 | - * |
|
67 | - * @deprecated 21 Use OCP\AppFramework\Services\IInitialState or OCP\AppFramework\Services\InitialStateProvider |
|
68 | - * @see \OCP\AppFramework\Services\IInitialState::provideLazyInitialState() |
|
69 | - */ |
|
70 | - public function provideLazyInitialState(string $appName, string $key, Closure $closure): void; |
|
54 | + /** |
|
55 | + * Allows an app to provide its initial state via a lazy method. |
|
56 | + * This will call the closure when the template is being generated. |
|
57 | + * Use this if your app is injected into pages. Since then the render method |
|
58 | + * is not called explicitly. But we do not want to load the state on webdav |
|
59 | + * requests for example. |
|
60 | + * |
|
61 | + * @since 16.0.0 |
|
62 | + * |
|
63 | + * @param string $appName |
|
64 | + * @param string $key |
|
65 | + * @param Closure $closure returns a primitive or an object that implements JsonSerializable |
|
66 | + * |
|
67 | + * @deprecated 21 Use OCP\AppFramework\Services\IInitialState or OCP\AppFramework\Services\InitialStateProvider |
|
68 | + * @see \OCP\AppFramework\Services\IInitialState::provideLazyInitialState() |
|
69 | + */ |
|
70 | + public function provideLazyInitialState(string $appName, string $key, Closure $closure): void; |
|
71 | 71 | } |
@@ -30,24 +30,24 @@ |
||
30 | 30 | * @template T |
31 | 31 | */ |
32 | 32 | class ServiceRegistration extends ARegistration { |
33 | - /** |
|
34 | - * @var string |
|
35 | - * @psalm-var class-string<T> |
|
36 | - */ |
|
37 | - private $service; |
|
33 | + /** |
|
34 | + * @var string |
|
35 | + * @psalm-var class-string<T> |
|
36 | + */ |
|
37 | + private $service; |
|
38 | 38 | |
39 | - /** |
|
40 | - * @psalm-param class-string<T> $service |
|
41 | - */ |
|
42 | - public function __construct(string $appId, string $service) { |
|
43 | - parent::__construct($appId); |
|
44 | - $this->service = $service; |
|
45 | - } |
|
39 | + /** |
|
40 | + * @psalm-param class-string<T> $service |
|
41 | + */ |
|
42 | + public function __construct(string $appId, string $service) { |
|
43 | + parent::__construct($appId); |
|
44 | + $this->service = $service; |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * @psalm-return class-string<T> |
|
49 | - */ |
|
50 | - public function getService(): string { |
|
51 | - return $this->service; |
|
52 | - } |
|
47 | + /** |
|
48 | + * @psalm-return class-string<T> |
|
49 | + */ |
|
50 | + public function getService(): string { |
|
51 | + return $this->service; |
|
52 | + } |
|
53 | 53 | } |
@@ -29,14 +29,14 @@ |
||
29 | 29 | use OCP\Files\FileInfo; |
30 | 30 | |
31 | 31 | class WebP extends Image { |
32 | - /** |
|
33 | - * {@inheritDoc} |
|
34 | - */ |
|
35 | - public function getMimeType(): string { |
|
36 | - return '/image\/webp/'; |
|
37 | - } |
|
32 | + /** |
|
33 | + * {@inheritDoc} |
|
34 | + */ |
|
35 | + public function getMimeType(): string { |
|
36 | + return '/image\/webp/'; |
|
37 | + } |
|
38 | 38 | |
39 | - public function isAvailable(FileInfo $file): bool { |
|
40 | - return (bool)(imagetypes() & IMG_WEBP); |
|
41 | - } |
|
39 | + public function isAvailable(FileInfo $file): bool { |
|
40 | + return (bool)(imagetypes() & IMG_WEBP); |
|
41 | + } |
|
42 | 42 | } |
@@ -35,61 +35,61 @@ |
||
35 | 35 | * @since 22.0.0 |
36 | 36 | */ |
37 | 37 | class AbstractCacheEvent extends Event implements ICacheEvent { |
38 | - protected $storage; |
|
39 | - protected $path; |
|
40 | - protected $fileId; |
|
41 | - protected $storageId; |
|
38 | + protected $storage; |
|
39 | + protected $path; |
|
40 | + protected $fileId; |
|
41 | + protected $storageId; |
|
42 | 42 | |
43 | - /** |
|
44 | - * @param IStorage $storage |
|
45 | - * @param string $path |
|
46 | - * @param int $fileId |
|
47 | - * @since 22.0.0 |
|
48 | - */ |
|
49 | - public function __construct(IStorage $storage, string $path, int $fileId, int $storageId) { |
|
50 | - $this->storage = $storage; |
|
51 | - $this->path = $path; |
|
52 | - $this->fileId = $fileId; |
|
53 | - $this->storageId = $storageId; |
|
54 | - } |
|
43 | + /** |
|
44 | + * @param IStorage $storage |
|
45 | + * @param string $path |
|
46 | + * @param int $fileId |
|
47 | + * @since 22.0.0 |
|
48 | + */ |
|
49 | + public function __construct(IStorage $storage, string $path, int $fileId, int $storageId) { |
|
50 | + $this->storage = $storage; |
|
51 | + $this->path = $path; |
|
52 | + $this->fileId = $fileId; |
|
53 | + $this->storageId = $storageId; |
|
54 | + } |
|
55 | 55 | |
56 | - /** |
|
57 | - * @return IStorage |
|
58 | - * @since 22.0.0 |
|
59 | - */ |
|
60 | - public function getStorage(): IStorage { |
|
61 | - return $this->storage; |
|
62 | - } |
|
56 | + /** |
|
57 | + * @return IStorage |
|
58 | + * @since 22.0.0 |
|
59 | + */ |
|
60 | + public function getStorage(): IStorage { |
|
61 | + return $this->storage; |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @return string |
|
66 | - * @since 22.0.0 |
|
67 | - */ |
|
68 | - public function getPath(): string { |
|
69 | - return $this->path; |
|
70 | - } |
|
64 | + /** |
|
65 | + * @return string |
|
66 | + * @since 22.0.0 |
|
67 | + */ |
|
68 | + public function getPath(): string { |
|
69 | + return $this->path; |
|
70 | + } |
|
71 | 71 | |
72 | - /** |
|
73 | - * @param string $path |
|
74 | - * @since 22.0.0 |
|
75 | - */ |
|
76 | - public function setPath(string $path): void { |
|
77 | - $this->path = $path; |
|
78 | - } |
|
72 | + /** |
|
73 | + * @param string $path |
|
74 | + * @since 22.0.0 |
|
75 | + */ |
|
76 | + public function setPath(string $path): void { |
|
77 | + $this->path = $path; |
|
78 | + } |
|
79 | 79 | |
80 | - /** |
|
81 | - * @return int |
|
82 | - * @since 22.0.0 |
|
83 | - */ |
|
84 | - public function getFileId(): int { |
|
85 | - return $this->fileId; |
|
86 | - } |
|
80 | + /** |
|
81 | + * @return int |
|
82 | + * @since 22.0.0 |
|
83 | + */ |
|
84 | + public function getFileId(): int { |
|
85 | + return $this->fileId; |
|
86 | + } |
|
87 | 87 | |
88 | - /** |
|
89 | - * @return int |
|
90 | - * @since 22.0.0 |
|
91 | - */ |
|
92 | - public function getStorageId(): int { |
|
93 | - return $this->storageId; |
|
94 | - } |
|
88 | + /** |
|
89 | + * @return int |
|
90 | + * @since 22.0.0 |
|
91 | + */ |
|
92 | + public function getStorageId(): int { |
|
93 | + return $this->storageId; |
|
94 | + } |
|
95 | 95 | } |
@@ -38,41 +38,41 @@ |
||
38 | 38 | * Auto-generated migration step: Please modify to your needs! |
39 | 39 | */ |
40 | 40 | class Version1011Date20190806104428 extends SimpleMigrationStep { |
41 | - /** |
|
42 | - * @param IOutput $output |
|
43 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
44 | - * @param array $options |
|
45 | - * @return null|ISchemaWrapper |
|
46 | - */ |
|
47 | - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
48 | - /** @var ISchemaWrapper $schema */ |
|
49 | - $schema = $schemaClosure(); |
|
41 | + /** |
|
42 | + * @param IOutput $output |
|
43 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
44 | + * @param array $options |
|
45 | + * @return null|ISchemaWrapper |
|
46 | + */ |
|
47 | + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
|
48 | + /** @var ISchemaWrapper $schema */ |
|
49 | + $schema = $schemaClosure(); |
|
50 | 50 | |
51 | - $table = $schema->createTable('dav_cal_proxy'); |
|
52 | - $table->addColumn('id', Types::BIGINT, [ |
|
53 | - 'autoincrement' => true, |
|
54 | - 'notnull' => true, |
|
55 | - 'length' => 11, |
|
56 | - 'unsigned' => true, |
|
57 | - ]); |
|
58 | - $table->addColumn('owner_id', Types::STRING, [ |
|
59 | - 'notnull' => true, |
|
60 | - 'length' => 64, |
|
61 | - ]); |
|
62 | - $table->addColumn('proxy_id', Types::STRING, [ |
|
63 | - 'notnull' => true, |
|
64 | - 'length' => 64, |
|
65 | - ]); |
|
66 | - $table->addColumn('permissions', Types::INTEGER, [ |
|
67 | - 'notnull' => false, |
|
68 | - 'length' => 4, |
|
69 | - 'unsigned' => true, |
|
70 | - ]); |
|
51 | + $table = $schema->createTable('dav_cal_proxy'); |
|
52 | + $table->addColumn('id', Types::BIGINT, [ |
|
53 | + 'autoincrement' => true, |
|
54 | + 'notnull' => true, |
|
55 | + 'length' => 11, |
|
56 | + 'unsigned' => true, |
|
57 | + ]); |
|
58 | + $table->addColumn('owner_id', Types::STRING, [ |
|
59 | + 'notnull' => true, |
|
60 | + 'length' => 64, |
|
61 | + ]); |
|
62 | + $table->addColumn('proxy_id', Types::STRING, [ |
|
63 | + 'notnull' => true, |
|
64 | + 'length' => 64, |
|
65 | + ]); |
|
66 | + $table->addColumn('permissions', Types::INTEGER, [ |
|
67 | + 'notnull' => false, |
|
68 | + 'length' => 4, |
|
69 | + 'unsigned' => true, |
|
70 | + ]); |
|
71 | 71 | |
72 | - $table->setPrimaryKey(['id']); |
|
73 | - $table->addUniqueIndex(['owner_id', 'proxy_id', 'permissions'], 'dav_cal_proxy_uidx'); |
|
74 | - $table->addIndex(['proxy_id'], 'dav_cal_proxy_ipid'); |
|
72 | + $table->setPrimaryKey(['id']); |
|
73 | + $table->addUniqueIndex(['owner_id', 'proxy_id', 'permissions'], 'dav_cal_proxy_uidx'); |
|
74 | + $table->addIndex(['proxy_id'], 'dav_cal_proxy_ipid'); |
|
75 | 75 | |
76 | - return $schema; |
|
77 | - } |
|
76 | + return $schema; |
|
77 | + } |
|
78 | 78 | } |