@@ -13,9 +13,9 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | abstract class AFactory { |
| 15 | 15 | /** @var array<string, T> */ |
| 16 | - protected array $instances = []; |
|
| 16 | + protected array $instances = [ ]; |
|
| 17 | 17 | /** @var array<string> */ |
| 18 | - protected array $fqcn = []; |
|
| 18 | + protected array $fqcn = [ ]; |
|
| 19 | 19 | |
| 20 | 20 | abstract protected function getPrefix(): string; |
| 21 | 21 | |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | true => $this->typeFrom($name), |
| 34 | 34 | false => strtolower($name), |
| 35 | 35 | }; |
| 36 | - if (isset($this->instances[$needle])) { |
|
| 37 | - return $this->instances[$needle]; |
|
| 36 | + if (isset($this->instances[ $needle ])) { |
|
| 37 | + return $this->instances[ $needle ]; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | foreach ($this->getFqcnList() as $fqcn) { |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | foreach ($factory->getFqcnList() as $driverFqcn) { |
| 48 | 48 | $gateway = $factory->get($driverFqcn); |
| 49 | 49 | $settings = $gateway->getSettings(); |
| 50 | - $this->instances[$settings->id] = $gateway; |
|
| 50 | + $this->instances[ $settings->id ] = $gateway; |
|
| 51 | 51 | if ($settings->id === $name) { |
| 52 | 52 | return $gateway; |
| 53 | 53 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | continue; |
| 58 | 58 | } |
| 59 | 59 | $instance = \OCP\Server::get($fqcn); |
| 60 | - $this->instances[$type] = $instance; |
|
| 60 | + $this->instances[ $type ] = $instance; |
|
| 61 | 61 | return $instance; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | return $this->fqcn; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - $loader = require __DIR__ . '/../../vendor/autoload.php'; |
|
| 73 | + $loader = require __DIR__.'/../../vendor/autoload.php'; |
|
| 74 | 74 | foreach ($loader->getClassMap() as $fqcn => $_) { |
| 75 | 75 | $type = $this->typeFrom($fqcn); |
| 76 | 76 | if ($type === null) { |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | if (!is_subclass_of($fqcn, $this->getBaseClass(), true)) { |
| 80 | 80 | continue; |
| 81 | 81 | } |
| 82 | - $this->fqcn[] = $fqcn; |
|
| 82 | + $this->fqcn[ ] = $fqcn; |
|
| 83 | 83 | } |
| 84 | 84 | return $this->fqcn; |
| 85 | 85 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | return null; |
| 95 | 95 | } |
| 96 | 96 | $type = substr($fqcn, strlen($prefix)); |
| 97 | - $type = substr($type, 0, -strlen('\\' . $suffix)); |
|
| 97 | + $type = substr($type, 0, -strlen('\\'.$suffix)); |
|
| 98 | 98 | if (strpos($type, '\\') !== false || $type === '') { |
| 99 | 99 | return null; |
| 100 | 100 | } |
@@ -25,15 +25,15 @@ discard block |
||
| 25 | 25 | /** |
| 26 | 26 | * @throws MessageTransmissionException |
| 27 | 27 | */ |
| 28 | - #[\Override] |
|
| 28 | + #[\Override ] |
|
| 29 | 29 | abstract public function send(string $identifier, string $message); |
| 30 | 30 | |
| 31 | - #[\Override] |
|
| 31 | + #[\Override ] |
|
| 32 | 32 | public function setAppConfig(IAppConfig $appConfig): void { |
| 33 | 33 | $this->appConfig = $appConfig; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - #[\Override] |
|
| 36 | + #[\Override ] |
|
| 37 | 37 | public function getSettings(): Settings { |
| 38 | 38 | if ($this->settings !== null) { |
| 39 | 39 | return $this->settings; |
@@ -41,12 +41,12 @@ discard block |
||
| 41 | 41 | return $this->settings = $this->createSettings(); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - #[\Override] |
|
| 44 | + #[\Override ] |
|
| 45 | 45 | public static function idOverride(): ?string { |
| 46 | 46 | return null; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - #[\Override] |
|
| 49 | + #[\Override ] |
|
| 50 | 50 | public function getProviderId(): string { |
| 51 | 51 | $settings = $this->getSettings(); |
| 52 | 52 | if (!empty($settings->id)) { |
@@ -54,21 +54,21 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | $id = self::getIdFromProviderFqcn(static::class); |
| 56 | 56 | if ($id === null) { |
| 57 | - throw new \LogicException('Cannot derive gateway id from FQCN: ' . static::class); |
|
| 57 | + throw new \LogicException('Cannot derive gateway id from FQCN: '.static::class); |
|
| 58 | 58 | } |
| 59 | 59 | return $id; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - #[\Override] |
|
| 62 | + #[\Override ] |
|
| 63 | 63 | abstract public function cliConfigure(InputInterface $input, OutputInterface $output): int; |
| 64 | 64 | |
| 65 | 65 | public function isComplete(): bool { |
| 66 | 66 | $settings = $this->getSettings(); |
| 67 | 67 | $savedKeys = $this->appConfig->getKeys(Application::APP_ID); |
| 68 | 68 | $providerId = $settings->id ?? $this->getProviderId(); |
| 69 | - $fields = []; |
|
| 69 | + $fields = [ ]; |
|
| 70 | 70 | foreach ($settings->fields as $field) { |
| 71 | - $fields[] = self::keyFromFieldName($providerId, $field->field); |
|
| 71 | + $fields[ ] = self::keyFromFieldName($providerId, $field->field); |
|
| 72 | 72 | } |
| 73 | 73 | $intersect = array_intersect($fields, $savedKeys); |
| 74 | 74 | return count($intersect) === count($fields); |