@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | protected static $defaultName = 'app:create-stubs'; |
| 22 | 22 | |
| 23 | - protected function validateData(string|false $data): bool |
|
| 23 | + protected function validateData(string | false $data): bool |
|
| 24 | 24 | { |
| 25 | 25 | return false !== $data and !empty($data); |
| 26 | 26 | } |
@@ -255,7 +255,7 @@ |
||
| 255 | 255 | $fields = $method['fields']; |
| 256 | 256 | usort( |
| 257 | 257 | $fields, |
| 258 | - function ($a, $b) { |
|
| 258 | + function($a, $b) { |
|
| 259 | 259 | return $a['optional'] - $b['optional']; |
| 260 | 260 | } |
| 261 | 261 | ); |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | $output->writeln('Fetching data for version...'); |
| 78 | 78 | $generator = TgScraper::fromVersion($logger, $version); |
| 79 | 79 | } catch (Throwable $e) { |
| 80 | - $logger->critical((string)$e); |
|
| 80 | + $logger->critical((string) $e); |
|
| 81 | 81 | return Command::FAILURE; |
| 82 | 82 | } |
| 83 | 83 | $output->writeln('Exporting schema from data...'); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | protected function execute(InputInterface $input, OutputInterface $output): int |
| 64 | 64 | { |
| 65 | - $versionReplacer = function (string $ver) { |
|
| 65 | + $versionReplacer = function(string $ver) { |
|
| 66 | 66 | /** @noinspection PhpUndefinedFieldInspection */ |
| 67 | 67 | $this->version = $ver; |
| 68 | 68 | }; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | mkdir($destination . '/openapi/yaml', 0755, true); |
| 80 | 80 | mkdir($destination . '/stubs', 0755, true); |
| 81 | 81 | } catch (Exception $e) { |
| 82 | - $logger->critical((string)$e); |
|
| 82 | + $logger->critical((string) $e); |
|
| 83 | 83 | return Command::FAILURE; |
| 84 | 84 | } |
| 85 | 85 | $versions = array_keys( |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $logger->info($version . ': Fetching data...'); |
| 95 | 95 | $generator = TgScraper::fromVersion($logger, $version); |
| 96 | 96 | } catch (Throwable $e) { |
| 97 | - $logger->critical((string)$e); |
|
| 97 | + $logger->critical((string) $e); |
|
| 98 | 98 | return Command::FAILURE; |
| 99 | 99 | } |
| 100 | 100 | $versionReplacer->call($generator, $version); |
@@ -153,7 +153,7 @@ |
||
| 153 | 153 | 'name' => $this->name, |
| 154 | 154 | 'types' => $this->types, |
| 155 | 155 | 'optional' => $this->optional, |
| 156 | - 'description' => (string)$this->description, |
|
| 156 | + 'description' => (string) $this->description, |
|
| 157 | 157 | ]; |
| 158 | 158 | $defaultValue = $this->getDefaultValue(); |
| 159 | 159 | if (null !== $defaultValue) { |
@@ -275,7 +275,7 @@ |
||
| 275 | 275 | $phrases = explode('.', $description); |
| 276 | 276 | $phrases = array_filter( |
| 277 | 277 | $phrases, |
| 278 | - function ($phrase) { |
|
| 278 | + function($phrase) { |
|
| 279 | 279 | return (false !== stripos($phrase, 'returns') or false !== stripos($phrase, 'is returned')); |
| 280 | 280 | } |
| 281 | 281 | ); |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public function getDefaultValue(): mixed |
| 26 | 26 | { |
| 27 | - $description = (string)$this; |
|
| 27 | + $description = (string) $this; |
|
| 28 | 28 | if (stripos($description, 'must be') !== false) { |
| 29 | 29 | $text = explode('must be ', $this->dom->html())[1] ?? ''; |
| 30 | 30 | if (!empty($text)) { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | return str_replace(['“', '”'], ['', ''], $value); |
| 51 | 51 | } |
| 52 | 52 | if (is_numeric($value)) { |
| 53 | - return (int)$value; |
|
| 53 | + return (int) $value; |
|
| 54 | 54 | } |
| 55 | 55 | if (strtolower($value) == 'true') { |
| 56 | 56 | return true; |
@@ -233,7 +233,7 @@ |
||
| 233 | 233 | ]; |
| 234 | 234 | $default = $field['default'] ?? null; |
| 235 | 235 | if (!empty($default)) { |
| 236 | - $data['value'] = (string)$default; |
|
| 236 | + $data['value'] = (string) $default; |
|
| 237 | 237 | } |
| 238 | 238 | $formData[] = $data; |
| 239 | 239 | } |
@@ -105,7 +105,7 @@ |
||
| 105 | 105 | $client = new Client(); |
| 106 | 106 | try { |
| 107 | 107 | $html = $client->get($url)->getBody(); |
| 108 | - $dom = HtmlDomParser::str_get_html((string)$html); |
|
| 108 | + $dom = HtmlDomParser::str_get_html((string) $html); |
|
| 109 | 109 | } catch (GuzzleException $e) { |
| 110 | 110 | $logger->critical(sprintf('Unable to load data from URL "%s": %s', $url, $e->getMessage())); |
| 111 | 111 | throw $e; |