@@ -31,41 +31,41 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | class ProviderSet { |
| 33 | 33 | |
| 34 | - /** @var IProvider */ |
|
| 35 | - private $providers; |
|
| 34 | + /** @var IProvider */ |
|
| 35 | + private $providers; |
|
| 36 | 36 | |
| 37 | - /** @var bool */ |
|
| 38 | - private $providerMissing; |
|
| 37 | + /** @var bool */ |
|
| 38 | + private $providerMissing; |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @param IProvider[] $providers |
|
| 42 | - * @param bool $providerMissing |
|
| 43 | - */ |
|
| 44 | - public function __construct(array $providers, bool $providerMissing) { |
|
| 45 | - $this->providers = []; |
|
| 46 | - foreach ($providers as $provider) { |
|
| 47 | - $this->providers[$provider->getId()] = $provider; |
|
| 48 | - } |
|
| 49 | - $this->providerMissing = $providerMissing; |
|
| 50 | - } |
|
| 40 | + /** |
|
| 41 | + * @param IProvider[] $providers |
|
| 42 | + * @param bool $providerMissing |
|
| 43 | + */ |
|
| 44 | + public function __construct(array $providers, bool $providerMissing) { |
|
| 45 | + $this->providers = []; |
|
| 46 | + foreach ($providers as $provider) { |
|
| 47 | + $this->providers[$provider->getId()] = $provider; |
|
| 48 | + } |
|
| 49 | + $this->providerMissing = $providerMissing; |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * @param string $providerId |
|
| 54 | - * @return IProvider|null |
|
| 55 | - */ |
|
| 56 | - public function getProvider(string $providerId) { |
|
| 57 | - return $this->providers[$providerId] ?? null; |
|
| 58 | - } |
|
| 52 | + /** |
|
| 53 | + * @param string $providerId |
|
| 54 | + * @return IProvider|null |
|
| 55 | + */ |
|
| 56 | + public function getProvider(string $providerId) { |
|
| 57 | + return $this->providers[$providerId] ?? null; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * @return IProvider[] |
|
| 62 | - */ |
|
| 63 | - public function getProviders(): array { |
|
| 64 | - return $this->providers; |
|
| 65 | - } |
|
| 60 | + /** |
|
| 61 | + * @return IProvider[] |
|
| 62 | + */ |
|
| 63 | + public function getProviders(): array { |
|
| 64 | + return $this->providers; |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - public function isProviderMissing(): bool { |
|
| 68 | - return $this->providerMissing; |
|
| 69 | - } |
|
| 67 | + public function isProviderMissing(): bool { |
|
| 68 | + return $this->providerMissing; |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | 71 | } |
@@ -31,52 +31,52 @@ |
||
| 31 | 31 | |
| 32 | 32 | class Version14000Date20180522074438 extends SimpleMigrationStep { |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * @param IOutput $output |
|
| 36 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 37 | - * @param array $options |
|
| 38 | - */ |
|
| 39 | - public function preSchemaChange(IOutput $output, Closure $schemaClosure, |
|
| 40 | - array $options) { |
|
| 34 | + /** |
|
| 35 | + * @param IOutput $output |
|
| 36 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 37 | + * @param array $options |
|
| 38 | + */ |
|
| 39 | + public function preSchemaChange(IOutput $output, Closure $schemaClosure, |
|
| 40 | + array $options) { |
|
| 41 | 41 | |
| 42 | - } |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - public function changeSchema(IOutput $output, Closure $schemaClosure, |
|
| 45 | - array $options): ISchemaWrapper { |
|
| 44 | + public function changeSchema(IOutput $output, Closure $schemaClosure, |
|
| 45 | + array $options): ISchemaWrapper { |
|
| 46 | 46 | |
| 47 | - $schema = $schemaClosure(); |
|
| 47 | + $schema = $schemaClosure(); |
|
| 48 | 48 | |
| 49 | - if (!$schema->hasTable('twofactor_providers')) { |
|
| 50 | - $table = $schema->createTable('twofactor_providers'); |
|
| 51 | - $table->addColumn('provider_id', 'string', |
|
| 52 | - [ |
|
| 53 | - 'notnull' => true, |
|
| 54 | - 'length' => 32, |
|
| 55 | - ]); |
|
| 56 | - $table->addColumn('uid', 'string', |
|
| 57 | - [ |
|
| 58 | - 'notnull' => true, |
|
| 59 | - 'length' => 64, |
|
| 60 | - ]); |
|
| 61 | - $table->addColumn('enabled', 'smallint', |
|
| 62 | - [ |
|
| 63 | - 'notnull' => true, |
|
| 64 | - 'length' => 1, |
|
| 65 | - ]); |
|
| 66 | - $table->setPrimaryKey(['provider_id', 'uid']); |
|
| 67 | - } |
|
| 49 | + if (!$schema->hasTable('twofactor_providers')) { |
|
| 50 | + $table = $schema->createTable('twofactor_providers'); |
|
| 51 | + $table->addColumn('provider_id', 'string', |
|
| 52 | + [ |
|
| 53 | + 'notnull' => true, |
|
| 54 | + 'length' => 32, |
|
| 55 | + ]); |
|
| 56 | + $table->addColumn('uid', 'string', |
|
| 57 | + [ |
|
| 58 | + 'notnull' => true, |
|
| 59 | + 'length' => 64, |
|
| 60 | + ]); |
|
| 61 | + $table->addColumn('enabled', 'smallint', |
|
| 62 | + [ |
|
| 63 | + 'notnull' => true, |
|
| 64 | + 'length' => 1, |
|
| 65 | + ]); |
|
| 66 | + $table->setPrimaryKey(['provider_id', 'uid']); |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - return $schema; |
|
| 70 | - } |
|
| 69 | + return $schema; |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | - /** |
|
| 73 | - * @param IOutput $output |
|
| 74 | - * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 75 | - * @param array $options |
|
| 76 | - */ |
|
| 77 | - public function postSchemaChange(IOutput $output, Closure $schemaClosure, |
|
| 78 | - array $options) { |
|
| 72 | + /** |
|
| 73 | + * @param IOutput $output |
|
| 74 | + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` |
|
| 75 | + * @param array $options |
|
| 76 | + */ |
|
| 77 | + public function postSchemaChange(IOutput $output, Closure $schemaClosure, |
|
| 78 | + array $options) { |
|
| 79 | 79 | |
| 80 | - } |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | 82 | } |