Passed
Pull Request — master (#796)
by Vitor
11:52 queued 07:31
created
lib/Provider/Channel/Telegram/Gateway.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -29,20 +29,20 @@  discard block
 block discarded – undo
29 29
 		parent::__construct($appConfig);
30 30
 	}
31 31
 
32
-	#[\Override]
33
-	public function send(string $identifier, string $message, array $extra = []): void {
32
+	#[\Override ]
33
+	public function send(string $identifier, string $message, array $extra = [ ]): void {
34 34
 		$this->getProvider()->send($identifier, $message);
35 35
 	}
36 36
 
37
-	#[\Override]
37
+	#[\Override ]
38 38
 	final public function cliConfigure(InputInterface $input, OutputInterface $output): int {
39 39
 		$namespaces = $this->telegramProviderFactory->getFqcnList();
40
-		$names = [];
41
-		$providers = [];
40
+		$names = [ ];
41
+		$providers = [ ];
42 42
 		foreach ($namespaces as $ns) {
43 43
 			$provider = $this->telegramProviderFactory->get($ns);
44
-			$providers[] = $provider;
45
-			$names[] = $provider->getSettings()->name;
44
+			$providers[ ] = $provider;
45
+			$names[ ] = $provider->getSettings()->name;
46 46
 		}
47 47
 
48 48
 		$helper = new QuestionHelper();
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 		$name = $helper->ask($input, $output, $choiceQuestion);
51 51
 		$selectedIndex = array_search($name, $names);
52 52
 
53
-		$providers[$selectedIndex]->cliConfigure($input, $output);
53
+		$providers[ $selectedIndex ]->cliConfigure($input, $output);
54 54
 		return 0;
55 55
 	}
56 56
 
57
-	#[\Override]
57
+	#[\Override ]
58 58
 	public function createSettings(): Settings {
59 59
 		try {
60 60
 			$settings = $this->getProvider()->getSettings();
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		return $settings;
67 67
 	}
68 68
 
69
-	#[\Override]
69
+	#[\Override ]
70 70
 	public function isComplete(?Settings $settings = null): bool {
71 71
 		if ($settings === null) {
72 72
 			try {
@@ -79,21 +79,21 @@  discard block
 block discarded – undo
79 79
 		return parent::isComplete($settings);
80 80
 	}
81 81
 
82
-	#[\Override]
82
+	#[\Override ]
83 83
 	public function getConfiguration(?Settings $settings = null): array {
84 84
 		try {
85 85
 			$provider = $this->getProvider();
86 86
 			$settings = $provider->getSettings();
87 87
 			$config = parent::getConfiguration($settings);
88
-			$config['provider'] = $settings->name;
88
+			$config[ 'provider' ] = $settings->name;
89 89
 			return $config;
90
-		} catch (ConfigurationException|\Throwable $e) {
91
-			$providers = [];
90
+		} catch (ConfigurationException | \Throwable $e) {
91
+			$providers = [ ];
92 92
 			foreach ($this->telegramProviderFactory->getFqcnList() as $fqcn) {
93 93
 				$p = $this->telegramProviderFactory->get($fqcn);
94 94
 				$p->setAppConfig($this->appConfig);
95 95
 				$providerSettings = $p->getSettings();
96
-				$providers[$providerSettings->name] = parent::getConfiguration($providerSettings);
96
+				$providers[ $providerSettings->name ] = parent::getConfiguration($providerSettings);
97 97
 			}
98 98
 			return [
99 99
 				'provider' => 'none',
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		}
103 103
 	}
104 104
 
105
-	#[\Override]
105
+	#[\Override ]
106 106
 	public function remove(?Settings $settings = null): void {
107 107
 		foreach ($this->telegramProviderFactory->getFqcnList() as $fqcn) {
108 108
 			$provider = $this->telegramProviderFactory->get($fqcn);
Please login to merge, or discard this patch.
lib/Provider/Channel/SMS/Gateway.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -29,20 +29,20 @@  discard block
 block discarded – undo
29 29
 		parent::__construct($appConfig);
30 30
 	}
31 31
 
32
-	#[\Override]
33
-	public function send(string $identifier, string $message, array $extra = []): void {
32
+	#[\Override ]
33
+	public function send(string $identifier, string $message, array $extra = [ ]): void {
34 34
 		$this->getProvider()->send($identifier, $message);
35 35
 	}
36 36
 
37
-	#[\Override]
37
+	#[\Override ]
38 38
 	final public function cliConfigure(InputInterface $input, OutputInterface $output): int {
39 39
 		$namespaces = $this->smsProviderFactory->getFqcnList();
40
-		$names = [];
41
-		$providers = [];
40
+		$names = [ ];
41
+		$providers = [ ];
42 42
 		foreach ($namespaces as $ns) {
43 43
 			$provider = $this->smsProviderFactory->get($ns);
44
-			$providers[] = $provider;
45
-			$names[] = $provider->getSettings()->name;
44
+			$providers[ ] = $provider;
45
+			$names[ ] = $provider->getSettings()->name;
46 46
 		}
47 47
 
48 48
 		$helper = new QuestionHelper();
@@ -50,29 +50,29 @@  discard block
 block discarded – undo
50 50
 		$name = $helper->ask($input, $output, $choiceQuestion);
51 51
 		$selectedIndex = array_search($name, $names);
52 52
 
53
-		$provider = $providers[$selectedIndex];
53
+		$provider = $providers[ $selectedIndex ];
54 54
 
55 55
 		foreach ($provider->getSettings()->fields as $field) {
56 56
 			$id = $field->field;
57
-			$prompt = $field->prompt . ' ';
57
+			$prompt = $field->prompt.' ';
58 58
 			$defaultVal = $field->default ?? null;
59 59
 			$optional = (bool)($field->optional ?? false);
60 60
 
61 61
 			$answer = (string)$helper->ask($input, $output, new Question($prompt, $defaultVal));
62 62
 
63 63
 			if ($optional && $answer === '') {
64
-				$method = 'delete' . $this->toCamel($id);
64
+				$method = 'delete'.$this->toCamel($id);
65 65
 				$provider->{$method}();
66 66
 				continue;
67 67
 			}
68 68
 
69
-			$method = 'set' . $this->toCamel($id);
69
+			$method = 'set'.$this->toCamel($id);
70 70
 			$provider->{$method}($answer);
71 71
 		}
72 72
 		return 0;
73 73
 	}
74 74
 
75
-	#[\Override]
75
+	#[\Override ]
76 76
 	public function createSettings(): Settings {
77 77
 		try {
78 78
 			$settings = $this->getProvider()->getSettings();
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		return $settings;
85 85
 	}
86 86
 
87
-	#[\Override]
87
+	#[\Override ]
88 88
 	public function isComplete(?Settings $settings = null): bool {
89 89
 		if ($settings === null) {
90 90
 			try {
@@ -97,21 +97,21 @@  discard block
 block discarded – undo
97 97
 		return parent::isComplete($settings);
98 98
 	}
99 99
 
100
-	#[\Override]
100
+	#[\Override ]
101 101
 	public function getConfiguration(?Settings $settings = null): array {
102 102
 		try {
103 103
 			$provider = $this->getProvider();
104 104
 			$settings = $provider->getSettings();
105 105
 			$config = parent::getConfiguration($settings);
106
-			$config['provider'] = $settings->name;
106
+			$config[ 'provider' ] = $settings->name;
107 107
 			return $config;
108
-		} catch (ConfigurationException|\Throwable $e) {
109
-			$providers = [];
108
+		} catch (ConfigurationException | \Throwable $e) {
109
+			$providers = [ ];
110 110
 			foreach ($this->smsProviderFactory->getFqcnList() as $fqcn) {
111 111
 				$p = $this->smsProviderFactory->get($fqcn);
112 112
 				$p->setAppConfig($this->appConfig);
113 113
 				$providerSettings = $p->getSettings();
114
-				$providers[$providerSettings->name] = parent::getConfiguration($providerSettings);
114
+				$providers[ $providerSettings->name ] = parent::getConfiguration($providerSettings);
115 115
 			}
116 116
 			return [
117 117
 				'provider' => 'none',
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 		}
121 121
 	}
122 122
 
123
-	#[\Override]
123
+	#[\Override ]
124 124
 	public function remove(?Settings $settings = null): void {
125 125
 		foreach ($this->smsProviderFactory->getFqcnList() as $fqcn) {
126 126
 			$provider = $this->smsProviderFactory->get($fqcn);
Please login to merge, or discard this patch.