@@ -41,7 +41,7 @@ |
||
41 | 41 | |
42 | 42 | // Configure DebugKit panels. |
43 | 43 | $panels = ['BEdita/DevTools.Configuration']; |
44 | - $panels = array_merge((array)Configure::read('DebugKit.panels', []), $panels); |
|
44 | + $panels = array_merge((array) Configure::read('DebugKit.panels', []), $panels); |
|
45 | 45 | Configure::write('DebugKit.panels', $panels); |
46 | 46 | Configure::write('DebugKit.ignoreAuthorization', true); |
47 | 47 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | public function initialize(): void |
90 | 90 | { |
91 | 91 | /** @var array<string, mixed> $config */ |
92 | - $config = (array)Configure::read('ChangeLog'); |
|
92 | + $config = (array) Configure::read('ChangeLog'); |
|
93 | 93 | $this->setConfig($config); |
94 | 94 | } |
95 | 95 | |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | $from = $args->getArgument('from'); |
106 | 106 | $io->out("Reading closed PRs from from $from"); |
107 | 107 | |
108 | - $json = $this->fetchPrs((string)$from); |
|
109 | - $items = (array)Hash::get($json, 'items'); |
|
110 | - $version = (string)$args->getArgument('version'); |
|
108 | + $json = $this->fetchPrs((string) $from); |
|
109 | + $items = (array) Hash::get($json, 'items'); |
|
110 | + $version = (string) $args->getArgument('version'); |
|
111 | 111 | $items = $this->filterItems($items, $version); |
112 | 112 | $io->out(sprintf('Loaded %d prs', count($items))); |
113 | 113 | |
@@ -128,15 +128,15 @@ discard block |
||
128 | 128 | */ |
129 | 129 | protected function filterItems(array $items, string $version): array |
130 | 130 | { |
131 | - $major = substr($version, 0, (int)strpos($version, '.')); |
|
131 | + $major = substr($version, 0, (int) strpos($version, '.')); |
|
132 | 132 | |
133 | 133 | return array_filter( |
134 | 134 | $items, |
135 | - function ($item) use ($major) { |
|
135 | + function($item) use ($major) { |
|
136 | 136 | /** @var string $milestone */ |
137 | 137 | $milestone = Hash::get($item, 'milestone.title'); |
138 | 138 | $milestone = str_replace('-', '.', $milestone); |
139 | - $v = substr($milestone, 0, (int)strpos($milestone, '.')); |
|
139 | + $v = substr($milestone, 0, (int) strpos($milestone, '.')); |
|
140 | 140 | |
141 | 141 | return $v == $major; |
142 | 142 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | protected function fetchPrs(string $from): array |
153 | 153 | { |
154 | 154 | /** @var array<string, mixed> $config */ |
155 | - $config = (array)$this->getConfig('client'); |
|
155 | + $config = (array) $this->getConfig('client'); |
|
156 | 156 | $client = new Client($config); |
157 | 157 | $query = [ |
158 | 158 | 'q' => sprintf('is:pr draft:false repo:bedita/bedita merged:>%s', $from), |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $url = $this->getConfig('url'); |
165 | 165 | $response = $client->get($url, $query, compact('headers')); |
166 | 166 | |
167 | - return (array)$response->getJson(); |
|
167 | + return (array) $response->getJson(); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $res = []; |
179 | 179 | foreach ($items as $item) { |
180 | 180 | $labels = Hash::extract($item, 'labels.{n}.name'); |
181 | - $type = $this->classify((array)$labels); |
|
181 | + $type = $this->classify((array) $labels); |
|
182 | 182 | $res[$type][] = $item; |
183 | 183 | } |
184 | 184 | |
@@ -193,8 +193,8 @@ discard block |
||
193 | 193 | */ |
194 | 194 | protected function classify(array $labels): string |
195 | 195 | { |
196 | - foreach ((array)$this->getConfig('filter') as $name => $data) { |
|
197 | - if (!empty(array_intersect($labels, (array)$data))) { |
|
196 | + foreach ((array) $this->getConfig('filter') as $name => $data) { |
|
197 | + if (!empty(array_intersect($labels, (array) $data))) { |
|
198 | 198 | return $name; |
199 | 199 | } |
200 | 200 | } |
@@ -213,10 +213,10 @@ discard block |
||
213 | 213 | { |
214 | 214 | $out = sprintf("## Version %s - Cactus\n", $version); |
215 | 215 | |
216 | - foreach ((array)$this->getConfig('sections') as $name => $label) { |
|
216 | + foreach ((array) $this->getConfig('sections') as $name => $label) { |
|
217 | 217 | /** @var string $label */ |
218 | - $out .= sprintf("\n### %s changes (%s)\n\n", $label, (string)$version); |
|
219 | - $out .= $this->loglines((array)Hash::get($changeLog, $name)); |
|
218 | + $out .= sprintf("\n### %s changes (%s)\n\n", $label, (string) $version); |
|
219 | + $out .= $this->loglines((array) Hash::get($changeLog, $name)); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | file_put_contents(sprintf('changelog-%s.md', $version), $out); |
@@ -232,9 +232,9 @@ discard block |
||
232 | 232 | { |
233 | 233 | $res = ''; |
234 | 234 | foreach ($items as $item) { |
235 | - $id = (string)$item['number']; |
|
236 | - $url = (string)$item['html_url']; |
|
237 | - $title = (string)$item['title']; |
|
235 | + $id = (string) $item['number']; |
|
236 | + $url = (string) $item['html_url']; |
|
237 | + $title = (string) $item['title']; |
|
238 | 238 | $res .= sprintf("* [#%s](%s) %s\n", $id, $url, $title); |
239 | 239 | } |
240 | 240 |