@@ -37,7 +37,7 @@ |
||
| 37 | 37 | |
| 38 | 38 | // Configure DebugKit panels. |
| 39 | 39 | $panels = ['BEdita/DevTools.Configuration']; |
| 40 | - $panels = array_merge((array)Configure::read('DebugKit.panels', []), $panels); |
|
| 40 | + $panels = array_merge((array) Configure::read('DebugKit.panels', []), $panels); |
|
| 41 | 41 | Configure::write('DebugKit.panels', $panels); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function initialize(): void |
| 90 | 90 | { |
| 91 | - $config = (array)Configure::read('ChangeLog'); |
|
| 91 | + $config = (array) Configure::read('ChangeLog'); |
|
| 92 | 92 | $this->setConfig($config); |
| 93 | 93 | } |
| 94 | 94 | |
@@ -104,12 +104,12 @@ discard block |
||
| 104 | 104 | $from = $args->getArgument('from'); |
| 105 | 105 | $io->out("Reading closed PRs from from $from"); |
| 106 | 106 | |
| 107 | - $json = $this->fetchPrs((string)$from); |
|
| 108 | - $items = (array)Hash::get($json, 'items'); |
|
| 107 | + $json = $this->fetchPrs((string) $from); |
|
| 108 | + $items = (array) Hash::get($json, 'items'); |
|
| 109 | 109 | $io->out(sprintf('Loaded %d prs', count($items))); |
| 110 | 110 | |
| 111 | 111 | $changeLog = $this->createChangeLog($items); |
| 112 | - $this->saveChangeLog($changeLog, (string)$args->getArgument('version')); |
|
| 112 | + $this->saveChangeLog($changeLog, (string) $args->getArgument('version')); |
|
| 113 | 113 | |
| 114 | 114 | $io->out('Changelog created. Bye.'); |
| 115 | 115 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | */ |
| 125 | 125 | protected function fetchPrs(string $from): array |
| 126 | 126 | { |
| 127 | - $client = new Client((array)$this->getConfig('client')); |
|
| 127 | + $client = new Client((array) $this->getConfig('client')); |
|
| 128 | 128 | $query = [ |
| 129 | 129 | 'q' => sprintf('is:pr draft:false repo:bedita/bedita merged:>%s', $from), |
| 130 | 130 | 'sort' => '-closed', |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | $url = $this->getConfig('url'); |
| 136 | 136 | $response = $client->get($url, $query, compact('headers')); |
| 137 | 137 | |
| 138 | - return (array)$response->getJson(); |
|
| 138 | + return (array) $response->getJson(); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | continue; |
| 154 | 154 | } |
| 155 | 155 | $labels = Hash::extract($item, 'labels.{n}.name'); |
| 156 | - $type = $this->classify((array)$labels); |
|
| 156 | + $type = $this->classify((array) $labels); |
|
| 157 | 157 | $res[$type][] = $item; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -168,8 +168,8 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | protected function classify(array $labels): string |
| 170 | 170 | { |
| 171 | - foreach ((array)$this->getConfig('filter') as $name => $data) { |
|
| 172 | - if (!empty(array_intersect($labels, (array)$data))) { |
|
| 171 | + foreach ((array) $this->getConfig('filter') as $name => $data) { |
|
| 172 | + if (!empty(array_intersect($labels, (array) $data))) { |
|
| 173 | 173 | return $name; |
| 174 | 174 | } |
| 175 | 175 | } |
@@ -188,10 +188,10 @@ discard block |
||
| 188 | 188 | { |
| 189 | 189 | $out = sprintf("## Version %s - Cactus\n", $version); |
| 190 | 190 | |
| 191 | - foreach ((array)$this->getConfig('sections') as $name => $label) { |
|
| 191 | + foreach ((array) $this->getConfig('sections') as $name => $label) { |
|
| 192 | 192 | /** @var string $label */ |
| 193 | - $out .= sprintf("\n### %s changes (%s)\n\n", $label, (string)$version); |
|
| 194 | - $out .= $this->loglines((array)Hash::get($changeLog, $name)); |
|
| 193 | + $out .= sprintf("\n### %s changes (%s)\n\n", $label, (string) $version); |
|
| 194 | + $out .= $this->loglines((array) Hash::get($changeLog, $name)); |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | file_put_contents(sprintf('changelog-%s.md', $version), $out); |
@@ -207,9 +207,9 @@ discard block |
||
| 207 | 207 | { |
| 208 | 208 | $res = ''; |
| 209 | 209 | foreach ($items as $item) { |
| 210 | - $id = (string)$item['number']; |
|
| 211 | - $url = (string)$item['html_url']; |
|
| 212 | - $title = (string)$item['title']; |
|
| 210 | + $id = (string) $item['number']; |
|
| 211 | + $url = (string) $item['html_url']; |
|
| 212 | + $title = (string) $item['title']; |
|
| 213 | 213 | $res .= sprintf("* [#%s](%s) %s\n", $id, $url, $title); |
| 214 | 214 | } |
| 215 | 215 | |